├── .luarc.json ├── .stylua.toml ├── LICENSE ├── README.md ├── colors └── catppuccin-mocha.lua ├── init.lua ├── lua └── rj │ ├── autocommands.lua │ ├── extras │ ├── big-file.lua │ ├── dashboard.lua │ ├── definition.lua │ ├── gui-apps.lua │ ├── last-place.lua │ ├── mini-pickproject.lua │ ├── quickfix.lua │ ├── sudo-write.lua │ ├── terminal.lua │ ├── utils.lua │ ├── venv.lua │ └── workspace-diagnostic.lua │ ├── keymaps.lua │ ├── lsp.lua │ ├── mini-deps.lua │ ├── options.lua │ └── plugins │ ├── auto-save.lua │ ├── barbecue.lua │ ├── blink.lua │ ├── catppuccin.lua │ ├── conform.lua │ ├── cybu.lua │ ├── gitsigns.lua │ ├── harpoon.lua │ ├── hop.lua │ ├── init.lua │ ├── jaq.lua │ ├── leetcode.lua │ ├── mason.lua │ ├── mini-ai.lua │ ├── mini-bracketed.lua │ ├── mini-bufremove.lua │ ├── mini-clue.lua │ ├── mini-color.lua │ ├── mini-comment.lua │ ├── mini-completion.lua │ ├── mini-cursorword.lua │ ├── mini-files.lua │ ├── mini-git.lua │ ├── mini-hipatterns.lua │ ├── mini-icons.lua │ ├── mini-indentscope.lua │ ├── mini-notify.lua │ ├── mini-pairs.lua │ ├── mini-pick.lua │ ├── mini-sessions.lua │ ├── mini-statusline.lua │ ├── mini-surround.lua │ ├── notifier.lua │ ├── nvim-bqf.lua │ ├── nvim-treesitter.lua │ ├── nvim-ts-autotag.lua │ └── typst-preview.lua ├── mini-deps-snap ├── snippets ├── c.json ├── cpp.json ├── python.json └── rust.json ├── spell ├── en.utf-8.add └── en.utf-8.add.spl ├── syntax └── qf.vim └── utils ├── install.py └── startuptime.py /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtime.version": "LuaJIT", 3 | "runtime.path": ["lua/?.lua", "lua/?/init.lua"], 4 | "diagnostics.globals": [ 5 | "_G", 6 | "vim", 7 | "MiniFiles", 8 | "MiniDeps", 9 | "MiniSessions", 10 | "MiniBufremove", 11 | "MiniExtra", 12 | "MiniPick", 13 | "MiniIcons" 14 | ], 15 | "workspace.checkThirdParty": false, 16 | "hint.enable": true, 17 | "workspace.library": ["lua", "$VIMRUNTIME", "${3rd}/luv/library"], 18 | "diagnostics.workspaceEvent": "OnSave" 19 | } 20 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | call_parentheses = "Always" 7 | collapse_simple_statement = "Never" 8 | 9 | [sort_requires] 10 | enabled = false 11 | -------------------------------------------------------------------------------- /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 | # Neovim 2 | 3 | This repository contains all my [neovim](https://github.com/neovim/neovim) config files, which I use. Now made with [mini.deps](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-deps.md) 4 | 5 | ## 🛠️ If you also want to use it 6 | 7 | Supported Neovim versions: 0.11 8 | 9 | You can see the installation instruction here - [Neovim](https://github.com/neovim/neovim/blob/master/BUILD.md) 10 | 11 | ### Make a backup of your current nvim folder 12 | 13 | ```bash 14 | mv ~/.config/nvim ~/.config/nvim.backup 15 | ``` 16 | 17 | ### Clone the repository and open nvim 18 | 19 | For main branch 20 | 21 | ```bash 22 | git clone https://github.com/Rishabh672003/Neovim ~/.config/nvim && nvim 23 | ``` 24 | 25 | Note: Installation of the LSP servers need the [Optional dependencies](#Optional-dependencies), Install them before cloning the config 26 | 27 | If LSP servers aren't getting installed by default install them using **`:MasonToolsInstall`** 28 | 29 | ### Optional dependencies 30 | 31 | These are all the optional dependencies if you don't want anything just remove them neovim should work fine either way 32 | 33 | ```bash 34 | sudo pacman -S --needed --noconfirm yarn git curl unzip tar gzip luarocks npm python-pip go 35 | ``` 36 | 37 | For Rust support install `rust-analyzer` yourself. 38 | 39 | ### Automating the whole process of installing neovim, also its dependencies and then applying the config 40 | 41 | **Note: this will install the optional dependencies so use it only after reading the script and if you know what you are doing, I will not be responsible if you break anything on your system** 42 | 43 | ```bash 44 | bash <(curl -s https://raw.githubusercontent.com/Rishabh672003/Neovim/refs/heads/main/utils/install.py) 45 | ``` 46 | 47 | ### Preview 48 | 49 | ![image](https://github.com/user-attachments/assets/85680266-ebe3-4edd-82cf-f17e15f9fa7c) 50 | ![image](https://github.com/user-attachments/assets/bfb84c0f-5bdf-41ad-ab98-1c69f4699cd5) 51 | 52 | ## Uninstallation and Cleanup 53 | 54 | ```bash 55 | rm -rf $HOME/.config/nvim $HOME/.local/share/nvim $HOME/.cache/nvim 56 | ``` 57 | 58 | ### Credit 59 | 60 | The credit goes to [Neovim-from-scratch](https://github.com/LunarVim/Neovim-from-scratch) and its author [Christian](https://github.com/ChristianChiarulli) who made this awesome repo and video playlist, this is from where I learned how to make and structure the configs and actually made it work, I used his configs as a base for most of the plugins and modified them for my needs. 61 | also I took configs and ideas from [Lunarvim](https://github.com/LunarVim/LunarVim), [Astronvim](https://github.com/AstroNvim/AstroNvim), [LazyVim](https://github.com/LazyVim/LazyVim) and [nvim-basic-ide](https://github.com/lunarvim/nvim-basic-ide) 62 | 63 |
64 | 65 | [![Lua](https://img.shields.io/badge/Made%20with%20Lua-blue.svg?style=for-the-badge&logo=lua)](#madewithlua) 66 | 67 |
68 | -------------------------------------------------------------------------------- /colors/catppuccin-mocha.lua: -------------------------------------------------------------------------------- 1 | -- Made with 'mini.colors' module of https://github.com/echasnovski/mini.nvim 2 | 3 | if vim.g.colors_name ~= nil then vim.cmd('highlight clear') end 4 | vim.g.colors_name = "catppuccin-mocha" 5 | 6 | -- Highlight groups 7 | local hi = vim.api.nvim_set_hl 8 | 9 | hi(0, "@attribute", { link = "Constant" }) 10 | hi(0, "@attribute.builtin", { link = "Special" }) 11 | hi(0, "@character.special", { link = "SpecialChar" }) 12 | hi(0, "@comment.documentation", { link = "Comment" }) 13 | hi(0, "@comment.error", { bg = "#f38ba8", fg = "#1e1e2e" }) 14 | hi(0, "@comment.hint", { bg = "#89b4fa", fg = "#1e1e2e" }) 15 | hi(0, "@comment.note", { bg = "#89b4fa", fg = "#1e1e2e" }) 16 | hi(0, "@comment.todo", { bg = "#f2cdcd", fg = "#1e1e2e" }) 17 | hi(0, "@comment.warning", { bg = "#f9e2af", fg = "#1e1e2e" }) 18 | hi(0, "@comment.warning.gitcommit", { fg = "#f9e2af" }) 19 | hi(0, "@conditional", { link = "Conditional" }) 20 | hi(0, "@constant.builtin", { fg = "#fab387" }) 21 | hi(0, "@constant.java", { fg = "#94e2d5" }) 22 | hi(0, "@constant.macro", { link = "Macro" }) 23 | hi(0, "@constructor", { fg = "#74c7ec" }) 24 | hi(0, "@constructor.lua", { fg = "#f2cdcd" }) 25 | hi(0, "@constructor.tsx", { fg = "#b4befe" }) 26 | hi(0, "@constructor.typescript", { fg = "#b4befe" }) 27 | hi(0, "@define", { link = "Define" }) 28 | hi(0, "@diff.delta", { link = "diffChanged" }) 29 | hi(0, "@diff.minus", { link = "diffRemoved" }) 30 | hi(0, "@diff.plus", { link = "diffAdded" }) 31 | hi(0, "@error", { link = "Error" }) 32 | hi(0, "@exception", { link = "Exception" }) 33 | hi(0, "@field", { fg = "#b4befe" }) 34 | hi(0, "@float", { link = "Float" }) 35 | hi(0, "@function.builtin", { fg = "#fab387" }) 36 | hi(0, "@function.builtin.bash", { fg = "#f38ba8", italic = true }) 37 | hi(0, "@function.call", { link = "Function" }) 38 | hi(0, "@function.macro", { fg = "#94e2d5" }) 39 | hi(0, "@function.method", { link = "Function" }) 40 | hi(0, "@function.method.call", { link = "Function" }) 41 | hi(0, "@function.method.call.php", { link = "Function" }) 42 | hi(0, "@function.method.php", { link = "Function" }) 43 | hi(0, "@ibl.indent.char.1", { fg = "#313244", nocombine = true }) 44 | hi(0, "@ibl.scope.char.1", { fg = "#cdd6f4", nocombine = true }) 45 | hi(0, "@ibl.scope.underline.1", { sp = "#cdd6f4", underline = true }) 46 | hi(0, "@ibl.whitespace.char.1", { fg = "#45475a", nocombine = true }) 47 | hi(0, "@include", { link = "Include" }) 48 | hi(0, "@keyword.conditional", { link = "Conditional" }) 49 | hi(0, "@keyword.conditional.ternary", { link = "Operator" }) 50 | hi(0, "@keyword.coroutine", { link = "Keyword" }) 51 | hi(0, "@keyword.debug", { link = "Exception" }) 52 | hi(0, "@keyword.directive", { link = "PreProc" }) 53 | hi(0, "@keyword.directive.define", { link = "Define" }) 54 | hi(0, "@keyword.exception", { link = "Exception" }) 55 | hi(0, "@keyword.export", { fg = "#89dceb" }) 56 | hi(0, "@keyword.function", { fg = "#cba6f7" }) 57 | hi(0, "@keyword.import", { link = "Include" }) 58 | hi(0, "@keyword.modifier", { link = "Keyword" }) 59 | hi(0, "@keyword.operator", { link = "Operator" }) 60 | hi(0, "@keyword.repeat", { link = "Repeat" }) 61 | hi(0, "@keyword.return", { fg = "#cba6f7" }) 62 | hi(0, "@keyword.storage", { link = "Keyword" }) 63 | hi(0, "@keyword.type", { link = "Keyword" }) 64 | hi(0, "@label.json", { fg = "#89b4fa" }) 65 | hi(0, "@lsp.mod.deprecated", { link = "DiagnosticDeprecated" }) 66 | hi(0, "@lsp.type.boolean", { link = "@boolean" }) 67 | hi(0, "@lsp.type.builtinType", { link = "@type.builtin" }) 68 | hi(0, "@lsp.type.class", { link = "@type" }) 69 | hi(0, "@lsp.type.comment", { link = "@comment" }) 70 | hi(0, "@lsp.type.decorator", { link = "@attribute" }) 71 | hi(0, "@lsp.type.enum", { link = "@type" }) 72 | hi(0, "@lsp.type.enumMember", { link = "@constant" }) 73 | hi(0, "@lsp.type.escapeSequence", { link = "@string.escape" }) 74 | hi(0, "@lsp.type.event", { link = "@type" }) 75 | hi(0, "@lsp.type.formatSpecifier", { link = "@punctuation.special" }) 76 | hi(0, "@lsp.type.function", { link = "@function" }) 77 | hi(0, "@lsp.type.interface", { fg = "#f2cdcd" }) 78 | hi(0, "@lsp.type.keyword", { link = "@keyword" }) 79 | hi(0, "@lsp.type.macro", { link = "@constant.macro" }) 80 | hi(0, "@lsp.type.method", { link = "@function.method" }) 81 | hi(0, "@lsp.type.modifier", { link = "@type.qualifier" }) 82 | hi(0, "@lsp.type.namespace", { link = "@module" }) 83 | hi(0, "@lsp.type.number", { link = "@number" }) 84 | hi(0, "@lsp.type.operator", { link = "@operator" }) 85 | hi(0, "@lsp.type.parameter", { link = "@parameter" }) 86 | hi(0, "@lsp.type.property", { link = "@property" }) 87 | hi(0, "@lsp.type.regexp", { link = "@string.regexp" }) 88 | hi(0, "@lsp.type.selfKeyword", { link = "@variable.builtin" }) 89 | hi(0, "@lsp.type.string", { link = "@string" }) 90 | hi(0, "@lsp.type.struct", { link = "@type" }) 91 | hi(0, "@lsp.type.type", { link = "@type" }) 92 | hi(0, "@lsp.type.typeAlias", { link = "@type.definition" }) 93 | hi(0, "@lsp.type.typeParameter", { link = "@type.definition" }) 94 | hi(0, "@lsp.type.unresolvedReference", { link = "@error" }) 95 | hi(0, "@lsp.type.variable", {}) 96 | hi(0, "@lsp.typemod.class.defaultLibrary", { link = "@type.builtin" }) 97 | hi(0, "@lsp.typemod.enum.defaultLibrary", { link = "@type.builtin" }) 98 | hi(0, "@lsp.typemod.enumMember.defaultLibrary", { link = "@constant.builtin" }) 99 | hi(0, "@lsp.typemod.function.defaultLibrary", { link = "@function.builtin" }) 100 | hi(0, "@lsp.typemod.keyword.async", { link = "@keyword.coroutine" }) 101 | hi(0, "@lsp.typemod.macro.defaultLibrary", { link = "@function.builtin" }) 102 | hi(0, "@lsp.typemod.method.defaultLibrary", { link = "@function.builtin" }) 103 | hi(0, "@lsp.typemod.operator.injected", { link = "@operator" }) 104 | hi(0, "@lsp.typemod.string.injected", { link = "@string" }) 105 | hi(0, "@lsp.typemod.type.defaultLibrary", { link = "@type.builtin" }) 106 | hi(0, "@lsp.typemod.variable.defaultLibrary", { link = "@variable.builtin" }) 107 | hi(0, "@lsp.typemod.variable.injected", { link = "@variable" }) 108 | hi(0, "@markup", { fg = "#cdd6f4" }) 109 | hi(0, "@markup.environment", { fg = "#f5c2e7" }) 110 | hi(0, "@markup.environment.name", { fg = "#89b4fa" }) 111 | hi(0, "@markup.heading", { bold = true, fg = "#89b4fa" }) 112 | hi(0, "@markup.heading.1.delimiter.vimdoc", { bg = "#1e1e2e", fg = "#1e1e2e", nocombine = true, sp = "#cdd6f4", underdouble = true }) 113 | hi(0, "@markup.heading.1.markdown", { link = "rainbow1" }) 114 | hi(0, "@markup.heading.2.delimiter.vimdoc", { bg = "#1e1e2e", fg = "#1e1e2e", nocombine = true, sp = "#cdd6f4", underline = true }) 115 | hi(0, "@markup.heading.2.markdown", { link = "rainbow2" }) 116 | hi(0, "@markup.heading.3.markdown", { link = "rainbow3" }) 117 | hi(0, "@markup.heading.4.markdown", { link = "rainbow4" }) 118 | hi(0, "@markup.heading.5.markdown", { link = "rainbow5" }) 119 | hi(0, "@markup.heading.6.markdown", { link = "rainbow6" }) 120 | hi(0, "@markup.italic", { fg = "#eba0ac", italic = true }) 121 | hi(0, "@markup.link", { link = "Tag" }) 122 | hi(0, "@markup.link.label", { link = "Label" }) 123 | hi(0, "@markup.link.url", { fg = "#f5e0dc", italic = true, underline = true }) 124 | hi(0, "@markup.list", { link = "Special" }) 125 | hi(0, "@markup.list.checked", { fg = "#a6e3a1" }) 126 | hi(0, "@markup.list.unchecked", { fg = "#7f849c" }) 127 | hi(0, "@markup.math", { fg = "#89b4fa" }) 128 | hi(0, "@markup.quote", { bold = true, fg = "#eba0ac" }) 129 | hi(0, "@markup.raw", { fg = "#94e2d5" }) 130 | hi(0, "@markup.strikethrough", { fg = "#cdd6f4", strikethrough = true }) 131 | hi(0, "@markup.strong", { bold = true, fg = "#eba0ac" }) 132 | hi(0, "@markup.underline", { link = "Underlined" }) 133 | hi(0, "@method", { link = "Function" }) 134 | hi(0, "@method.call", { link = "Function" }) 135 | hi(0, "@method.call.php", { link = "Function" }) 136 | hi(0, "@method.php", { link = "Function" }) 137 | hi(0, "@module", { fg = "#b4befe", italic = true }) 138 | hi(0, "@module.builtin", { link = "Special" }) 139 | hi(0, "@namespace", { fg = "#b4befe", italic = true }) 140 | hi(0, "@number.css", { fg = "#fab387" }) 141 | hi(0, "@number.float", { link = "Float" }) 142 | hi(0, "@parameter", { fg = "#eba0ac" }) 143 | hi(0, "@preproc", { link = "PreProc" }) 144 | hi(0, "@property", { fg = "#b4befe" }) 145 | hi(0, "@property.class.css", { fg = "#f9e2af" }) 146 | hi(0, "@property.cpp", { fg = "#cdd6f4" }) 147 | hi(0, "@property.css", { fg = "#b4befe" }) 148 | hi(0, "@property.id.css", { fg = "#89b4fa" }) 149 | hi(0, "@property.toml", { fg = "#89b4fa" }) 150 | hi(0, "@property.typescript", { fg = "#b4befe" }) 151 | hi(0, "@punctuation.bracket", { fg = "#9399b2" }) 152 | hi(0, "@punctuation.delimiter", { link = "Delimiter" }) 153 | hi(0, "@punctuation.special", { link = "Special" }) 154 | hi(0, "@repeat", { link = "Repeat" }) 155 | hi(0, "@storageclass", { link = "Keyword" }) 156 | hi(0, "@string.documentation", { fg = "#94e2d5" }) 157 | hi(0, "@string.escape", { fg = "#f5c2e7" }) 158 | hi(0, "@string.plain.css", { fg = "#fab387" }) 159 | hi(0, "@string.regex", { fg = "#fab387" }) 160 | hi(0, "@string.regexp", { fg = "#fab387" }) 161 | hi(0, "@string.special", { link = "Special" }) 162 | hi(0, "@string.special.path", { link = "Special" }) 163 | hi(0, "@string.special.path.gitignore", { fg = "#cdd6f4" }) 164 | hi(0, "@string.special.symbol", { fg = "#f2cdcd" }) 165 | hi(0, "@string.special.symbol.ruby", { fg = "#f2cdcd" }) 166 | hi(0, "@string.special.url", { fg = "#f5e0dc", italic = true, underline = true }) 167 | hi(0, "@symbol", { fg = "#f2cdcd" }) 168 | hi(0, "@symbol.ruby", { fg = "#f2cdcd" }) 169 | hi(0, "@tag", { fg = "#cba6f7" }) 170 | hi(0, "@tag.attribute", { fg = "#94e2d5", italic = true }) 171 | hi(0, "@tag.attribute.tsx", { fg = "#94e2d5", italic = true }) 172 | hi(0, "@tag.builtin", { link = "Special" }) 173 | hi(0, "@tag.delimiter", { fg = "#89dceb" }) 174 | hi(0, "@text", { fg = "#cdd6f4" }) 175 | hi(0, "@text.danger", { bg = "#f38ba8", fg = "#1e1e2e" }) 176 | hi(0, "@text.diff.add", { link = "diffAdded" }) 177 | hi(0, "@text.diff.delete", { link = "diffRemoved" }) 178 | hi(0, "@text.emphasis", { fg = "#eba0ac", italic = true }) 179 | hi(0, "@text.environment", { fg = "#f5c2e7" }) 180 | hi(0, "@text.environment.name", { fg = "#89b4fa" }) 181 | hi(0, "@text.literal", { fg = "#94e2d5" }) 182 | hi(0, "@text.math", { fg = "#89b4fa" }) 183 | hi(0, "@text.note", { bg = "#89b4fa", fg = "#1e1e2e" }) 184 | hi(0, "@text.reference", { link = "Tag" }) 185 | hi(0, "@text.strike", { fg = "#cdd6f4", strikethrough = true }) 186 | hi(0, "@text.strong", { bold = true, fg = "#eba0ac" }) 187 | hi(0, "@text.title", { bold = true, fg = "#89b4fa" }) 188 | hi(0, "@text.title.1.markdown", { link = "rainbow1" }) 189 | hi(0, "@text.title.2.markdown", { link = "rainbow2" }) 190 | hi(0, "@text.title.3.markdown", { link = "rainbow3" }) 191 | hi(0, "@text.title.4.markdown", { link = "rainbow4" }) 192 | hi(0, "@text.title.5.markdown", { link = "rainbow5" }) 193 | hi(0, "@text.title.6.markdown", { link = "rainbow6" }) 194 | hi(0, "@text.todo", { bg = "#f2cdcd", fg = "#1e1e2e" }) 195 | hi(0, "@text.todo.checked", { fg = "#a6e3a1" }) 196 | hi(0, "@text.todo.unchecked", { fg = "#7f849c" }) 197 | hi(0, "@text.underline", { link = "Underlined" }) 198 | hi(0, "@text.warning", { bg = "#f9e2af", fg = "#1e1e2e" }) 199 | hi(0, "@type.builtin", { fg = "#f9e2af" }) 200 | hi(0, "@type.builtin.c", { fg = "#f9e2af" }) 201 | hi(0, "@type.builtin.cpp", { fg = "#f9e2af" }) 202 | hi(0, "@type.css", { fg = "#b4befe" }) 203 | hi(0, "@type.definition", { link = "Type" }) 204 | hi(0, "@type.qualifier", { link = "Keyword" }) 205 | hi(0, "@type.tag.css", { fg = "#cba6f7" }) 206 | hi(0, "@variable", { fg = "#cdd6f4" }) 207 | hi(0, "@variable.builtin", { fg = "#f38ba8" }) 208 | hi(0, "@variable.member", { fg = "#b4befe" }) 209 | hi(0, "@variable.parameter", { fg = "#eba0ac" }) 210 | hi(0, "@variable.parameter.builtin", { link = "Special" }) 211 | hi(0, "AlphaButtons", { fg = "#b4befe" }) 212 | hi(0, "AlphaFooter", { fg = "#f9e2af", italic = true }) 213 | hi(0, "AlphaHeader", { fg = "#89b4fa" }) 214 | hi(0, "AlphaHeaderLabel", { fg = "#fab387" }) 215 | hi(0, "AlphaShortcut", { fg = "#a6e3a1" }) 216 | hi(0, "Bold", { bold = true }) 217 | hi(0, "Boolean", { fg = "#fab387" }) 218 | hi(0, "Character", { fg = "#94e2d5" }) 219 | hi(0, "CmpItemAbbr", { fg = "#9399b2" }) 220 | hi(0, "CmpItemAbbrDeprecated", { fg = "#6c7086", strikethrough = true }) 221 | hi(0, "CmpItemAbbrMatch", { bold = true, fg = "#cdd6f4" }) 222 | hi(0, "CmpItemAbbrMatchFuzzy", { bold = true, fg = "#cdd6f4" }) 223 | hi(0, "CmpItemKind", { fg = "#89b4fa" }) 224 | hi(0, "CmpItemKindClass", { fg = "#f9e2af" }) 225 | hi(0, "CmpItemKindColor", { fg = "#f38ba8" }) 226 | hi(0, "CmpItemKindConstant", { fg = "#fab387" }) 227 | hi(0, "CmpItemKindConstructor", { fg = "#89b4fa" }) 228 | hi(0, "CmpItemKindCopilot", { fg = "#94e2d5" }) 229 | hi(0, "CmpItemKindEnum", { fg = "#a6e3a1" }) 230 | hi(0, "CmpItemKindEnumMember", { fg = "#f38ba8" }) 231 | hi(0, "CmpItemKindEvent", { fg = "#89b4fa" }) 232 | hi(0, "CmpItemKindField", { fg = "#a6e3a1" }) 233 | hi(0, "CmpItemKindFile", { fg = "#89b4fa" }) 234 | hi(0, "CmpItemKindFolder", { fg = "#89b4fa" }) 235 | hi(0, "CmpItemKindFunction", { fg = "#89b4fa" }) 236 | hi(0, "CmpItemKindInterface", { fg = "#f9e2af" }) 237 | hi(0, "CmpItemKindKeyword", { fg = "#f38ba8" }) 238 | hi(0, "CmpItemKindMethod", { fg = "#89b4fa" }) 239 | hi(0, "CmpItemKindModule", { fg = "#89b4fa" }) 240 | hi(0, "CmpItemKindOperator", { fg = "#89b4fa" }) 241 | hi(0, "CmpItemKindProperty", { fg = "#a6e3a1" }) 242 | hi(0, "CmpItemKindReference", { fg = "#f38ba8" }) 243 | hi(0, "CmpItemKindSnippet", { fg = "#cba6f7" }) 244 | hi(0, "CmpItemKindStruct", { fg = "#89b4fa" }) 245 | hi(0, "CmpItemKindText", { fg = "#94e2d5" }) 246 | hi(0, "CmpItemKindTypeParameter", { fg = "#89b4fa" }) 247 | hi(0, "CmpItemKindUnit", { fg = "#a6e3a1" }) 248 | hi(0, "CmpItemKindValue", { fg = "#fab387" }) 249 | hi(0, "CmpItemKindVariable", { fg = "#f2cdcd" }) 250 | hi(0, "CmpItemMenu", { fg = "#cdd6f4" }) 251 | hi(0, "ColorColumn", { bg = "#313244" }) 252 | hi(0, "Comment", { fg = "#9399b2", italic = true }) 253 | hi(0, "Conceal", { fg = "#7f849c" }) 254 | hi(0, "Conditional", { fg = "#cba6f7", italic = true }) 255 | hi(0, "Constant", { fg = "#fab387" }) 256 | hi(0, "CurSearch", { bg = "#f38ba8", fg = "#181825" }) 257 | hi(0, "Cursor", { bg = "#cdd6f4", fg = "#1e1e2e" }) 258 | hi(0, "CursorColumn", { bg = "#181825" }) 259 | hi(0, "CursorIM", { bg = "#cdd6f4", fg = "#1e1e2e" }) 260 | hi(0, "CursorLine", { bg = "#2a2b3c" }) 261 | hi(0, "CursorLineNr", { fg = "#b4befe" }) 262 | hi(0, "CybuAdjacent", { fg = "#9399b2" }) 263 | hi(0, "CybuBackground", { link = "Normal" }) 264 | hi(0, "CybuBorder", { link = "FloatBorder" }) 265 | hi(0, "CybuFocus", { bg = "#45475a", fg = "#cdd6f4" }) 266 | hi(0, "CybuInfobar", { link = "StatusLine" }) 267 | hi(0, "DapBreakpoint", { fg = "#f38ba8" }) 268 | hi(0, "DapBreakpointCondition", { fg = "#f9e2af" }) 269 | hi(0, "DapBreakpointRejected", { fg = "#cba6f7" }) 270 | hi(0, "DapLogPoint", { fg = "#89dceb" }) 271 | hi(0, "DapStopped", { fg = "#eba0ac" }) 272 | hi(0, "DapUIBreakpointsCurrentLine", { bold = true, fg = "#a6e3a1" }) 273 | hi(0, "DapUIBreakpointsDisabledLine", { fg = "#585b70" }) 274 | hi(0, "DapUIBreakpointsInfo", { fg = "#a6e3a1" }) 275 | hi(0, "DapUIBreakpointsPath", { fg = "#89dceb" }) 276 | hi(0, "DapUIDecoration", { fg = "#89dceb" }) 277 | hi(0, "DapUIFloatBorder", { link = "FloatBorder" }) 278 | hi(0, "DapUILineNumber", { fg = "#89dceb" }) 279 | hi(0, "DapUIModifiedValue", { fg = "#fab387" }) 280 | hi(0, "DapUIPlayPause", { fg = "#a6e3a1" }) 281 | hi(0, "DapUIRestart", { fg = "#a6e3a1" }) 282 | hi(0, "DapUIScope", { fg = "#89dceb" }) 283 | hi(0, "DapUISource", { fg = "#b4befe" }) 284 | hi(0, "DapUIStepBack", { fg = "#89b4fa" }) 285 | hi(0, "DapUIStepInto", { fg = "#89b4fa" }) 286 | hi(0, "DapUIStepOut", { fg = "#89b4fa" }) 287 | hi(0, "DapUIStepOver", { fg = "#89b4fa" }) 288 | hi(0, "DapUIStop", { fg = "#f38ba8" }) 289 | hi(0, "DapUIStoppedThread", { fg = "#89dceb" }) 290 | hi(0, "DapUIThread", { fg = "#a6e3a1" }) 291 | hi(0, "DapUIType", { fg = "#cba6f7" }) 292 | hi(0, "DapUIUnavailable", { fg = "#45475a" }) 293 | hi(0, "DapUIValue", { fg = "#89dceb" }) 294 | hi(0, "DapUIVariable", { fg = "#cdd6f4" }) 295 | hi(0, "DapUIWatchesEmpty", { fg = "#eba0ac" }) 296 | hi(0, "DapUIWatchesError", { fg = "#eba0ac" }) 297 | hi(0, "DapUIWatchesValue", { fg = "#a6e3a1" }) 298 | hi(0, "DapUIWinSelect", { fg = "#fab387" }) 299 | hi(0, "DashboardCenter", { fg = "#a6e3a1" }) 300 | hi(0, "DashboardDesc", { fg = "#89b4fa" }) 301 | hi(0, "DashboardFiles", { fg = "#b4befe" }) 302 | hi(0, "DashboardFooter", { fg = "#f9e2af", italic = true }) 303 | hi(0, "DashboardHeader", { fg = "#89b4fa" }) 304 | hi(0, "DashboardIcon", { bold = true, fg = "#f5c2e7" }) 305 | hi(0, "DashboardKey", { fg = "#fab387" }) 306 | hi(0, "DashboardMruTitle", { fg = "#89dceb" }) 307 | hi(0, "DashboardProjectTitle", { fg = "#89dceb" }) 308 | hi(0, "DashboardShortCut", { fg = "#f5c2e7" }) 309 | hi(0, "Delimiter", { fg = "#9399b2" }) 310 | hi(0, "DiagnosticError", { fg = "#f38ba8", italic = true }) 311 | hi(0, "DiagnosticFloatingError", { fg = "#f38ba8" }) 312 | hi(0, "DiagnosticFloatingHint", { fg = "#94e2d5" }) 313 | hi(0, "DiagnosticFloatingInfo", { fg = "#89dceb" }) 314 | hi(0, "DiagnosticFloatingOk", { fg = "#a6e3a1" }) 315 | hi(0, "DiagnosticFloatingWarn", { fg = "#f9e2af" }) 316 | hi(0, "DiagnosticHint", { fg = "#94e2d5", italic = true }) 317 | hi(0, "DiagnosticInfo", { fg = "#89dceb", italic = true }) 318 | hi(0, "DiagnosticOk", { fg = "#a6e3a1", italic = true }) 319 | hi(0, "DiagnosticSignError", { fg = "#f38ba8" }) 320 | hi(0, "DiagnosticSignHint", { fg = "#94e2d5" }) 321 | hi(0, "DiagnosticSignInfo", { fg = "#89dceb" }) 322 | hi(0, "DiagnosticSignOk", { fg = "#a6e3a1" }) 323 | hi(0, "DiagnosticSignWarn", { fg = "#f9e2af" }) 324 | hi(0, "DiagnosticUnderlineError", { sp = "#f38ba8", underline = true }) 325 | hi(0, "DiagnosticUnderlineHint", { sp = "#94e2d5", underline = true }) 326 | hi(0, "DiagnosticUnderlineInfo", { sp = "#89dceb", underline = true }) 327 | hi(0, "DiagnosticUnderlineOk", { sp = "#a6e3a1", underline = true }) 328 | hi(0, "DiagnosticUnderlineWarn", { sp = "#f9e2af", underline = true }) 329 | hi(0, "DiagnosticVirtualTextError", { bg = "#32283a", fg = "#f38ba8", italic = true }) 330 | hi(0, "DiagnosticVirtualTextHint", { bg = "#29313e", fg = "#94e2d5", italic = true }) 331 | hi(0, "DiagnosticVirtualTextInfo", { bg = "#283040", fg = "#89dceb", italic = true }) 332 | hi(0, "DiagnosticVirtualTextOk", { bg = "#29313e", fg = "#a6e3a1", italic = true }) 333 | hi(0, "DiagnosticVirtualTextWarn", { bg = "#33313a", fg = "#f9e2af", italic = true }) 334 | hi(0, "DiagnosticWarn", { fg = "#f9e2af", italic = true }) 335 | hi(0, "DiffAdd", { bg = "#364143" }) 336 | hi(0, "DiffChange", { bg = "#25293c" }) 337 | hi(0, "DiffDelete", { bg = "#443244" }) 338 | hi(0, "DiffText", { bg = "#3e4b6b" }) 339 | hi(0, "Directory", { fg = "#89b4fa" }) 340 | hi(0, "DressingSelectIdx", { link = "Special" }) 341 | hi(0, "DropBarIconUISeparator", { fg = "#7f849c" }) 342 | hi(0, "DropBarKindArray", { fg = "#cdd6f4" }) 343 | hi(0, "DropBarKindBoolean", { fg = "#cdd6f4" }) 344 | hi(0, "DropBarKindBreakStatement", { fg = "#cdd6f4" }) 345 | hi(0, "DropBarKindCall", { fg = "#cdd6f4" }) 346 | hi(0, "DropBarKindCaseStatement", { fg = "#cdd6f4" }) 347 | hi(0, "DropBarKindClass", { fg = "#cdd6f4" }) 348 | hi(0, "DropBarKindConstant", { fg = "#cdd6f4" }) 349 | hi(0, "DropBarKindConstructor", { fg = "#cdd6f4" }) 350 | hi(0, "DropBarKindContinueStatement", { fg = "#cdd6f4" }) 351 | hi(0, "DropBarKindDeclaration", { fg = "#cdd6f4" }) 352 | hi(0, "DropBarKindDelete", { fg = "#cdd6f4" }) 353 | hi(0, "DropBarKindDoStatement", { fg = "#cdd6f4" }) 354 | hi(0, "DropBarKindElseStatement", { fg = "#cdd6f4" }) 355 | hi(0, "DropBarKindEnum", { fg = "#cdd6f4" }) 356 | hi(0, "DropBarKindEnumMember", { fg = "#cdd6f4" }) 357 | hi(0, "DropBarKindEvent", { fg = "#cdd6f4" }) 358 | hi(0, "DropBarKindField", { fg = "#cdd6f4" }) 359 | hi(0, "DropBarKindFile", { fg = "#cdd6f4" }) 360 | hi(0, "DropBarKindFolder", { fg = "#cdd6f4" }) 361 | hi(0, "DropBarKindForStatement", { fg = "#cdd6f4" }) 362 | hi(0, "DropBarKindFunction", { fg = "#cdd6f4" }) 363 | hi(0, "DropBarKindIdentifier", { fg = "#cdd6f4" }) 364 | hi(0, "DropBarKindIfStatement", { fg = "#cdd6f4" }) 365 | hi(0, "DropBarKindInterface", { fg = "#cdd6f4" }) 366 | hi(0, "DropBarKindKeyword", { fg = "#cdd6f4" }) 367 | hi(0, "DropBarKindList", { fg = "#cdd6f4" }) 368 | hi(0, "DropBarKindMacro", { fg = "#cdd6f4" }) 369 | hi(0, "DropBarKindMarkdownH1", { fg = "#cdd6f4" }) 370 | hi(0, "DropBarKindMarkdownH2", { fg = "#cdd6f4" }) 371 | hi(0, "DropBarKindMarkdownH3", { fg = "#cdd6f4" }) 372 | hi(0, "DropBarKindMarkdownH4", { fg = "#cdd6f4" }) 373 | hi(0, "DropBarKindMarkdownH5", { fg = "#cdd6f4" }) 374 | hi(0, "DropBarKindMarkdownH6", { fg = "#cdd6f4" }) 375 | hi(0, "DropBarKindMethod", { fg = "#cdd6f4" }) 376 | hi(0, "DropBarKindModule", { fg = "#cdd6f4" }) 377 | hi(0, "DropBarKindNamespace", { fg = "#cdd6f4" }) 378 | hi(0, "DropBarKindNull", { fg = "#cdd6f4" }) 379 | hi(0, "DropBarKindNumber", { fg = "#cdd6f4" }) 380 | hi(0, "DropBarKindObject", { fg = "#cdd6f4" }) 381 | hi(0, "DropBarKindOperator", { fg = "#cdd6f4" }) 382 | hi(0, "DropBarKindPackage", { fg = "#cdd6f4" }) 383 | hi(0, "DropBarKindProperty", { fg = "#cdd6f4" }) 384 | hi(0, "DropBarKindReference", { fg = "#cdd6f4" }) 385 | hi(0, "DropBarKindRepeat", { fg = "#cdd6f4" }) 386 | hi(0, "DropBarKindScope", { fg = "#cdd6f4" }) 387 | hi(0, "DropBarKindSpecifier", { fg = "#cdd6f4" }) 388 | hi(0, "DropBarKindStatement", { fg = "#cdd6f4" }) 389 | hi(0, "DropBarKindString", { fg = "#cdd6f4" }) 390 | hi(0, "DropBarKindStruct", { fg = "#cdd6f4" }) 391 | hi(0, "DropBarKindSwitchStatement", { fg = "#cdd6f4" }) 392 | hi(0, "DropBarKindType", { fg = "#cdd6f4" }) 393 | hi(0, "DropBarKindTypeParameter", { fg = "#cdd6f4" }) 394 | hi(0, "DropBarKindUnit", { fg = "#cdd6f4" }) 395 | hi(0, "DropBarKindValue", { fg = "#cdd6f4" }) 396 | hi(0, "DropBarKindVariable", { fg = "#cdd6f4" }) 397 | hi(0, "DropBarKindWhileStatement", { fg = "#cdd6f4" }) 398 | hi(0, "DropBarMenuHoverEntry", { link = "Visual" }) 399 | hi(0, "DropBarMenuHoverIcon", { reverse = true }) 400 | hi(0, "DropBarMenuHoverSymbol", { bold = true }) 401 | hi(0, "EndOfBuffer", { fg = "#1e1e2e" }) 402 | hi(0, "Error", { fg = "#f38ba8" }) 403 | hi(0, "ErrorMsg", { bold = true, fg = "#f38ba8", italic = true }) 404 | hi(0, "Exception", { fg = "#cba6f7" }) 405 | hi(0, "FlashBackdrop", { fg = "#6c7086" }) 406 | hi(0, "FlashCurrent", { bg = "#1e1e2e", fg = "#fab387" }) 407 | hi(0, "FlashLabel", { bg = "#1e1e2e", bold = true, fg = "#a6e3a1" }) 408 | hi(0, "FlashMatch", { bg = "#1e1e2e", fg = "#b4befe" }) 409 | hi(0, "FlashPrompt", { link = "NormalFloat" }) 410 | hi(0, "FloatBorder", { fg = "#89b4fa" }) 411 | hi(0, "FloatTitle", { fg = "#a6adc8" }) 412 | hi(0, "FoldColumn", { fg = "#6c7086" }) 413 | hi(0, "Folded", { bg = "#45475a", fg = "#89b4fa" }) 414 | hi(0, "Function", { fg = "#89b4fa" }) 415 | hi(0, "GitSignsAdd", { fg = "#a6e3a1" }) 416 | hi(0, "GitSignsAddPreview", { link = "DiffAdd" }) 417 | hi(0, "GitSignsChange", { fg = "#f9e2af" }) 418 | hi(0, "GitSignsCurrentLineBlame", { fg = "#45475a" }) 419 | hi(0, "GitSignsDelete", { fg = "#f38ba8" }) 420 | hi(0, "GitSignsDeletePreview", { link = "DiffDelete" }) 421 | hi(0, "GitSignsStagedAdd", { fg = "#537150" }) 422 | hi(0, "GitSignsStagedAddCul", { fg = "#537150" }) 423 | hi(0, "GitSignsStagedAddLn", { bg = "#364143" }) 424 | hi(0, "GitSignsStagedAddNr", { fg = "#537150" }) 425 | hi(0, "GitSignsStagedChange", { fg = "#7c7157" }) 426 | hi(0, "GitSignsStagedChangeCul", { fg = "#7c7157" }) 427 | hi(0, "GitSignsStagedChangeLn", { bg = "#25293c" }) 428 | hi(0, "GitSignsStagedChangeNr", { fg = "#7c7157" }) 429 | hi(0, "GitSignsStagedChangedelete", { fg = "#7c7157" }) 430 | hi(0, "GitSignsStagedChangedeleteCul", { fg = "#7c7157" }) 431 | hi(0, "GitSignsStagedChangedeleteLn", { bg = "#25293c" }) 432 | hi(0, "GitSignsStagedChangedeleteNr", { fg = "#7c7157" }) 433 | hi(0, "GitSignsStagedDelete", { fg = "#794554" }) 434 | hi(0, "GitSignsStagedDeleteCul", { fg = "#794554" }) 435 | hi(0, "GitSignsStagedDeleteNr", { fg = "#794554" }) 436 | hi(0, "GitSignsStagedTopdelete", { fg = "#794554" }) 437 | hi(0, "GitSignsStagedTopdeleteCul", { fg = "#794554" }) 438 | hi(0, "GitSignsStagedTopdeleteNr", { fg = "#794554" }) 439 | hi(0, "GlyphPalette1", { fg = "#f38ba8" }) 440 | hi(0, "GlyphPalette2", { fg = "#94e2d5" }) 441 | hi(0, "GlyphPalette3", { fg = "#f9e2af" }) 442 | hi(0, "GlyphPalette4", { fg = "#89b4fa" }) 443 | hi(0, "GlyphPalette6", { fg = "#94e2d5" }) 444 | hi(0, "GlyphPalette7", { fg = "#cdd6f4" }) 445 | hi(0, "GlyphPalette9", { fg = "#f38ba8" }) 446 | hi(0, "HopNextKey", { bold = true, ctermfg = 198, fg = "#ff007c" }) 447 | hi(0, "HopNextKey1", { bold = true, ctermfg = 45, fg = "#00dfff" }) 448 | hi(0, "HopNextKey2", { ctermfg = 33, fg = "#2b8db3" }) 449 | hi(0, "HopUnmatched", { ctermfg = 242, fg = "#666666", sp = "#666666" }) 450 | hi(0, "IblIndent", { fg = "#313244" }) 451 | hi(0, "IblScope", { fg = "#cdd6f4" }) 452 | hi(0, "IblWhitespace", { fg = "#45475a" }) 453 | hi(0, "Identifier", { fg = "#f2cdcd" }) 454 | hi(0, "IlluminatedWordRead", { bg = "#393b4d" }) 455 | hi(0, "IlluminatedWordText", { bg = "#393b4d" }) 456 | hi(0, "IlluminatedWordWrite", { bg = "#393b4d" }) 457 | hi(0, "IncSearch", { bg = "#7ec9d8", fg = "#181825" }) 458 | hi(0, "Include", { fg = "#cba6f7" }) 459 | hi(0, "IndentBlankLineContextChar", { fg = "#cdd6f4" }) 460 | hi(0, "Italic", { italic = true }) 461 | hi(0, "Keyword", { fg = "#cba6f7" }) 462 | hi(0, "Label", { fg = "#74c7ec" }) 463 | hi(0, "LineNr", { fg = "#45475a" }) 464 | hi(0, "LspCodeLens", { fg = "#6c7086" }) 465 | hi(0, "LspDiagnosticsDefaultError", { fg = "#f38ba8" }) 466 | hi(0, "LspDiagnosticsDefaultHint", { fg = "#94e2d5" }) 467 | hi(0, "LspDiagnosticsDefaultInformation", { fg = "#89dceb" }) 468 | hi(0, "LspDiagnosticsDefaultWarning", { fg = "#f9e2af" }) 469 | hi(0, "LspDiagnosticsError", { fg = "#f38ba8" }) 470 | hi(0, "LspDiagnosticsHint", { fg = "#94e2d5" }) 471 | hi(0, "LspDiagnosticsInformation", { fg = "#89dceb" }) 472 | hi(0, "LspDiagnosticsUnderlineError", { sp = "#f38ba8", underline = true }) 473 | hi(0, "LspDiagnosticsUnderlineHint", { sp = "#94e2d5", underline = true }) 474 | hi(0, "LspDiagnosticsUnderlineInformation", { sp = "#89dceb", underline = true }) 475 | hi(0, "LspDiagnosticsUnderlineWarning", { sp = "#f9e2af", underline = true }) 476 | hi(0, "LspDiagnosticsVirtualTextError", { fg = "#f38ba8", italic = true }) 477 | hi(0, "LspDiagnosticsVirtualTextHint", { fg = "#94e2d5", italic = true }) 478 | hi(0, "LspDiagnosticsVirtualTextInformation", { fg = "#89dceb", italic = true }) 479 | hi(0, "LspDiagnosticsVirtualTextWarning", { fg = "#f9e2af", italic = true }) 480 | hi(0, "LspDiagnosticsWarning", { fg = "#f9e2af" }) 481 | hi(0, "LspInfoBorder", { link = "FloatBorder" }) 482 | hi(0, "LspInlayHint", { fg = "#6c7086", italic = true }) 483 | hi(0, "LspReferenceRead", { bg = "#45475a" }) 484 | hi(0, "LspReferenceText", { bg = "#45475a" }) 485 | hi(0, "LspReferenceWrite", { bg = "#45475a" }) 486 | hi(0, "LspSignatureActiveParameter", { fg = "#fab387" }) 487 | hi(0, "Macro", { fg = "#cba6f7" }) 488 | hi(0, "MatchParen", { bg = "#45475a", bold = true, fg = "#fab387" }) 489 | hi(0, "MiniAnimateCursor", { nocombine = true, reverse = true }) 490 | hi(0, "MiniAnimateNormalFloat", { link = "NormalFloat" }) 491 | hi(0, "MiniClueBorder", { link = "FloatBorder" }) 492 | hi(0, "MiniClueDescGroup", { link = "DiagnosticFloatingWarn" }) 493 | hi(0, "MiniClueDescSingle", { link = "NormalFloat" }) 494 | hi(0, "MiniClueNextKey", { link = "DiagnosticFloatingHint" }) 495 | hi(0, "MiniClueNextKeyWithPostkeys", { link = "DiagnosticFloatingError" }) 496 | hi(0, "MiniClueSeparator", { link = "DiagnosticFloatingInfo" }) 497 | hi(0, "MiniClueTitle", { link = "FloatTitle" }) 498 | hi(0, "MiniCompletionActiveParameter", { underline = true }) 499 | hi(0, "MiniCursorword", { link = "Visual" }) 500 | hi(0, "MiniCursorwordCurrent", {}) 501 | hi(0, "MiniDepsChangeAdded", { link = "diffAdded" }) 502 | hi(0, "MiniDepsChangeRemoved", { link = "diffRemoved" }) 503 | hi(0, "MiniDepsTitleError", { bg = "#f38ba8", fg = "#1e1e2e" }) 504 | hi(0, "MiniDepsTitleUpdate", { bg = "#a6e3a1", fg = "#1e1e2e" }) 505 | hi(0, "MiniDiffOverAdd", { link = "DiffAdd" }) 506 | hi(0, "MiniDiffOverChange", { link = "DiffText" }) 507 | hi(0, "MiniDiffOverContext", { link = "DiffChange" }) 508 | hi(0, "MiniDiffOverDelete", { link = "DiffDelete" }) 509 | hi(0, "MiniDiffSignAdd", { fg = "#a6e3a1" }) 510 | hi(0, "MiniDiffSignChange", { fg = "#f9e2af" }) 511 | hi(0, "MiniDiffSignDelete", { fg = "#f38ba8" }) 512 | hi(0, "MiniFilesBorder", { link = "FloatBorder" }) 513 | hi(0, "MiniFilesBorderModified", { link = "DiagnosticFloatingWarn" }) 514 | hi(0, "MiniFilesCursorLine", { link = "CursorLine" }) 515 | hi(0, "MiniFilesDirectory", { link = "Directory" }) 516 | hi(0, "MiniFilesFile", { fg = "#cdd6f4" }) 517 | hi(0, "MiniFilesNormal", { link = "NormalFloat" }) 518 | hi(0, "MiniFilesTitle", { link = "FloatTitle" }) 519 | hi(0, "MiniFilesTitleFocused", { bold = true, fg = "#a6adc8" }) 520 | hi(0, "MiniHipatternsFixme", { bg = "#f38ba8", bold = true, fg = "#1e1e2e" }) 521 | hi(0, "MiniHipatternsHack", { bg = "#f9e2af", bold = true, fg = "#1e1e2e" }) 522 | hi(0, "MiniHipatternsNote", { bg = "#89dceb", bold = true, fg = "#1e1e2e" }) 523 | hi(0, "MiniHipatternsTodo", { bg = "#94e2d5", bold = true, fg = "#1e1e2e" }) 524 | hi(0, "MiniHipatterns_89b4fa_bg", { bg = "#89b4fa", fg = "#000000" }) 525 | hi(0, "MiniHipatterns_cdd6f4_bg", { bg = "#cdd6f4", fg = "#000000" }) 526 | hi(0, "MiniHipatterns_fab387_bg", { bg = "#fab387", fg = "#000000" }) 527 | hi(0, "MiniIconsAzure", { fg = "#74c7ec" }) 528 | hi(0, "MiniIconsBlue", { fg = "#89b4fa" }) 529 | hi(0, "MiniIconsCyan", { fg = "#94e2d5" }) 530 | hi(0, "MiniIconsGreen", { fg = "#a6e3a1" }) 531 | hi(0, "MiniIconsGrey", { fg = "#cdd6f4" }) 532 | hi(0, "MiniIconsOrange", { fg = "#fab387" }) 533 | hi(0, "MiniIconsPurple", { fg = "#cba6f7" }) 534 | hi(0, "MiniIconsRed", { fg = "#f38ba8" }) 535 | hi(0, "MiniIconsYellow", { fg = "#f9e2af" }) 536 | hi(0, "MiniIndentscopePrefix", { nocombine = true }) 537 | hi(0, "MiniIndentscopeSymbol", { fg = "#cdd6f4" }) 538 | hi(0, "MiniJump", { bg = "#f5c2e7", fg = "#9399b2" }) 539 | hi(0, "MiniJump2dDim", { fg = "#6c7086" }) 540 | hi(0, "MiniJump2dSpot", { bg = "#1e1e2e", bold = true, fg = "#fab387", underline = true }) 541 | hi(0, "MiniJump2dSpotAhead", { bg = "#191926", fg = "#94e2d5" }) 542 | hi(0, "MiniJump2dSpotUnique", { bg = "#1e1e2e", bold = true, fg = "#89dceb" }) 543 | hi(0, "MiniMapNormal", { link = "NormalFloat" }) 544 | hi(0, "MiniMapSymbolCount", { link = "Special" }) 545 | hi(0, "MiniMapSymbolLine", { link = "Title" }) 546 | hi(0, "MiniMapSymbolView", { link = "Delimiter" }) 547 | hi(0, "MiniNotifyBorder", { link = "FloatBorder" }) 548 | hi(0, "MiniNotifyNormal", { link = "NormalFloat" }) 549 | hi(0, "MiniNotifyTitle", { link = "FloatTitle" }) 550 | hi(0, "MiniOperatorsExchangeFrom", { link = "IncSearch" }) 551 | hi(0, "MiniPickBorder", { link = "FloatBorder" }) 552 | hi(0, "MiniPickBorderBusy", { link = "DiagnosticFloatingWarn" }) 553 | hi(0, "MiniPickBorderText", { fg = "#cba6f7" }) 554 | hi(0, "MiniPickHeader", { link = "DiagnosticFloatingHint" }) 555 | hi(0, "MiniPickIconDirectory", { link = "Directory" }) 556 | hi(0, "MiniPickIconFile", { link = "MiniPickNormal" }) 557 | hi(0, "MiniPickMatchCurrent", { link = "CursorLine" }) 558 | hi(0, "MiniPickMatchMarked", { link = "Visual" }) 559 | hi(0, "MiniPickMatchRanges", { link = "DiagnosticFloatingHint" }) 560 | hi(0, "MiniPickNormal", { link = "NormalFloat" }) 561 | hi(0, "MiniPickPreviewLine", { link = "CursorLine" }) 562 | hi(0, "MiniPickPreviewRegion", { link = "IncSearch" }) 563 | hi(0, "MiniPickPrompt", { link = "DiagnosticFloatingInfo" }) 564 | hi(0, "MiniStarterFooter", { fg = "#f9e2af", italic = true }) 565 | hi(0, "MiniStarterHeader", { fg = "#89b4fa" }) 566 | hi(0, "MiniStarterInactive", { fg = "#585b70", italic = true }) 567 | hi(0, "MiniStarterItem", { fg = "#cdd6f4" }) 568 | hi(0, "MiniStarterItemBullet", { fg = "#89b4fa" }) 569 | hi(0, "MiniStarterItemPrefix", { fg = "#f5c2e7" }) 570 | hi(0, "MiniStarterQuery", { fg = "#a6e3a1" }) 571 | hi(0, "MiniStarterSection", { fg = "#f2cdcd" }) 572 | hi(0, "MiniStatuslineDevinfo", { bg = "#45475a", fg = "#bac2de" }) 573 | hi(0, "MiniStatuslineFileinfo", { bg = "#45475a", fg = "#bac2de" }) 574 | hi(0, "MiniStatuslineFilename", { bg = "#181825", fg = "#cdd6f4" }) 575 | hi(0, "MiniStatuslineInactive", { bg = "#181825", fg = "#89b4fa" }) 576 | hi(0, "MiniStatuslineModeCommand", { bg = "#fab387", bold = true, fg = "#1e1e2e" }) 577 | hi(0, "MiniStatuslineModeInsert", { bg = "#a6e3a1", bold = true, fg = "#1e1e2e" }) 578 | hi(0, "MiniStatuslineModeNormal", { bg = "#89b4fa", bold = true, fg = "#181825" }) 579 | hi(0, "MiniStatuslineModeOther", { bg = "#94e2d5", bold = true, fg = "#1e1e2e" }) 580 | hi(0, "MiniStatuslineModeReplace", { bg = "#f38ba8", bold = true, fg = "#1e1e2e" }) 581 | hi(0, "MiniStatuslineModeVisual", { bg = "#cba6f7", bold = true, fg = "#1e1e2e" }) 582 | hi(0, "MiniSurround", { bg = "#f5c2e7", fg = "#45475a" }) 583 | hi(0, "MiniTablineCurrent", { bg = "#1e1e2e", bold = true, fg = "#cdd6f4", italic = true, sp = "#f38ba8", underline = true }) 584 | hi(0, "MiniTablineFill", { bg = "#1e1e2e" }) 585 | hi(0, "MiniTablineHidden", { bg = "#181825", fg = "#cdd6f4" }) 586 | hi(0, "MiniTablineModifiedCurrent", { bold = true, fg = "#f38ba8", italic = true }) 587 | hi(0, "MiniTablineModifiedHidden", { fg = "#f38ba8" }) 588 | hi(0, "MiniTablineModifiedVisible", { fg = "#f38ba8" }) 589 | hi(0, "MiniTablineTabpagesection", { bg = "#1e1e2e", fg = "#45475a" }) 590 | hi(0, "MiniTestEmphasis", { bold = true }) 591 | hi(0, "MiniTestFail", { bold = true, fg = "#f38ba8" }) 592 | hi(0, "MiniTestPass", { bold = true, fg = "#a6e3a1" }) 593 | hi(0, "MiniTrailspace", { bg = "#f38ba8" }) 594 | hi(0, "ModeMsg", { bold = true, fg = "#cdd6f4" }) 595 | hi(0, "MoreMsg", { fg = "#89b4fa" }) 596 | hi(0, "MsgSeparator", {}) 597 | hi(0, "NavicSeparator", { link = "Normal" }) 598 | hi(0, "NeoTreeDimText", { fg = "#7f849c" }) 599 | hi(0, "NeoTreeDirectoryIcon", { fg = "#89b4fa" }) 600 | hi(0, "NeoTreeDirectoryName", { fg = "#89b4fa" }) 601 | hi(0, "NeoTreeExpander", { fg = "#6c7086" }) 602 | hi(0, "NeoTreeFileNameOpened", { fg = "#f5c2e7" }) 603 | hi(0, "NeoTreeFilterTerm", { bold = true, fg = "#a6e3a1" }) 604 | hi(0, "NeoTreeFloatBorder", { link = "FloatBorder" }) 605 | hi(0, "NeoTreeFloatTitle", { link = "FloatTitle" }) 606 | hi(0, "NeoTreeGitAdded", { fg = "#a6e3a1" }) 607 | hi(0, "NeoTreeGitConflict", { fg = "#f38ba8" }) 608 | hi(0, "NeoTreeGitDeleted", { fg = "#f38ba8" }) 609 | hi(0, "NeoTreeGitIgnored", { fg = "#6c7086" }) 610 | hi(0, "NeoTreeGitModified", { fg = "#f9e2af" }) 611 | hi(0, "NeoTreeGitStaged", { fg = "#a6e3a1" }) 612 | hi(0, "NeoTreeGitUnstaged", { fg = "#f38ba8" }) 613 | hi(0, "NeoTreeGitUntracked", { fg = "#cba6f7" }) 614 | hi(0, "NeoTreeIndentMarker", { fg = "#6c7086" }) 615 | hi(0, "NeoTreeModified", { fg = "#fab387" }) 616 | hi(0, "NeoTreeNormal", { bg = "#181825", fg = "#cdd6f4" }) 617 | hi(0, "NeoTreeNormalNC", { bg = "#181825", fg = "#cdd6f4" }) 618 | hi(0, "NeoTreeRootName", { bold = true, fg = "#89b4fa" }) 619 | hi(0, "NeoTreeStatusLineNC", { bg = "#181825", fg = "#181825" }) 620 | hi(0, "NeoTreeSymbolicLinkTarget", { fg = "#f5c2e7" }) 621 | hi(0, "NeoTreeTabActive", { bg = "#181825", bold = true, fg = "#b4befe" }) 622 | hi(0, "NeoTreeTabInactive", { bg = "#1e1e2e", fg = "#6c7086" }) 623 | hi(0, "NeoTreeTabSeparatorActive", { bg = "#181825", fg = "#181825" }) 624 | hi(0, "NeoTreeTabSeparatorInactive", { bg = "#1e1e2e", fg = "#1e1e2e" }) 625 | hi(0, "NeoTreeTitleBar", { bg = "#89b4fa", fg = "#181825" }) 626 | hi(0, "NeoTreeVertSplit", { bg = "#1e1e2e", fg = "#1e1e2e" }) 627 | hi(0, "NeoTreeWinSeparator", { bg = "#1e1e2e", fg = "#1e1e2e" }) 628 | hi(0, "NeogitBranch", { bold = true, fg = "#fab387" }) 629 | hi(0, "NeogitChangeAdded", { bold = true, fg = "#a6e3a1" }) 630 | hi(0, "NeogitChangeBothModified", { bold = true, fg = "#f9e2af" }) 631 | hi(0, "NeogitChangeCopied", { bold = true, fg = "#f5c2e7" }) 632 | hi(0, "NeogitChangeDeleted", { bold = true, fg = "#f38ba8" }) 633 | hi(0, "NeogitChangeModified", { bold = true, fg = "#89b4fa" }) 634 | hi(0, "NeogitChangeNewFile", { bold = true, fg = "#a6e3a1" }) 635 | hi(0, "NeogitChangeRenamed", { bold = true, fg = "#cba6f7" }) 636 | hi(0, "NeogitChangeUpdated", { bold = true, fg = "#fab387" }) 637 | hi(0, "NeogitCommitViewHeader", { bg = "#3e4b6b", fg = "#97bbf9" }) 638 | hi(0, "NeogitDiffAdd", { bg = "#2b3139", fg = "#8bbc8a" }) 639 | hi(0, "NeogitDiffAddHighlight", { bg = "#4d6256", fg = "#ace1ad" }) 640 | hi(0, "NeogitDiffContext", { bg = "#1e1e2e" }) 641 | hi(0, "NeogitDiffContextHighlight", { bg = "#313244" }) 642 | hi(0, "NeogitDiffDelete", { bg = "#32283a", fg = "#c87590" }) 643 | hi(0, "NeogitDiffDeleteHighlight", { bg = "#674458", fg = "#ed96b3" }) 644 | hi(0, "NeogitDiffHeader", { bg = "#1e1e2e", bold = true, fg = "#89b4fa" }) 645 | hi(0, "NeogitDiffHeaderHighlight", { bg = "#1e1e2e", bold = true, fg = "#fab387" }) 646 | hi(0, "NeogitFilePath", { fg = "#89b4fa", italic = true }) 647 | hi(0, "NeogitGraphBlue", { fg = "#89b4fa" }) 648 | hi(0, "NeogitGraphBoldBlue", { bold = true, fg = "#89b4fa" }) 649 | hi(0, "NeogitGraphBoldCyan", { bold = true, fg = "#89b4fa" }) 650 | hi(0, "NeogitGraphBoldGray", { bold = true, fg = "#bac2de" }) 651 | hi(0, "NeogitGraphBoldGreen", { bold = true, fg = "#a6e3a1" }) 652 | hi(0, "NeogitGraphBoldPurple", { bold = true, fg = "#b4befe" }) 653 | hi(0, "NeogitGraphBoldRed", { bold = true, fg = "#f38ba8" }) 654 | hi(0, "NeogitGraphBoldWhite", { bold = true }) 655 | hi(0, "NeogitGraphBoldYellow", { bold = true, fg = "#f9e2af" }) 656 | hi(0, "NeogitGraphCyan", { fg = "#89b4fa" }) 657 | hi(0, "NeogitGraphGray", { fg = "#bac2de" }) 658 | hi(0, "NeogitGraphGreen", { fg = "#a6e3a1" }) 659 | hi(0, "NeogitGraphOrange", { fg = "#fab387" }) 660 | hi(0, "NeogitGraphPurple", { fg = "#b4befe" }) 661 | hi(0, "NeogitGraphRed", { fg = "#f38ba8" }) 662 | hi(0, "NeogitGraphWhite", { fg = "#1e1e2e" }) 663 | hi(0, "NeogitGraphYellow", { fg = "#f9e2af" }) 664 | hi(0, "NeogitHunkHeader", { bg = "#282c41", fg = "#546994" }) 665 | hi(0, "NeogitHunkHeaderHighlight", { bg = "#353e5a", fg = "#89b4fa" }) 666 | hi(0, "NeogitNotificationError", { fg = "#f38ba8" }) 667 | hi(0, "NeogitNotificationInfo", { fg = "#89b4fa" }) 668 | hi(0, "NeogitNotificationWarning", { fg = "#f9e2af" }) 669 | hi(0, "NeogitObjectId", { link = "Comment" }) 670 | hi(0, "NeogitPopupActionKey", { fg = "#b4befe" }) 671 | hi(0, "NeogitPopupBold", { bold = true }) 672 | hi(0, "NeogitPopupConfigKey", { fg = "#b4befe" }) 673 | hi(0, "NeogitPopupOptionKey", { fg = "#b4befe" }) 674 | hi(0, "NeogitPopupSwitchKey", { fg = "#b4befe" }) 675 | hi(0, "NeogitRebaseDone", { link = "Comment" }) 676 | hi(0, "NeogitRebasing", { bold = true, fg = "#cba6f7" }) 677 | hi(0, "NeogitRecentcommits", { bold = true, fg = "#cba6f7" }) 678 | hi(0, "NeogitRemote", { bold = true, fg = "#a6e3a1" }) 679 | hi(0, "NeogitSectionHeader", { bold = true, fg = "#cba6f7" }) 680 | hi(0, "NeogitStagedchanges", { bold = true, fg = "#cba6f7" }) 681 | hi(0, "NeogitStash", { link = "Comment" }) 682 | hi(0, "NeogitStashes", { bold = true, fg = "#cba6f7" }) 683 | hi(0, "NeogitTagDistance", { fg = "#89b4fa" }) 684 | hi(0, "NeogitTagName", { fg = "#f9e2af" }) 685 | hi(0, "NeogitUnmergedInto", { link = "Function" }) 686 | hi(0, "NeogitUnmergedchanges", { bold = true, fg = "#cba6f7" }) 687 | hi(0, "NeogitUnpulledFrom", { link = "Function" }) 688 | hi(0, "NeogitUnpulledchanges", { bold = true, fg = "#cba6f7" }) 689 | hi(0, "NeogitUnpushedTo", { bold = true, fg = "#b4befe" }) 690 | hi(0, "NeogitUnstagedchanges", { bold = true, fg = "#cba6f7" }) 691 | hi(0, "NeogitUntrackedfiles", { bold = true, fg = "#cba6f7" }) 692 | hi(0, "NeogitWinSeparator", { link = "WinSeparator" }) 693 | hi(0, "NoiceCmdline", { fg = "#cdd6f4" }) 694 | hi(0, "NoiceCmdlineIcon", { fg = "#89dceb", italic = true }) 695 | hi(0, "NoiceCmdlineIconSearch", { fg = "#f9e2af" }) 696 | hi(0, "NoiceCmdlinePopupBorder", { fg = "#b4befe" }) 697 | hi(0, "NoiceCmdlinePopupBorderSearch", { fg = "#f9e2af" }) 698 | hi(0, "NoiceConfirmBorder", { fg = "#89b4fa" }) 699 | hi(0, "NoiceFormatProgressDone", { bg = "#3e5767", fg = "#a6adc8" }) 700 | hi(0, "NoiceFormatProgressTodo", { bg = "#2a2b3c", fg = "#a6adc8" }) 701 | hi(0, "NoiceMini", { blend = 0, fg = "#a6adc8" }) 702 | hi(0, "NonText", { fg = "#6c7086" }) 703 | hi(0, "Normal", { bg = "#1e1e2e", fg = "#cdd6f4" }) 704 | hi(0, "NormalFloat", { bg = "#181825", fg = "#cdd6f4" }) 705 | hi(0, "NormalNC", { bg = "#1e1e2e", fg = "#cdd6f4" }) 706 | hi(0, "NormalSB", { bg = "#11111b", fg = "#cdd6f4" }) 707 | hi(0, "Number", { fg = "#fab387" }) 708 | hi(0, "NvimTreeEmptyFolderName", { fg = "#89b4fa" }) 709 | hi(0, "NvimTreeFolderIcon", { fg = "#89b4fa" }) 710 | hi(0, "NvimTreeFolderName", { fg = "#89b4fa" }) 711 | hi(0, "NvimTreeGitDeleted", { fg = "#f38ba8" }) 712 | hi(0, "NvimTreeGitDirty", { fg = "#f9e2af" }) 713 | hi(0, "NvimTreeGitNew", { fg = "#89b4fa" }) 714 | hi(0, "NvimTreeImageFile", { fg = "#cdd6f4" }) 715 | hi(0, "NvimTreeIndentMarker", { fg = "#6c7086" }) 716 | hi(0, "NvimTreeNormal", { bg = "#181825", fg = "#cdd6f4" }) 717 | hi(0, "NvimTreeOpenedFile", { fg = "#f5c2e7" }) 718 | hi(0, "NvimTreeOpenedFolderName", { fg = "#89b4fa" }) 719 | hi(0, "NvimTreeRootFolder", { bold = true, fg = "#b4befe" }) 720 | hi(0, "NvimTreeSpecialFile", { fg = "#f2cdcd" }) 721 | hi(0, "NvimTreeStatuslineNc", { bg = "#181825", fg = "#181825" }) 722 | hi(0, "NvimTreeSymlink", { fg = "#f5c2e7" }) 723 | hi(0, "NvimTreeWinSeparator", { bg = "#1e1e2e", fg = "#1e1e2e" }) 724 | hi(0, "Operator", { fg = "#89dceb" }) 725 | hi(0, "Pmenu", { bg = "#2b2b3c", fg = "#9399b2" }) 726 | hi(0, "PmenuSbar", { bg = "#45475a" }) 727 | hi(0, "PmenuSel", { bg = "#45475a", bold = true }) 728 | hi(0, "PmenuThumb", { bg = "#6c7086" }) 729 | hi(0, "PreProc", { fg = "#f5c2e7" }) 730 | hi(0, "Question", { fg = "#89b4fa" }) 731 | hi(0, "QuickFixLine", { bg = "#45475a", bold = true }) 732 | hi(0, "RainbowDelimiterBlue", { fg = "#89b4fa" }) 733 | hi(0, "RainbowDelimiterCyan", { fg = "#94e2d5" }) 734 | hi(0, "RainbowDelimiterGreen", { fg = "#a6e3a1" }) 735 | hi(0, "RainbowDelimiterOrange", { fg = "#fab387" }) 736 | hi(0, "RainbowDelimiterRed", { fg = "#f38ba8" }) 737 | hi(0, "RainbowDelimiterViolet", { fg = "#cba6f7" }) 738 | hi(0, "RainbowDelimiterYellow", { fg = "#f9e2af" }) 739 | hi(0, "RenderMarkdownBullet", { fg = "#89dceb" }) 740 | hi(0, "RenderMarkdownCode", { bg = "#181825" }) 741 | hi(0, "RenderMarkdownCodeInline", { bg = "#313244" }) 742 | hi(0, "RenderMarkdownError", { fg = "#f38ba8" }) 743 | hi(0, "RenderMarkdownH1", { fg = "#f38ba8" }) 744 | hi(0, "RenderMarkdownH1Bg", { bg = "#5e3f53" }) 745 | hi(0, "RenderMarkdownH2", { fg = "#fab387" }) 746 | hi(0, "RenderMarkdownH2Bg", { bg = "#604b49" }) 747 | hi(0, "RenderMarkdownH3", { fg = "#f9e2af" }) 748 | hi(0, "RenderMarkdownH3Bg", { bg = "#605955" }) 749 | hi(0, "RenderMarkdownH4", { fg = "#a6e3a1" }) 750 | hi(0, "RenderMarkdownH4Bg", { bg = "#475951" }) 751 | hi(0, "RenderMarkdownH5", { fg = "#74c7ec" }) 752 | hi(0, "RenderMarkdownH5Bg", { bg = "#385167" }) 753 | hi(0, "RenderMarkdownH6", { fg = "#b4befe" }) 754 | hi(0, "RenderMarkdownH6Bg", { bg = "#4b4e6c" }) 755 | hi(0, "RenderMarkdownHint", { fg = "#94e2d5" }) 756 | hi(0, "RenderMarkdownInfo", { fg = "#89dceb" }) 757 | hi(0, "RenderMarkdownSuccess", { fg = "#a6e3a1" }) 758 | hi(0, "RenderMarkdownTableHead", { fg = "#89b4fa" }) 759 | hi(0, "RenderMarkdownTableRow", { fg = "#b4befe" }) 760 | hi(0, "RenderMarkdownWarn", { fg = "#f9e2af" }) 761 | hi(0, "Repeat", { fg = "#cba6f7" }) 762 | hi(0, "Search", { bg = "#3e5767", fg = "#cdd6f4" }) 763 | hi(0, "SignColumn", { fg = "#45475a" }) 764 | hi(0, "SignColumnSB", { bg = "#11111b", fg = "#45475a" }) 765 | hi(0, "Special", { fg = "#f5c2e7" }) 766 | hi(0, "SpecialKey", { link = "NonText" }) 767 | hi(0, "SpellBad", { sp = "#f38ba8", undercurl = true }) 768 | hi(0, "SpellCap", { sp = "#f9e2af", undercurl = true }) 769 | hi(0, "SpellLocal", { sp = "#89b4fa", undercurl = true }) 770 | hi(0, "SpellRare", { sp = "#a6e3a1", undercurl = true }) 771 | hi(0, "Statement", { fg = "#cba6f7" }) 772 | hi(0, "StatusLine", {}) 773 | hi(0, "StatusLineNC", { bg = "#181825", fg = "#45475a" }) 774 | hi(0, "StorageClass", { fg = "#f9e2af" }) 775 | hi(0, "String", { fg = "#a6e3a1" }) 776 | hi(0, "Structure", { fg = "#f9e2af" }) 777 | hi(0, "Substitute", { bg = "#45475a", fg = "#f5c2e7" }) 778 | hi(0, "TabLine", { bg = "#181825", fg = "#6c7086" }) 779 | hi(0, "TabLineFill", { bg = "#181825" }) 780 | hi(0, "TabLineSel", { bg = "#45475a", fg = "#a6e3a1" }) 781 | hi(0, "Tag", { bold = true, fg = "#b4befe" }) 782 | hi(0, "TelescopeBorder", { link = "FloatBorder" }) 783 | hi(0, "TelescopeMatching", { fg = "#89b4fa" }) 784 | hi(0, "TelescopeSelection", { bg = "#313244", bold = true, fg = "#cdd6f4" }) 785 | hi(0, "TelescopeSelectionCaret", { fg = "#f2cdcd" }) 786 | hi(0, "TermCursor", { bg = "#f5e0dc", fg = "#1e1e2e" }) 787 | hi(0, "TermCursorNC", { bg = "#9399b2", fg = "#1e1e2e" }) 788 | hi(0, "Title", { bold = true, fg = "#89b4fa" }) 789 | hi(0, "Todo", { bg = "#f2cdcd", bold = true, fg = "#1e1e2e" }) 790 | hi(0, "TreesitterContextBottom", { sp = "#313244", underline = true }) 791 | hi(0, "TreesitterContextLineNumber", { bg = "#181825", fg = "#45475a" }) 792 | hi(0, "Type", { fg = "#f9e2af" }) 793 | hi(0, "UfoFoldedEllipsis", { bg = "#89b4fa", fg = "#11111b" }) 794 | hi(0, "UfoFoldedFg", { fg = "#b4befe" }) 795 | hi(0, "VertSplit", { fg = "#11111b" }) 796 | hi(0, "Visual", { bg = "#45475a", bold = true }) 797 | hi(0, "VisualNOS", { bg = "#45475a", bold = true }) 798 | hi(0, "WarningMsg", { fg = "#f9e2af" }) 799 | hi(0, "WhichKeyGroup", { fg = "#fab387" }) 800 | hi(0, "WhichKeySeparator", { fg = "#cdd6f4" }) 801 | hi(0, "Whitespace", { fg = "#45475a" }) 802 | hi(0, "WildMenu", { bg = "#6c7086" }) 803 | hi(0, "WinBar", { fg = "#f5e0dc" }) 804 | hi(0, "WinBarNC", { link = "WinBar" }) 805 | hi(0, "WinSeparator", { fg = "#11111b" }) 806 | hi(0, "barbecue_basename", { bold = true, fg = "#cdd6f4" }) 807 | hi(0, "barbecue_context", { fg = "#cdd6f4" }) 808 | hi(0, "barbecue_context_array", { fg = "#89b4fa" }) 809 | hi(0, "barbecue_context_boolean", { fg = "#fab387" }) 810 | hi(0, "barbecue_context_class", { fg = "#f9e2af" }) 811 | hi(0, "barbecue_context_constant", { fg = "#fab387" }) 812 | hi(0, "barbecue_context_constructor", { fg = "#89b4fa" }) 813 | hi(0, "barbecue_context_enum", { fg = "#a6e3a1" }) 814 | hi(0, "barbecue_context_enum_member", { fg = "#f38ba8" }) 815 | hi(0, "barbecue_context_event", { fg = "#89b4fa" }) 816 | hi(0, "barbecue_context_field", { fg = "#a6e3a1" }) 817 | hi(0, "barbecue_context_file", { fg = "#89b4fa" }) 818 | hi(0, "barbecue_context_function", { fg = "#89b4fa" }) 819 | hi(0, "barbecue_context_interface", { fg = "#f9e2af" }) 820 | hi(0, "barbecue_context_key", { fg = "#f2cdcd" }) 821 | hi(0, "barbecue_context_method", { fg = "#89b4fa" }) 822 | hi(0, "barbecue_context_module", { fg = "#89b4fa" }) 823 | hi(0, "barbecue_context_namespace", { fg = "#89b4fa" }) 824 | hi(0, "barbecue_context_null", { fg = "#fab387" }) 825 | hi(0, "barbecue_context_number", { fg = "#fab387" }) 826 | hi(0, "barbecue_context_object", { fg = "#89b4fa" }) 827 | hi(0, "barbecue_context_operator", { fg = "#89b4fa" }) 828 | hi(0, "barbecue_context_package", { fg = "#89b4fa" }) 829 | hi(0, "barbecue_context_property", { fg = "#a6e3a1" }) 830 | hi(0, "barbecue_context_string", { fg = "#a6e3a1" }) 831 | hi(0, "barbecue_context_struct", { fg = "#89b4fa" }) 832 | hi(0, "barbecue_context_type_parameter", { fg = "#89b4fa" }) 833 | hi(0, "barbecue_context_variable", { fg = "#f2cdcd" }) 834 | hi(0, "barbecue_dirname", { fg = "#7f849c" }) 835 | hi(0, "barbecue_ellipsis", { fg = "#7f849c" }) 836 | hi(0, "barbecue_fileicon_Lua", { fg = "#51a0cf" }) 837 | hi(0, "barbecue_modified", { fg = "#fab387" }) 838 | hi(0, "barbecue_normal", { fg = "#cdd6f4" }) 839 | hi(0, "barbecue_separator", { fg = "#7f849c" }) 840 | hi(0, "csvCol0", { fg = "#f38ba8" }) 841 | hi(0, "csvCol1", { fg = "#fab387" }) 842 | hi(0, "csvCol2", { fg = "#f9e2af" }) 843 | hi(0, "csvCol3", { fg = "#a6e3a1" }) 844 | hi(0, "csvCol4", { fg = "#89dceb" }) 845 | hi(0, "csvCol5", { fg = "#89b4fa" }) 846 | hi(0, "csvCol6", { fg = "#b4befe" }) 847 | hi(0, "csvCol7", { fg = "#cba6f7" }) 848 | hi(0, "csvCol8", { fg = "#f5c2e7" }) 849 | hi(0, "debugBreakpoint", { bg = "#1e1e2e", fg = "#6c7086" }) 850 | hi(0, "debugPC", { bg = "#11111b" }) 851 | hi(0, "diffAdded", { fg = "#a6e3a1" }) 852 | hi(0, "diffChanged", { fg = "#89b4fa" }) 853 | hi(0, "diffFile", { fg = "#89b4fa" }) 854 | hi(0, "diffIndexLine", { fg = "#94e2d5" }) 855 | hi(0, "diffLine", { fg = "#6c7086" }) 856 | hi(0, "diffNewFile", { fg = "#fab387" }) 857 | hi(0, "diffOldFile", { fg = "#f9e2af" }) 858 | hi(0, "diffRemoved", { fg = "#f38ba8" }) 859 | hi(0, "gitcommitSummary", { fg = "#f5e0dc", italic = true }) 860 | hi(0, "healthError", { fg = "#f38ba8" }) 861 | hi(0, "healthSuccess", { fg = "#94e2d5" }) 862 | hi(0, "healthWarning", { fg = "#f9e2af" }) 863 | hi(0, "htmlBold", { bold = true }) 864 | hi(0, "htmlBoldItalic", { bold = true, italic = true }) 865 | hi(0, "htmlBoldUnderline", { bold = true, underline = true }) 866 | hi(0, "htmlBoldUnderlineItalic", { bold = true, italic = true, underline = true }) 867 | hi(0, "htmlH1", { bold = true, fg = "#f5c2e7" }) 868 | hi(0, "htmlH2", { bold = true, fg = "#89b4fa" }) 869 | hi(0, "htmlItalic", { italic = true }) 870 | hi(0, "htmlStrike", { strikethrough = true }) 871 | hi(0, "htmlUnderline", { underline = true }) 872 | hi(0, "htmlUnderlineItalic", { italic = true, underline = true }) 873 | hi(0, "illuminatedCurWord", { bg = "#45475a" }) 874 | hi(0, "illuminatedWord", { bg = "#45475a" }) 875 | hi(0, "lCursor", { bg = "#cdd6f4", fg = "#1e1e2e" }) 876 | hi(0, "markdownCode", { fg = "#f2cdcd" }) 877 | hi(0, "markdownCodeBlock", { fg = "#f2cdcd" }) 878 | hi(0, "markdownH1", { link = "rainbow1" }) 879 | hi(0, "markdownH2", { link = "rainbow2" }) 880 | hi(0, "markdownH3", { link = "rainbow3" }) 881 | hi(0, "markdownH4", { link = "rainbow4" }) 882 | hi(0, "markdownH5", { link = "rainbow5" }) 883 | hi(0, "markdownH6", { link = "rainbow6" }) 884 | hi(0, "markdownHeadingDelimiter", { bold = true, fg = "#fab387" }) 885 | hi(0, "markdownLinkText", { fg = "#89b4fa", underline = true }) 886 | hi(0, "mkdCodeDelimiter", { bg = "#1e1e2e", fg = "#cdd6f4" }) 887 | hi(0, "mkdCodeEnd", { bold = true, fg = "#f2cdcd" }) 888 | hi(0, "mkdCodeStart", { bold = true, fg = "#f2cdcd" }) 889 | hi(0, "qfFileName", { fg = "#89b4fa" }) 890 | hi(0, "qfLineNr", { fg = "#f9e2af" }) 891 | hi(0, "rainbow1", { fg = "#f38ba8" }) 892 | hi(0, "rainbow2", { fg = "#fab387" }) 893 | hi(0, "rainbow3", { fg = "#f9e2af" }) 894 | hi(0, "rainbow4", { fg = "#a6e3a1" }) 895 | hi(0, "rainbow5", { fg = "#74c7ec" }) 896 | hi(0, "rainbow6", { fg = "#b4befe" }) 897 | hi(0, "zshKSHFunction", { link = "Function" }) 898 | 899 | -- No terminal colors defined 900 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | vim.loader.enable() 2 | vim.cmd.colorscheme("catppuccin-mocha") 3 | 4 | require("rj.extras.dashboard") 5 | require("rj.keymaps") 6 | require("rj.options") 7 | require("rj.extras.last-place") 8 | require("rj.extras.big-file") 9 | require("rj.autocommands") 10 | require("rj.mini-deps") 11 | require("rj.plugins") 12 | require("rj.lsp") 13 | -------------------------------------------------------------------------------- /lua/rj/autocommands.lua: -------------------------------------------------------------------------------- 1 | local autocmd = vim.api.nvim_create_autocmd 2 | local usercmd = vim.api.nvim_create_user_command 3 | local lopt = vim.opt_local 4 | 5 | autocmd({ "BufEnter" }, { 6 | pattern = "*", 7 | callback = function(args) 8 | local disabled_filetypes = { "terminal", "Jaq", "dashboard", "gitcommit", "man", "help", "checkhealth" } 9 | local disabled_buftypes = { "nofile" } 10 | if vim.tbl_contains(disabled_filetypes, vim.bo.filetype) or vim.tbl_contains(disabled_buftypes, vim.bo.buftype) then 11 | return 12 | end 13 | local dir = vim.fn.expand("%:p:h") 14 | local root = vim.fs.root(args.buf, { ".git", "Makefile", "Cargo.toml" }) 15 | if root then 16 | dir = root 17 | end 18 | vim.fn.chdir(dir) 19 | end, 20 | }) 21 | 22 | autocmd("TextYankPost", { 23 | callback = function() 24 | vim.hl.on_yank({ higroup = "Visual", timeout = 150 }) 25 | end, 26 | }) 27 | 28 | autocmd({ "FileType" }, { 29 | pattern = { "qf", "help", "Jaq", "man" }, 30 | callback = function() 31 | vim.keymap.set("n", "q", "close!", { silent = true, buffer = true }) 32 | vim.api.nvim_set_option_value("buflisted", false, { buf = 0 }) 33 | end, 34 | }) 35 | 36 | autocmd("FileType", { 37 | pattern = { "lua" }, 38 | command = "setlocal tabstop=2 shiftwidth=2", 39 | }) 40 | 41 | autocmd({ "FileType" }, { 42 | pattern = { "python" }, 43 | callback = function() 44 | lopt.listchars = { multispace = "---+", tab = "> " } 45 | lopt.list = true 46 | end, 47 | }) 48 | 49 | autocmd({ "FileType" }, { 50 | pattern = { "gitcommit", "markdown", "text", "man" }, 51 | callback = function() 52 | lopt.wrap = true 53 | lopt.spell = true 54 | lopt.textwidth = 120 55 | end, 56 | }) 57 | 58 | usercmd("Grep", function(opts) 59 | local command = string.format('silent cgetexpr system("rg --vimgrep -S %s")', opts.args) 60 | vim.cmd(command) 61 | vim.cmd("copen") 62 | end, { nargs = 1 }) 63 | 64 | autocmd("BufWritePre", { 65 | pattern = "*", 66 | desc = "Create parent directories of a file, if they dont exist", 67 | callback = function() 68 | local fpath = vim.fn.expand("") 69 | local dir = vim.fn.fnamemodify(fpath, ":p:h") 70 | 71 | if vim.fn.isdirectory(dir) ~= 1 then 72 | vim.fn.mkdir(dir, "p") 73 | end 74 | end, 75 | }) 76 | 77 | autocmd("FileType", { 78 | desc = "Disable indentscope for certain filetypes", 79 | pattern = { 80 | "dashboard", 81 | "help", 82 | "leetcode.nvim", 83 | "man", 84 | "mason", 85 | "notify", 86 | "terminal", 87 | "toggleterm", 88 | "trouble", 89 | }, 90 | callback = function() 91 | vim.b.miniindentscope_disable = true 92 | end, 93 | }) 94 | -------------------------------------------------------------------------------- /lua/rj/extras/big-file.lua: -------------------------------------------------------------------------------- 1 | -- credit to: [vloe](https://github.com/vloe) who got it from [Lazyvim](https://github.com/LazyVim/LazyVim) 2 | -- Disable certain features when opening large files 3 | 4 | local big_file = vim.api.nvim_create_augroup("BigFile", { clear = true }) 5 | vim.filetype.add({ 6 | pattern = { 7 | [".*"] = { 8 | function(path, buf) 9 | return vim.bo[buf] 10 | and vim.bo[buf].filetype ~= "bigfile" 11 | and path 12 | and vim.fn.getfsize(path) > 1024 * 10000 13 | and "bigfile" 14 | or nil -- bigger than 10MB 15 | end, 16 | }, 17 | }, 18 | }) 19 | 20 | vim.api.nvim_create_autocmd({ "FileType" }, { 21 | group = big_file, 22 | pattern = "bigfile", 23 | callback = function(ev) 24 | vim.cmd("syntax off") 25 | vim.b.minicursorword_disable = true 26 | vim.b.miniindentscope_disable = true 27 | vim.opt_local.foldmethod = "manual" 28 | vim.opt_local.spell = false 29 | vim.schedule(function() 30 | vim.bo[ev.buf].syntax = vim.filetype.match({ buf = ev.buf }) or "" 31 | end) 32 | end, 33 | }) 34 | -------------------------------------------------------------------------------- /lua/rj/extras/dashboard.lua: -------------------------------------------------------------------------------- 1 | -- credit to: [tomtom-aquib](https://github.com/tamton-aquib) 2 | 3 | local center = function(dict) 4 | local new_dict = {} 5 | for _, v in pairs(dict) do 6 | local padding = vim.fn.max(vim.fn.map(dict, "strwidth(v:val)")) 7 | local spacing = (" "):rep(math.floor((vim.o.columns - padding) / 2)) .. v 8 | table.insert(new_dict, spacing) 9 | end 10 | return new_dict 11 | end 12 | 13 | local splash_screen = vim.schedule_wrap(function() 14 | local xdg = vim.fn.fnamemodify(vim.fn.stdpath("config") --[[@as string]], ":h") .. "/" 15 | local header = { 16 | "", 17 | "", 18 | "", 19 | "", 20 | "", 21 | "", 22 | 23 | [[ ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓ ]], 24 | [[ ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒ ]], 25 | [[ ▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░ ]], 26 | [[ ▓██▒ ▐▌██▒▒▓█ ▄ ▒██ ██░ ▒██ █░░░██░▒██ ▒██ ]], 27 | [[ ▒██░ ▓██░░▒████▒░ ████▓▒░ ▒▀█░ ░██░▒██▒ ░██▒ ]], 28 | [[ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▐░ ░▓ ░ ▒░ ░ ░ ]], 29 | [[ ░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ▒ ░░ ░ ░ ]], 30 | [[ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ▒ ░░ ░ ]], 31 | [[ ░ ░ ░ ░ ░ ░ ░ ░ ]], 32 | [[ ░ ]], 33 | } 34 | local text = { 35 | "", 36 | "", 37 | [[Everything will be just fine in the end]], 38 | } 39 | local arg = vim.fn.argv(0) 40 | if (vim.bo.ft ~= "netrw") and (arg == "") then 41 | vim.fn.matchadd("Error", "[░▒]") 42 | vim.fn.matchadd("Function", "[▓█▄▀▐▌]") 43 | local map = function(lhs, rhs) 44 | vim.keymap.set("n", lhs, rhs, { silent = true, buffer = 0 }) 45 | end 46 | local keys = { 47 | G = "ghostty/config", 48 | I = "nvim/init.lua", 49 | H = "hypr/hyprland.conf", 50 | } 51 | vim.api.nvim_put(center(header), "l", true, true) 52 | vim.api.nvim_put(center(text), "l", true, true) 53 | local lopt = vim.opt_local 54 | 55 | lopt.number = false 56 | lopt.relativenumber = false 57 | lopt.buflisted = false 58 | lopt.filetype = "dashboard" 59 | lopt.bufhidden = "wipe" 60 | lopt.buftype = "nofile" 61 | lopt.cursorline = false 62 | lopt.modifiable = false 63 | 64 | for k, f in pairs(keys) do 65 | map(k, "e " .. xdg .. f .. "") 66 | end 67 | map("q", "q") 68 | map("o", "e #<1") 69 | map("p", "Projects") 70 | map("r", "lua MiniExtra.pickers.oldfiles()") 71 | vim.cmd("norm 2w") 72 | end 73 | end) 74 | 75 | vim.api.nvim_create_autocmd("UIEnter", { 76 | pattern = "*", 77 | once = true, 78 | callback = function() 79 | if vim.bo.filetype == "man" then return end 80 | splash_screen() 81 | end, 82 | }) 83 | -------------------------------------------------------------------------------- /lua/rj/extras/definition.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | function M.float_lost_focus(win) 4 | local track = vim.schedule_wrap(function() 5 | local win_id = vim.api.nvim_get_current_win() 6 | if win and win == win_id then 7 | return 8 | end 9 | if win and vim.api.nvim_win_is_valid(win) then 10 | vim.api.nvim_win_close(win, true) 11 | end 12 | end) 13 | vim.uv.new_timer():start(50, 50, track) 14 | end 15 | 16 | function M.get_win() 17 | local buf = vim.api.nvim_create_buf(false, true) 18 | local win = vim.api.nvim_open_win(buf, false, { 19 | relative = "cursor", 20 | width = math.ceil(vim.o.columns / 1.5), 21 | height = 10, 22 | row = (vim.fn.line(".") - vim.fn.line("w0") + 1) > 13 and -12 or 1, 23 | col = 0, 24 | border = "single", 25 | title = "Definition", 26 | title_pos = "center", 27 | noautocmd = true, 28 | }) 29 | return win 30 | end 31 | 32 | function M.get_def() 33 | vim.lsp.buf.definition({ 34 | on_list = function(options) 35 | if #options.items > 0 then 36 | local win = M.get_win() 37 | vim.api.nvim_set_option_value("winblend", 15, { win = win }) -- Adjust transparency level 38 | vim.api.nvim_set_current_win(win) 39 | 40 | local def = options.items[1] 41 | vim.cmd.edit(def.filename) 42 | vim.api.nvim_win_set_cursor(0, { def.lnum, def.col - 1 }) 43 | M.float_lost_focus(win) 44 | else 45 | print("No definition found") 46 | end 47 | end, 48 | }) 49 | end 50 | 51 | return M 52 | -------------------------------------------------------------------------------- /lua/rj/extras/gui-apps.lua: -------------------------------------------------------------------------------- 1 | if vim.g.neovide then 2 | vim.keymap.set("n", "q", "silent close", { desc = "Close the Buffer" }) 3 | end 4 | 5 | if vim.g.vscode then 6 | return 7 | end 8 | -------------------------------------------------------------------------------- /lua/rj/extras/last-place.lua: -------------------------------------------------------------------------------- 1 | -- credit to: [lewis6991](https://github.com/lewis6991) 2 | -- who adapted this from https://github.com/ethanholz/nvim-lastplace/blob/main/lua/nvim-lastplace/init.lua 3 | 4 | local ignore_buftype = { "quickfix", "nofile", "help", "terminal" } 5 | local ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit" } 6 | 7 | local function run() 8 | if vim.tbl_contains(ignore_buftype, vim.bo.buftype) then 9 | return 10 | end 11 | 12 | if vim.tbl_contains(ignore_filetype, vim.bo.filetype) then 13 | vim.cmd([[normal! gg]]) 14 | return 15 | end 16 | 17 | -- If a line has already been specified on the command line, we are done 18 | -- nvim file +num 19 | if vim.fn.line(".") > 1 then 20 | return 21 | end 22 | 23 | local last_line = vim.fn.line([['"]]) 24 | local buff_last_line = vim.fn.line("$") 25 | 26 | -- If the last line is set and the less than the last line in the buffer 27 | if last_line > 0 and last_line <= buff_last_line then 28 | local win_last_line = vim.fn.line("w$") 29 | local win_first_line = vim.fn.line("w0") 30 | -- Check if the last line of the buffer is the same as the win 31 | if win_last_line == buff_last_line then 32 | -- Set line to last line edited 33 | vim.cmd([[normal! g`"]]) 34 | -- Try to center 35 | elseif buff_last_line - last_line > ((win_last_line - win_first_line) / 2) - 1 then 36 | vim.cmd([[normal! g`"zz]]) 37 | else 38 | vim.cmd([[normal! G'"]]) 39 | end 40 | end 41 | end 42 | 43 | vim.api.nvim_create_autocmd({ "BufWinEnter", "FileType" }, { 44 | group = vim.api.nvim_create_augroup("nvim-lastplace", {}), 45 | callback = run, 46 | }) 47 | -------------------------------------------------------------------------------- /lua/rj/extras/mini-pickproject.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | local utils = require("rj.extras.utils") 3 | 4 | local function extract_last_two_dirs(path) 5 | local components = {} 6 | for part in string.gmatch(path, "[^/]+") do 7 | table.insert(components, part) 8 | end 9 | 10 | local n = #components 11 | if n >= 2 then 12 | return components[n - 1] .. "/" .. components[n] 13 | elseif n == 1 then 14 | return components[n] 15 | else 16 | return "" 17 | end 18 | end 19 | 20 | local function ensure_projects_file() 21 | local projects_file_path = vim.fn.stdpath("data") .. "/projects.json" 22 | if not vim.uv.fs_stat(projects_file_path) then 23 | local default_content = { directories = {} } 24 | vim.fn.writefile({ vim.json.encode(default_content) }, projects_file_path) 25 | end 26 | return projects_file_path 27 | end 28 | 29 | local function read_projects_file() 30 | local projects_file_path = ensure_projects_file() 31 | local content = utils.read_file_to_string(projects_file_path) 32 | return content and vim.json.decode(content) or { directories = {} } 33 | end 34 | 35 | local function write_projects_file(data) 36 | local projects_file_path = ensure_projects_file() 37 | vim.fn.writefile({ vim.json.encode(data) }, projects_file_path) 38 | end 39 | 40 | function M.projects(_, opts) 41 | local projects_data = read_projects_file() 42 | local projects = {} 43 | 44 | for _, dir in ipairs(projects_data.directories) do 45 | table.insert(projects, { text = " " .. extract_last_two_dirs(dir), dir = dir }) 46 | end 47 | 48 | local function choose(item) 49 | local dir = item.dir 50 | if not vim.uv.fs_stat(dir) then 51 | vim.notify("Directory doesnt exist", vim.log.levels.ERROR) 52 | return 53 | end 54 | vim.schedule(function() 55 | local choose_file_continue = function(selected_item) 56 | local target = dir .. "/" .. selected_item 57 | if not vim.uv.fs_stat(target) then 58 | return 59 | end 60 | vim.api.nvim_win_call(MiniPick.get_picker_state().windows.target, function() 61 | vim.cmd("edit " .. target) 62 | MiniPick.set_picker_target_window(vim.api.nvim_get_current_win()) 63 | return true 64 | end) 65 | end 66 | MiniPick.builtin.files({ tool = "fd" }, { source = { cwd = item.dir, choose = choose_file_continue } }) 67 | end) 68 | end 69 | 70 | local function preview(buf_id, item) 71 | if not item then 72 | return 73 | end 74 | local files = {} 75 | for name, type in vim.fs.dir(item.dir) do 76 | if type == "file" and not name:match("^%.") then 77 | table.insert(files, MiniIcons.get("file", name) .. " " .. name) 78 | end 79 | end 80 | vim.api.nvim_buf_set_lines(buf_id, 0, -1, false, files) 81 | end 82 | 83 | local source = { items = projects, name = "Projects", choose = choose, preview = preview } 84 | opts = vim.tbl_deep_extend("force", { source = source }, opts or {}) 85 | return MiniPick.start(opts) 86 | end 87 | 88 | function M.add_project() 89 | local root = vim.fs.root(0, { ".git", "Makefile", "LICENSE", "Cargo.toml" }) 90 | if not root then 91 | return 92 | end 93 | root = vim.fn.fnamemodify(root, ":p:h") 94 | 95 | local projects_data = read_projects_file() 96 | if utils.in_array(projects_data.directories, root) then 97 | return 98 | end 99 | table.insert(projects_data.directories, root) 100 | table.sort(projects_data.directories) 101 | write_projects_file(projects_data) 102 | end 103 | 104 | function M.edit_project() 105 | local projects_file_path = ensure_projects_file() 106 | vim.cmd.vsplit() 107 | vim.cmd.edit(projects_file_path) 108 | end 109 | 110 | function M.sanitize_project() 111 | local projects_data = read_projects_file() 112 | for index, dir in ipairs(projects_data.directories) do 113 | if not vim.uv.fs_stat(dir) then 114 | table.remove(projects_data.directories, index) 115 | end 116 | end 117 | write_projects_file(projects_data) 118 | end 119 | 120 | local usercmd = vim.api.nvim_create_user_command 121 | usercmd("Projects", M.projects, { desc = "Choose a project in mini.pick" }) 122 | usercmd("AddProject", M.add_project, { desc = "Add the current project to the list" }) 123 | usercmd("EditProject", M.edit_project, { desc = "Open the project file" }) 124 | usercmd("SanitizeProject", M.sanitize_project, { desc = "Remove the projects that dont exist" }) 125 | 126 | return M 127 | -------------------------------------------------------------------------------- /lua/rj/extras/quickfix.lua: -------------------------------------------------------------------------------- 1 | -- Credit to: [kevinhwang91](https://github.com/kevinhwang91/nvim-bqf) 2 | local fn = vim.fn 3 | 4 | function _G.qftf(info) 5 | local items 6 | local ret = {} 7 | if info.quickfix == 1 then 8 | items = fn.getqflist({ id = info.id, items = 0 }).items 9 | else 10 | items = fn.getloclist(info.winid, { id = info.id, items = 0 }).items 11 | end 12 | local limit = 60 13 | local fnameFmt1, fnameFmt2 = "%-" .. limit .. "s", "…%." .. (limit - 1) .. "s" 14 | local validFmt = "%s │%5d:%-3d│%s %s" 15 | for i = info.start_idx, info.end_idx do 16 | local e = items[i] 17 | local fname = "" 18 | local str 19 | if e.valid == 1 then 20 | if e.bufnr > 0 then 21 | fname = fn.bufname(e.bufnr) 22 | if fname == "" then 23 | fname = "[No Name]" 24 | else 25 | fname = fname:gsub("^" .. vim.env.HOME, "~") 26 | end 27 | -- char in fname may occur more than 1 width, ignore this issue in order to keep performance 28 | if #fname <= limit then 29 | fname = fnameFmt1:format(fname) 30 | else 31 | fname = fnameFmt2:format(fname:sub(1 - limit)) 32 | end 33 | end 34 | local lnum = e.lnum > 99999 and -1 or e.lnum 35 | local col = e.col > 999 and -1 or e.col 36 | local qtype = e.type == "" and "" or " " .. e.type:sub(1, 1):upper() 37 | str = validFmt:format(fname, lnum, col, qtype, e.text) 38 | else 39 | str = e.text 40 | end 41 | table.insert(ret, str) 42 | end 43 | return ret 44 | end 45 | 46 | vim.opt.qftf = "{info -> v:lua._G.qftf(info)}" 47 | -------------------------------------------------------------------------------- /lua/rj/extras/sudo-write.lua: -------------------------------------------------------------------------------- 1 | -- Taken from [NTBBloodbath](https://github.com/NTBBloodbath/nvim/blob/main/lua/utils/sudo_write.lua) 2 | -- Who Extracted and modified it from: 3 | -- https://gist.github.com/oessessnex/d63ebe89380abff5a3ee70d6e76e4ec8 4 | 5 | local sudo_write = {} 6 | 7 | local uv = vim.uv 8 | 9 | local function password() 10 | vim.fn.inputsave() 11 | local user = vim.env.USER 12 | local pw = vim.fn.inputsecret(string.format("password for %s: ", user)) 13 | vim.fn.inputrestore() 14 | return pw 15 | end 16 | 17 | local function test(pw, k) 18 | local stdin = uv.new_pipe() 19 | if not stdin then return end 20 | ---@diagnostic disable-next-line undefined-field 21 | uv.spawn("sudo", { 22 | args = { "-S", "-k", "true" }, 23 | stdio = { stdin, nil, nil }, 24 | }, k) 25 | 26 | stdin:write(pw) 27 | stdin:write("\n") 28 | stdin:shutdown() 29 | end 30 | 31 | local function write(pw, buf, lines, k) 32 | local stdin = uv.new_pipe() 33 | if not stdin then return end 34 | ---@diagnostic disable-next-line undefined-field 35 | uv.spawn("sudo", { 36 | args = { "-S", "-k", "tee", buf }, 37 | stdio = { stdin, nil, nil }, 38 | }, k) 39 | 40 | stdin:write(pw) 41 | stdin:write("\n") 42 | local last = table.remove(lines) 43 | for _, line in ipairs(lines) do 44 | stdin:write(line) 45 | stdin:write("\n") 46 | end 47 | stdin:write(last) 48 | stdin:shutdown() 49 | end 50 | 51 | function sudo_write.write() 52 | local pw = password() 53 | local bufnr = vim.api.nvim_get_current_buf() 54 | local buf_name = vim.api.nvim_buf_get_name(bufnr) 55 | 56 | local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) 57 | 58 | local function exitWrite(code, _) 59 | if code == 0 then 60 | vim.schedule(function() 61 | print('"' .. buf_name .. '" written') 62 | vim.api.nvim_set_option_value("modified", false, { buf = bufnr }) 63 | end) 64 | end 65 | end 66 | 67 | local function exitTest(code, _) 68 | if code == 0 then 69 | write(pw, buf_name, lines, exitWrite) 70 | else 71 | vim.schedule(function() 72 | vim.notify("[utils.sudo_write] Incorrect password provided", vim.log.levels.ERROR) 73 | end) 74 | end 75 | end 76 | 77 | test(pw, exitTest) 78 | end 79 | 80 | return sudo_write 81 | -------------------------------------------------------------------------------- /lua/rj/extras/terminal.lua: -------------------------------------------------------------------------------- 1 | -- Credit to: [numToStr](https://github.com/numToStr/FTerm.nvim) 2 | -- modified by me and added more functionality 3 | 4 | ---@alias WinId number # Floating Window's ID 5 | ---@alias BufId number # Terminal Buffer's ID 6 | 7 | ---@class CommandMode 8 | ---@field command? string | function Command to execute in terminal 9 | ---@field executed boolean Whether the command has been executed 10 | ---@field run_once? boolean If true, the command will only run once 11 | 12 | ---@class M 13 | ---@field win? WinId Floating window ID 14 | ---@field buf? BufId Buffer ID associated with the terminal 15 | ---@field terminal? number Terminal's job ID 16 | ---@field execn? string Shell or command to execute in the terminal 17 | ---@field name? string Name of the terminal 18 | ---@field command_mode CommandMode State of the terminal's command mode 19 | ---@field last_tab? number Last tabpage ID 20 | ---@field last_win? number Last window ID 21 | ---@field prev_win? number Previous window number 22 | ---@field last_ft? string Filetype of the last buffer 23 | ---@field last_pos? number[] Cursor position in the last window 24 | local M = {} 25 | 26 | local instances = setmetatable({}, { __mode = "v" }) 27 | 28 | ---@class TerminalOpts 29 | ---@field execn? string The executable to use for the terminal (defaults to vim.o.shell) 30 | ---@field name? string Optional name for the terminal instance 31 | 32 | ---Creates a new terminal instance 33 | ---@param opts? TerminalOpts 34 | ---@return M 35 | function M:new(opts) 36 | opts = opts or {} 37 | local execn = opts.execn or vim.o.shell 38 | local name = opts.name 39 | 40 | if instances[name or execn] then 41 | return instances[name or execn] 42 | end 43 | 44 | ---@type M 45 | local instance = setmetatable({ 46 | name = name, 47 | execn = execn, 48 | command_mode = { 49 | command = nil, 50 | executed = false, 51 | run_once = false, 52 | }, 53 | win = nil, 54 | buf = nil, 55 | terminal = nil, 56 | }, { __index = self }) 57 | 58 | -- Store the new instance in cache 59 | instances[name or execn] = instance 60 | return instance 61 | end 62 | 63 | ---Store the floating window and buffer IDs. 64 | ---@param win_id WinId Window ID 65 | ---@param buf_id BufId Buffer ID 66 | ---@return M 67 | function M:store(win_id, buf_id) 68 | self.win = win_id 69 | self.buf = buf_id 70 | return self 71 | end 72 | 73 | ---Create a new buffer for the terminal. 74 | ---@return BufId 75 | function M:create_buf() 76 | local prev_buf = self.buf 77 | if prev_buf and vim.api.nvim_buf_is_valid(prev_buf) then 78 | return prev_buf 79 | end 80 | 81 | local buf = vim.api.nvim_create_buf(false, true) 82 | vim.api.nvim_set_option_value("bufhidden", "hide", { buf = buf }) 83 | vim.api.nvim_set_option_value("buflisted", false, { buf = buf }) 84 | vim.api.nvim_set_option_value("modifiable", false, { buf = buf }) 85 | vim.api.nvim_set_option_value("filetype", "terminal", { buf = buf }) 86 | return buf 87 | end 88 | 89 | ---Create a new floating window for the terminal buffer. 90 | ---@param buf BufId Buffer ID 91 | ---@return WinId 92 | function M:create_win(buf) 93 | local height = math.ceil(vim.o.lines * 0.75) 94 | local width = math.ceil(vim.o.columns * 0.9) 95 | 96 | local win = vim.api.nvim_open_win(buf, true, { 97 | style = "minimal", 98 | relative = "editor", 99 | width = width, 100 | height = height, 101 | row = math.ceil((vim.o.lines - height) / 2.5), 102 | col = math.ceil((vim.o.columns - width) / 2), 103 | border = "single", 104 | ---@diagnostic disable-next-line: undefined-global 105 | title = { { self.name, visual } }, 106 | title_pos = "center", 107 | }) 108 | return win 109 | end 110 | 111 | ---Switch to terminal mode and start insert mode if needed. 112 | ---@return M 113 | function M:prompt() 114 | if vim.bo.filetype == "terminal" then 115 | vim.cmd.startinsert() 116 | end 117 | return self 118 | end 119 | 120 | ---Check if a window ID is valid. 121 | ---@param win_id WinId 122 | ---@return boolean 123 | local function is_valid(win_id) 124 | return win_id and vim.api.nvim_win_is_valid(win_id) 125 | end 126 | 127 | ---Open a terminal in a floating window. 128 | ---@return M 129 | function M:open_term() 130 | local term = vim.fn.jobstart(self.execn or vim.o.shell, { 131 | term = true, 132 | on_exit = function(_, _, _) 133 | if is_valid(self.win) then 134 | vim.api.nvim_win_close(self.win, true) 135 | end 136 | if self.buf and vim.api.nvim_buf_is_valid(self.buf) then 137 | vim.api.nvim_buf_delete(self.buf, { force = true }) 138 | end 139 | 140 | self.win = nil 141 | self.buf = nil 142 | self.terminal = nil 143 | end, 144 | }) 145 | self.terminal = term 146 | 147 | return self:prompt() 148 | end 149 | 150 | ---Remember the current cursor and window positions. 151 | ---@return M 152 | function M:remember_cursor() 153 | self.last_tab = vim.api.nvim_get_current_tabpage() 154 | self.last_win = vim.api.nvim_get_current_win() 155 | self.prev_win = vim.fn.winnr("#") 156 | self.last_pos = vim.api.nvim_win_get_cursor(self.last_win) 157 | local last_buf = vim.api.nvim_get_current_buf() 158 | self.last_ft = vim.api.nvim_get_option_value("filetype", { buf = last_buf }) 159 | return self 160 | end 161 | 162 | ---Restore the cursor and window positions. 163 | ---@return M 164 | function M:restore_cursor() 165 | if self.last_win and self.last_pos ~= nil then 166 | if self.prev_win > 0 then 167 | vim.api.nvim_command(("silent! %s wincmd w"):format(self.prev_win)) 168 | end 169 | 170 | if is_valid(self.last_win) then 171 | vim.api.nvim_set_current_win(self.last_win) 172 | if self.last_tab == vim.api.nvim_get_current_tabpage() then 173 | vim.api.nvim_set_current_win(self.last_win) 174 | end 175 | vim.api.nvim_win_set_cursor(self.last_win, self.last_pos) 176 | end 177 | 178 | self.last_win = nil 179 | self.prev_win = nil 180 | self.last_pos = nil 181 | end 182 | 183 | return self 184 | end 185 | 186 | ---Open the terminal manager's floating terminal. 187 | ---@return M 188 | function M:open() 189 | if is_valid(self.win) then 190 | vim.api.nvim_set_current_win(self.win) 191 | end 192 | 193 | self:remember_cursor() 194 | 195 | local buf = self:create_buf() 196 | local win = self:create_win(buf) 197 | 198 | if self.buf == buf then 199 | return self:store(win, buf):prompt() 200 | end 201 | 202 | return self:store(win, buf):open_term() 203 | end 204 | 205 | ---Close the floating terminal window. 206 | ---@return M 207 | function M:close() 208 | if not is_valid(self.win) then 209 | return self 210 | end 211 | if not self.last_ft == "terminal" then 212 | self:restore_cursor() 213 | end 214 | vim.api.nvim_win_close(self.win, false) 215 | self.win = nil 216 | return self 217 | end 218 | 219 | ---Handle terminal losing focus by automatically closing it. 220 | function M:terminal_lost_focus() 221 | local timer = vim.uv.new_timer() 222 | if not timer then return end 223 | local track = vim.schedule_wrap(function() 224 | local ft = vim.bo.filetype 225 | if ft == "terminal" then 226 | return 227 | end 228 | timer:close() 229 | self:close() 230 | end) 231 | timer:start(100, 100, track) 232 | end 233 | 234 | ---Toggle the terminal between open and closed states. 235 | ---@return M 236 | function M:toggle() 237 | if is_valid(self.win) then 238 | self:close() 239 | if self.command_mode.command then 240 | self.command_mode.executed = true 241 | end 242 | else 243 | self:open() 244 | self:terminal_lost_focus() 245 | if self.command_mode.command and not self.command_mode.run_once then 246 | self.command_mode.executed = false 247 | end 248 | end 249 | return self 250 | end 251 | 252 | ---Run a command in the terminal. 253 | ---@param command string | function Command to run 254 | function M:run(command) 255 | if not command then 256 | return 257 | end 258 | self.command_mode.command = command 259 | self:toggle() 260 | 261 | local exec = type(command) == "function" and command() or command 262 | if self.command_mode.executed then 263 | return 264 | end 265 | vim.defer_fn(function() 266 | vim.api.nvim_chan_send( 267 | self.terminal, 268 | table.concat({ 269 | type(exec) == "table" and table.concat(exec, " ") or exec, 270 | vim.api.nvim_replace_termcodes("", true, true, true), 271 | }) 272 | ) 273 | end, 50) 274 | return self 275 | end 276 | 277 | ---Run a command only once in the terminal. 278 | ---@param command string | function Command to run once 279 | function M:run_once(command) 280 | self.command_mode.command = command 281 | self.command_mode.run_once = true 282 | return self:run(self.command_mode.command) 283 | end 284 | 285 | return M 286 | -------------------------------------------------------------------------------- /lua/rj/extras/utils.lua: -------------------------------------------------------------------------------- 1 | ---@class M 2 | local M = {} 3 | local uv = vim.uv 4 | 5 | --- Checks if a target value exists in an array. 6 | ---@param array any[] The array to search. 7 | ---@param target any The value to search for. 8 | ---@return boolean #True if the target exists in the array, false otherwise. 9 | function M.in_array(array, target) 10 | for _, value in ipairs(array) do 11 | if value == target then 12 | return true 13 | end 14 | end 15 | return false 16 | end 17 | 18 | --- Checks if a key-value pair exists in a table. 19 | ---@param tbl table The table to search. 20 | ---@param key_value {key: any, value: any} The key-value pair to search for. 21 | ---@return boolean #True if the key-value pair exists, false otherwise. 22 | function M.in_table(tbl, key_value) 23 | for key, value in pairs(tbl) do 24 | if key == key_value.key and value == key_value.value then 25 | return true 26 | end 27 | end 28 | return false 29 | end 30 | 31 | --- Removes leading and trailing whitespace from a string. 32 | ---@param s string The input string. 33 | ---@return string #The stripped string. 34 | function M.strip(s) 35 | return s:match("^%s*(.-)%s*$") 36 | end 37 | 38 | --- Reads the contents of a file into a string. 39 | ---@param filename string The path to the file. 40 | ---@return string|nil #The file contents as a string, or nil if an error occurs. 41 | function M.read_file_to_string(filename) 42 | local fd = uv.fs_open(filename, "r", 438) 43 | if not fd then 44 | print("Error opening file: " .. filename) 45 | return nil 46 | end 47 | 48 | local stat = uv.fs_fstat(fd) 49 | if not stat then 50 | print("Error getting file stats: " .. filename) 51 | return nil 52 | end 53 | 54 | local data = uv.fs_read(fd, stat.size, 0) 55 | uv.fs_close(fd) 56 | if not data then return end 57 | return M.strip(data) 58 | end 59 | 60 | function M.read_file_to_table(filename) 61 | local f = io.open(filename, "r") 62 | local line_table = {} 63 | if f then 64 | while true do 65 | local line = f:read() 66 | if line == nil or line == "\n" then 67 | break 68 | end 69 | table.insert(line_table, M.strip(line)) 70 | end 71 | end 72 | 73 | return line_table 74 | end 75 | 76 | return M 77 | -------------------------------------------------------------------------------- /lua/rj/extras/venv.lua: -------------------------------------------------------------------------------- 1 | ---@class Module 2 | local M = {} 3 | 4 | ---@type string 5 | local ORIGINAL_PATH = vim.fn.getenv("PATH") or "" 6 | 7 | --- The current virtual environment path, or nil if none is set. 8 | ---@type string|nil 9 | M.cur_env = nil 10 | 11 | local utils = require("rj.extras.utils") 12 | 13 | --- Find the virtual environment directory. 14 | ---@return string|nil # The path to the virtual environment, or nil if not found. 15 | local function find_env() 16 | ---@type string|nil 17 | local root = vim.fs.root(0, { ".git", "pyproject.toml" }) 18 | if not root then 19 | return nil 20 | end 21 | ---@type string 22 | local path = root .. "/.venv" 23 | 24 | local stat = vim.loop.fs_stat(path) 25 | if stat then 26 | if stat.type == "directory" then 27 | return path 28 | elseif stat.type == "file" then 29 | local env_path = utils.read_file_to_string(path) 30 | if env_path and #env_path > 0 then 31 | return vim.fn.expand("~/.virtualenvs/" .. env_path) 32 | end 33 | end 34 | end 35 | return nil 36 | end 37 | 38 | --- Set the virtual environment for the current project. 39 | function M.setup() 40 | ---@type string|nil 41 | local virtual_env = find_env() 42 | 43 | if not virtual_env then 44 | return 45 | end 46 | 47 | if M.cur_env ~= virtual_env then 48 | M.cur_env = virtual_env 49 | else 50 | return 51 | end 52 | 53 | vim.fn.setenv("PATH", virtual_env .. "/bin:" .. ORIGINAL_PATH) 54 | vim.fn.setenv("VIRTUAL_ENV", virtual_env) 55 | end 56 | 57 | return M 58 | -- vim: fdm=marker fdl=0 59 | -------------------------------------------------------------------------------- /lua/rj/extras/workspace-diagnostic.lua: -------------------------------------------------------------------------------- 1 | -- credit to: [artemave](https://github.com/artemave/workspace-diagnostics.nvim) 2 | local M = {} 3 | local _loaded_clients = {} 4 | local _workspace_files 5 | local _detected_filetypes = {} 6 | local _dont_cache_these_extensions = { "conf" } 7 | 8 | --- Plugin configuration with its default values. 9 | --- 10 | --- Default values: 11 | ---@eval return MiniDoc.afterlines_to_code(MiniDoc.current.eval_section) 12 | M.options = { 13 | workspace_files = function() 14 | local gitPath = vim.fn.systemlist("git rev-parse --show-toplevel")[1] 15 | local workspace_files = vim.fn.split(vim.fn.system("git ls-files " .. gitPath), "\n") 16 | 17 | return workspace_files 18 | end, 19 | 20 | debug = false, 21 | } 22 | 23 | --- Define workspace-diagnostics setup. 24 | --- 25 | ---@param options table Module config table. See |WorkspaceDiagnostics.options|. 26 | --- 27 | ---@usage `require("workspace-diagnostics").setup()` (add `{}` with your |WorkspaceDiagnostics.options| table) 28 | function M.setup(options) 29 | options = options or {} 30 | 31 | M.options = vim.tbl_deep_extend("keep", options, M.options) 32 | 33 | return M.options 34 | end 35 | 36 | local function _get_workspace_files() 37 | if _workspace_files == nil then 38 | _workspace_files = M.options.workspace_files() or {} 39 | 40 | _workspace_files = vim.tbl_filter(function(path) 41 | return vim.fn.filereadable(path) == 1 42 | end, _workspace_files) 43 | 44 | _workspace_files = vim.tbl_map(function(path) 45 | return vim.fn.fnamemodify(path, ":p") 46 | end, _workspace_files) 47 | end 48 | 49 | return _workspace_files 50 | end 51 | 52 | local function _detect_filetype(path) 53 | local filetype = vim.filetype.match({ filename = path }) 54 | 55 | -- vim.filetype.match is not guaranteed to work on filename alone (see https://github.com/neovim/neovim/issues/27265) 56 | if not filetype then 57 | for _, buf in ipairs(vim.fn.getbufinfo()) do 58 | if vim.fn.fnamemodify(buf.name, ":p") == path then 59 | return vim.filetype.match({ buf = buf.bufnr }) 60 | end 61 | end 62 | 63 | local bufn = vim.fn.bufadd(path) 64 | vim.fn.bufload(bufn) 65 | 66 | filetype = vim.filetype.match({ buf = bufn }) 67 | 68 | vim.api.nvim_buf_delete(bufn, { force = true }) 69 | end 70 | 71 | return filetype 72 | end 73 | 74 | local function _get_filetype(path) 75 | local ext = vim.fn.fnamemodify(path, ":e") 76 | 77 | if rawget(_detected_filetypes, ext) ~= nil then 78 | return _detected_filetypes[ext] 79 | end 80 | 81 | local filetype = _detect_filetype(path) 82 | 83 | -- some file types share the same extension (see https://github.com/artemave/workspace-diagnostics.nvim/issues/3) 84 | -- so we never want to cache detection results for those ones. 85 | if not vim.tbl_contains(_dont_cache_these_extensions, ext) then 86 | _detected_filetypes[ext] = filetype or false 87 | end 88 | 89 | return filetype 90 | end 91 | 92 | local function _populate_workspace_diagnostics(client, bufnr) 93 | local workspace_files = _get_workspace_files() 94 | 95 | for _, path in ipairs(workspace_files) do 96 | local filetype = _get_filetype(path) 97 | 98 | if path == vim.api.nvim_buf_get_name(bufnr) then 99 | goto continue 100 | end 101 | 102 | if not vim.tbl_contains(client.config.filetypes, filetype) then 103 | goto continue 104 | end 105 | 106 | vim.defer_fn(function() 107 | local params = { 108 | textDocument = { 109 | uri = vim.uri_from_fname(path), 110 | version = 0, 111 | text = vim.fn.join(vim.fn.readfile(path), "\n"), 112 | languageId = filetype, 113 | }, 114 | } 115 | client.notify("textDocument/didOpen", params) 116 | end, 0) 117 | 118 | ::continue:: 119 | end 120 | end 121 | 122 | --- Populate workspace diagnostics. 123 | --- 124 | ---@param client table Lsp client. 125 | ---@param bufnr number Buffer number. 126 | --- 127 | ---@usage `require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)` 128 | function M.populate_workspace_diagnostics(client, bufnr) 129 | if vim.tbl_contains(_loaded_clients, client.id) then 130 | return 131 | end 132 | table.insert(_loaded_clients, client.id) 133 | 134 | if not vim.tbl_get(client.server_capabilities, "textDocumentSync", "openClose") then 135 | return 136 | end 137 | 138 | if not vim.tbl_get(client.config, "capabilities", "textDocument", "publishDiagnostics") then 139 | return 140 | end 141 | 142 | if not vim.tbl_get(client.config, "filetypes") then 143 | local msg = "[workspace-diagnostics] " 144 | .. client.name 145 | .. " is skipped: please define `config.filetypes` when setting up the client." 146 | vim.api.nvim_echo({ { msg, "WarningMsg" } }, true, {}) 147 | return 148 | end 149 | 150 | _populate_workspace_diagnostics(client, bufnr) 151 | end 152 | 153 | return M 154 | -------------------------------------------------------------------------------- /lua/rj/keymaps.lua: -------------------------------------------------------------------------------- 1 | local opts = { silent = true } 2 | 3 | local function opt(desc, others) 4 | return vim.tbl_extend("force", opts, { desc = desc }, others or {}) 5 | end 6 | 7 | --Remap space as leader key 8 | vim.keymap.set("", "", "", { silent = true }) 9 | vim.g.mapleader = " " 10 | vim.g.maplocalleader = " " 11 | 12 | -- Shorten function name 13 | local keymap = vim.keymap.set 14 | 15 | -- Modes 16 | -- normal_mode = "n", 17 | -- insert_mode = "i", 18 | -- visual_mode = "v", 19 | -- visual_block_mode = "x", 20 | -- term_mode = "t", 21 | -- command_mode = "c", 22 | 23 | keymap("n", "w", function() 24 | vim.cmd("silent! write!") 25 | vim.notify("File saved") 26 | end, opt("Save")) 27 | keymap("n", "q", "q!", opt("Quit")) 28 | keymap("n", "c", "bd!", opt("Close")) 29 | 30 | keymap("n", "\\", "noh", opt("Remove highlight")) 31 | 32 | keymap("n", "", "silent cnext", opt("Next QF item")) 33 | keymap("n", "", "silent cprevious", opt("Prev QF item")) 34 | 35 | -- Move text up and down 36 | keymap("n", "", ":m .+1==gi", opts) 37 | keymap("n", "", ":m .-2==gi", opts) 38 | 39 | -- Visual -- 40 | -- Stay in indent mode 41 | keymap("v", "<", "", ">gv", opts) 43 | 44 | -- Move text up and down 45 | keymap("v", "", ":m .+1==", opts) 46 | keymap("v", "", ":m .-2==", opts) 47 | 48 | -- pressing C-h,j,k,l will move the cursor in insert mode 49 | keymap("i", "", "", opts) 50 | keymap("i", "", "", opts) 51 | keymap("i", "", "", opts) 52 | keymap("i", "", "", opts) 53 | keymap("v", "p", "P", opts) 54 | 55 | -- Visual Block -- 56 | -- Move text up and down 57 | keymap("x", "J", ":move '>+1gv=gv", opts) 58 | keymap("x", "K", ":move '<-2gv=gv", opts) 59 | keymap("x", "", ":move '>+1gv=gv", opts) 60 | keymap("x", "", ":move '<-2gv=gv", opts) 61 | 62 | -- Terminal -- 63 | -- Better terminal navigation 64 | keymap("t", "", "h", opts) 65 | keymap("t", "", "j", opts) 66 | keymap("t", "", "k", opts) 67 | keymap("t", "", "l", opts) 68 | 69 | -- stylua: ignore start 70 | local term = require("rj.extras.terminal") 71 | 72 | keymap("t", "", [[]], opt("Escape in terminal window")) 73 | keymap({ "n", "t" }, "", function() term:new({ execn = "zsh", name = "Shell" }):toggle() end, opt("Open Shell")) 74 | keymap({ "n", "t" }, "", function() term:new({ execn = "zsh", name = "Shell2" }):toggle() end, opt("Open Shell")) 75 | keymap({ "n", "t" }, "", function() term:new({ execn = "lazygit",name = "Lazygit" }):toggle() end, opt("Open Lazygit")) 76 | keymap({ "n", "t" }, "", function() term:new({ execn = "btop", name = "Btop" }):toggle() end, opt("Open Btop")) 77 | keymap({ "n", "t" }, "", function() term:new({ execn = "python", name = "Python" }):toggle() end, opt("Open Python")) 78 | keymap("n", "gg", function() term:new({ name = "Lazygit",execn = "lazygit" }):toggle() end, opt("Lazygit")) 79 | -- stylua:ignore end 80 | 81 | -- Quality of Life stuff -- 82 | keymap({ "n", "s", "v" }, "yy", '"+y', opt("Yank to clipboard")) 83 | keymap({ "n", "s", "v" }, "yY", '"+yy', opt("Yank line to clipboard")) 84 | keymap({ "n", "s", "v" }, "yp", '"+p', opt("Paste from clipboard")) 85 | keymap({ "n", "s", "v" }, "yd", '"+d', opt("Delete into clipboard")) 86 | 87 | keymap("n", "i", function() 88 | if #vim.fn.getline(".") == 0 then 89 | return [["_cc]] 90 | else 91 | return "i" 92 | end 93 | end, { expr = true, desc = "properly indent on empty line when insert" }) 94 | 95 | keymap("n", "", function() 96 | require("rj.extras.sudo-write").write() 97 | end, opt("Write File with sudo")) 98 | 99 | keymap("n", "x", "so %", opt("Source the current file")) 100 | -------------------------------------------------------------------------------- /lua/rj/lsp.lua: -------------------------------------------------------------------------------- 1 | -- Initially taken from [NTBBloodbath](https://github.com/NTBBloodbath/nvim/blob/main/lua/core/lsp.lua) 2 | -- modified almost 80% by me 3 | 4 | -- Diagnostics {{{ 5 | local config = { 6 | signs = { 7 | text = { 8 | [vim.diagnostic.severity.ERROR] = "", 9 | [vim.diagnostic.severity.WARN] = "", 10 | [vim.diagnostic.severity.HINT] = "", 11 | [vim.diagnostic.severity.INFO] = "", 12 | }, 13 | }, 14 | update_in_insert = true, 15 | underline = true, 16 | severity_sort = true, 17 | float = { 18 | focusable = false, 19 | style = "minimal", 20 | border = "single", 21 | source = "always", 22 | header = "", 23 | prefix = "", 24 | suffix = "", 25 | }, 26 | } 27 | vim.diagnostic.config(config) 28 | -- }}} 29 | 30 | -- Improve LSPs UI {{{ 31 | local icons = { 32 | Class = " ", 33 | Color = " ", 34 | Constant = " ", 35 | Constructor = " ", 36 | Enum = " ", 37 | EnumMember = " ", 38 | Event = " ", 39 | Field = " ", 40 | File = " ", 41 | Folder = " ", 42 | Function = "󰊕 ", 43 | Interface = " ", 44 | Keyword = " ", 45 | Method = "ƒ ", 46 | Module = "󰏗 ", 47 | Property = " ", 48 | Snippet = " ", 49 | Struct = " ", 50 | Text = " ", 51 | Unit = " ", 52 | Value = " ", 53 | Variable = " ", 54 | } 55 | 56 | local completion_kinds = vim.lsp.protocol.CompletionItemKind 57 | for i, kind in ipairs(completion_kinds) do 58 | completion_kinds[i] = icons[kind] and icons[kind] .. kind or kind 59 | end 60 | -- }}} 61 | 62 | -- Lsp capabilities and on_attach {{{ 63 | -- Here we grab default Neovim capabilities and extend them with ones we want on top 64 | local capabilities = vim.lsp.protocol.make_client_capabilities() 65 | 66 | capabilities.textDocument.foldingRange = { 67 | dynamicRegistration = true, 68 | lineFoldingOnly = true, 69 | } 70 | 71 | capabilities.textDocument.semanticTokens.multilineTokenSupport = true 72 | capabilities.textDocument.completion.completionItem.snippetSupport = true 73 | 74 | vim.lsp.config("*", { 75 | capabilities = capabilities, 76 | on_attach = function(client, bufnr) 77 | local ok, diag = pcall(require, "rj.extras.workspace-diagnostic") 78 | if ok then 79 | diag.populate_workspace_diagnostics(client, bufnr) 80 | end 81 | end, 82 | }) 83 | -- }}} 84 | 85 | -- Disable the default keybinds {{{ 86 | for _, bind in ipairs({ "grn", "gra", "gri", "grr" }) do 87 | pcall(vim.keymap.del, "n", bind) 88 | end 89 | -- }}} 90 | 91 | -- Create keybindings, commands, inlay hints and autocommands on LSP attach {{{ 92 | vim.api.nvim_create_autocmd("LspAttach", { 93 | callback = function(ev) 94 | local bufnr = ev.buf 95 | local client = vim.lsp.get_client_by_id(ev.data.client_id) 96 | if not client then 97 | return 98 | end 99 | ---@diagnostic disable-next-line need-check-nil 100 | if client.server_capabilities.completionProvider then 101 | vim.bo[bufnr].omnifunc = "v:lua.vim.lsp.omnifunc" 102 | -- vim.bo[bufnr].omnifunc = "v:lua.MiniCompletion.completefunc_lsp" 103 | end 104 | ---@diagnostic disable-next-line need-check-nil 105 | if client.server_capabilities.definitionProvider then 106 | vim.bo[bufnr].tagfunc = "v:lua.vim.lsp.tagfunc" 107 | end 108 | 109 | -- -- nightly has inbuilt completions, this can replace all completion plugins 110 | -- if client:supports_method("textDocument/completion", bufnr) then 111 | -- -- Enable auto-completion 112 | -- vim.lsp.completion.enable(true, client.id, bufnr, { autotrigger = true }) 113 | -- end 114 | 115 | --- Disable semantic tokens 116 | ---@diagnostic disable-next-line need-check-nil 117 | client.server_capabilities.semanticTokensProvider = nil 118 | 119 | -- All the keymaps 120 | -- stylua: ignore start 121 | local keymap = vim.keymap.set 122 | local lsp = vim.lsp 123 | local opts = { silent = true } 124 | local function opt(desc, others) 125 | return vim.tbl_extend("force", opts, { desc = desc }, others or {}) 126 | end 127 | keymap("n", "gd", lsp.buf.definition, opt("Go to definition")) 128 | keymap("n", "gD", function() 129 | local ok, diag = pcall(require, "rj.extras.definition") 130 | if ok then 131 | diag.get_def() 132 | end 133 | end, opt("Get the definition in a float")) 134 | keymap("n", "gi", function() lsp.buf.implementation({ border = "single" }) end, opt("Go to implementation")) 135 | keymap("n", "gr", lsp.buf.references, opt("Show References")) 136 | keymap("n", "gl", vim.diagnostic.open_float, opt("Open diagnostic in float")) 137 | keymap("n", "", lsp.buf.signature_help, opts) 138 | -- disable the default binding first before using a custom one 139 | pcall(vim.keymap.del, "n", "K", { buffer = ev.buf }) 140 | keymap("n", "K", function() lsp.buf.hover({ border = "single", max_height = 30, max_width = 120 }) end, opt("Toggle hover")) 141 | keymap("n", "lF", vim.cmd.FormatToggle, opt("Toggle AutoFormat")) 142 | keymap("n", "lI", vim.cmd.Mason, opt("Mason")) 143 | keymap("n", "lS", lsp.buf.workspace_symbol, opt("Workspace Symbols")) 144 | keymap("n", "la", lsp.buf.code_action, opt("Code Action")) 145 | keymap("n", "lh", function() lsp.inlay_hint.enable(not lsp.inlay_hint.is_enabled({})) end, opt("Toggle Inlayhints")) 146 | keymap("n", "li", vim.cmd.LspInfo, opt("LspInfo")) 147 | keymap("n", "ll", lsp.codelens.run, opt("Run CodeLens")) 148 | keymap("n", "lr", lsp.buf.rename, opt("Rename")) 149 | keymap("n", "ls", lsp.buf.document_symbol, opt("Doument Symbols")) 150 | 151 | -- diagnostic mappings 152 | keymap("n", "dD", function() 153 | local ok, diag = pcall(require, "rj.extras.workspace-diagnostic") 154 | if ok then 155 | for _, cur_client in ipairs(vim.lsp.get_clients({ bufnr = 0 })) do 156 | diag.populate_workspace_diagnostics(cur_client, 0) 157 | end 158 | vim.notify("INFO: Diagnostic populated") 159 | end 160 | end, opt("Popluate diagnostic for the whole workspace")) 161 | keymap("n", "dn", function() vim.diagnostic.jump({ count = 1, float = true }) end, opt("Next Diagnostic")) 162 | keymap("n", "dp", function() vim.diagnostic.jump({ count =-1, float = true }) end, opt("Prev Diagnostic")) 163 | keymap("n", "dq", vim.diagnostic.setloclist, opt("Set LocList")) 164 | keymap("n", "dv", function() 165 | vim.diagnostic.config({ virtual_lines = not vim.diagnostic.config().virtual_lines }) 166 | end, opt("Toggle diagnostic virtual_lines")) 167 | -- stylua: ignore end 168 | end, 169 | }) 170 | -- }}} 171 | 172 | -- Servers {{{ 173 | 174 | -- Lua {{{ 175 | vim.lsp.config.lua_ls = { 176 | cmd = { "lua-language-server" }, 177 | filetypes = { "lua" }, 178 | root_markers = { ".luarc.json", ".git", vim.uv.cwd() }, 179 | settings = { 180 | Lua = { 181 | telemetry = { 182 | enable = false, 183 | }, 184 | }, 185 | }, 186 | } 187 | vim.lsp.enable("lua_ls") 188 | -- }}} 189 | 190 | -- Python {{{ 191 | vim.lsp.config.basedpyright = { 192 | name = "basedpyright", 193 | filetypes = { "python" }, 194 | cmd = { "basedpyright-langserver", "--stdio" }, 195 | settings = { 196 | python = { 197 | venvPath = vim.fn.expand("~") .. "/.virtualenvs", 198 | }, 199 | basedpyright = { 200 | disableOrganizeImports = true, 201 | analysis = { 202 | autoSearchPaths = true, 203 | autoImportCompletions = true, 204 | useLibraryCodeForTypes = true, 205 | diagnosticMode = "openFilesOnly", 206 | typeCheckingMode = "strict", 207 | inlayHints = { 208 | variableTypes = true, 209 | callArgumentNames = true, 210 | functionReturnTypes = true, 211 | genericTypes = false, 212 | }, 213 | }, 214 | }, 215 | }, 216 | } 217 | 218 | vim.api.nvim_create_autocmd("FileType", { 219 | pattern = "python", 220 | callback = function() 221 | local ok, venv = pcall(require, "rj.extras.venv") 222 | if ok then 223 | venv.setup() 224 | end 225 | local root = vim.fs.root(0, { 226 | "pyproject.toml", 227 | "setup.py", 228 | "setup.cfg", 229 | "requirements.txt", 230 | "Pipfile", 231 | "pyrightconfig.json", 232 | ".git", 233 | vim.uv.cwd(), 234 | }) 235 | local client = 236 | vim.lsp.start(vim.tbl_extend("force", vim.lsp.config.basedpyright, { root_dir = root }), { attach = false }) 237 | if client then 238 | vim.lsp.buf_attach_client(0, client) 239 | end 240 | end, 241 | }) 242 | -- }}} 243 | 244 | -- Go {{{ 245 | vim.lsp.config.gopls = { 246 | cmd = { "gopls" }, 247 | filetypes = { "go", "gotempl", "gowork", "gomod" }, 248 | root_markers = { ".git", "go.mod", "go.work", vim.uv.cwd() }, 249 | settings = { 250 | gopls = { 251 | completeUnimported = true, 252 | usePlaceholders = true, 253 | analyses = { 254 | unusedparams = true, 255 | }, 256 | ["ui.inlayhint.hints"] = { 257 | compositeLiteralFields = true, 258 | constantValues = true, 259 | parameterNames = true, 260 | rangeVariableTypes = true, 261 | }, 262 | }, 263 | }, 264 | } 265 | vim.lsp.enable("gopls") 266 | -- }}} 267 | 268 | -- C/C++ {{{ 269 | vim.lsp.config.clangd = { 270 | cmd = { 271 | "clangd", 272 | "-j=" .. 2, 273 | "--background-index", 274 | "--clang-tidy", 275 | "--inlay-hints", 276 | "--fallback-style=llvm", 277 | "--all-scopes-completion", 278 | "--completion-style=detailed", 279 | "--header-insertion=iwyu", 280 | "--header-insertion-decorators", 281 | "--pch-storage=memory", 282 | }, 283 | filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, 284 | root_markers = { 285 | "CMakeLists.txt", 286 | ".clangd", 287 | ".clang-tidy", 288 | ".clang-format", 289 | "compile_commands.json", 290 | "compile_flags.txt", 291 | "configure.ac", 292 | ".git", 293 | vim.uv.cwd(), 294 | }, 295 | } 296 | vim.lsp.enable("clangd") 297 | -- }}} 298 | 299 | -- Rust {{{ 300 | vim.lsp.config.rust_analyzer = { 301 | filetypes = { "rust" }, 302 | cmd = { "rust-analyzer" }, 303 | workspace_required = true, 304 | root_dir = function(buf, cb) 305 | local root = vim.fs.root(buf, { "Cargo.toml", "rust-project.json" }) 306 | local out = vim.system({ "cargo", "metadata", "--no-deps", "--format-version", "1" }, { cwd = root }):wait() 307 | if out.code ~= 0 then 308 | return cb(root) 309 | end 310 | 311 | local ok, result = pcall(vim.json.decode, out.stdout) 312 | if ok and result.workspace_root then 313 | return cb(result.workspace_root) 314 | end 315 | 316 | return cb(root) 317 | end, 318 | settings = { 319 | autoformat = false, 320 | ["rust-analyzer"] = { 321 | check = { 322 | command = "clippy", 323 | }, 324 | }, 325 | }, 326 | } 327 | vim.lsp.enable("rust_analyzer") 328 | -- }}} 329 | 330 | -- Typst {{{ 331 | vim.lsp.config.tinymist = { 332 | cmd = { "tinymist" }, 333 | filetypes = { "typst" }, 334 | root_markers = { ".git", vim.uv.cwd() }, 335 | } 336 | 337 | vim.lsp.enable("tinymist") 338 | -- }}} 339 | 340 | -- Bash {{{ 341 | vim.lsp.config.bashls = { 342 | cmd = { "bash-language-server", "start" }, 343 | filetypes = { "bash", "sh", "zsh" }, 344 | root_markers = { ".git", vim.uv.cwd() }, 345 | settings = { 346 | bashIde = { 347 | globPattern = vim.env.GLOB_PATTERN or "*@(.sh|.inc|.bash|.command)", 348 | }, 349 | }, 350 | } 351 | vim.lsp.enable("bashls") 352 | -- }}} 353 | 354 | -- Web-dev {{{ 355 | -- TSServer {{{ 356 | vim.lsp.config.ts_ls = { 357 | cmd = { "typescript-language-server", "--stdio" }, 358 | filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" }, 359 | root_markers = { "tsconfig.json", "jsconfig.json", "package.json", ".git" }, 360 | 361 | init_options = { 362 | hostInfo = "neovim", 363 | }, 364 | } 365 | -- }}} 366 | 367 | -- CSSls {{{ 368 | vim.lsp.config.cssls = { 369 | cmd = { "vscode-css-language-server", "--stdio" }, 370 | filetypes = { "css", "scss" }, 371 | root_markers = { "package.json", ".git" }, 372 | init_options = { 373 | provideFormatter = true, 374 | }, 375 | } 376 | -- }}} 377 | 378 | -- TailwindCss {{{ 379 | vim.lsp.config.tailwindcssls = { 380 | cmd = { "tailwindcss-language-server", "--stdio" }, 381 | filetypes = { 382 | "ejs", 383 | "html", 384 | "css", 385 | "scss", 386 | "javascript", 387 | "javascriptreact", 388 | "typescript", 389 | "typescriptreact", 390 | }, 391 | root_markers = { 392 | "tailwind.config.js", 393 | "tailwind.config.cjs", 394 | "tailwind.config.mjs", 395 | "tailwind.config.ts", 396 | "postcss.config.js", 397 | "postcss.config.cjs", 398 | "postcss.config.mjs", 399 | "postcss.config.ts", 400 | "package.json", 401 | "node_modules", 402 | }, 403 | settings = { 404 | tailwindCSS = { 405 | classAttributes = { "class", "className", "class:list", "classList", "ngClass" }, 406 | includeLanguages = { 407 | eelixir = "html-eex", 408 | eruby = "erb", 409 | htmlangular = "html", 410 | templ = "html", 411 | }, 412 | lint = { 413 | cssConflict = "warning", 414 | invalidApply = "error", 415 | invalidConfigPath = "error", 416 | invalidScreen = "error", 417 | invalidTailwindDirective = "error", 418 | invalidVariant = "error", 419 | recommendedVariantOrder = "warning", 420 | }, 421 | validate = true, 422 | }, 423 | }, 424 | } 425 | -- }}} 426 | 427 | -- HTML {{{ 428 | vim.lsp.config.htmlls = { 429 | cmd = { "vscode-html-language-server", "--stdio" }, 430 | filetypes = { "html" }, 431 | root_markers = { "package.json", ".git" }, 432 | 433 | init_options = { 434 | configurationSection = { "html", "css", "javascript" }, 435 | embeddedLanguages = { 436 | css = true, 437 | javascript = true, 438 | }, 439 | provideFormatter = true, 440 | }, 441 | } 442 | -- }}} 443 | 444 | vim.lsp.enable({ "ts_ls", "cssls", "tailwindcssls", "htmlls" }) 445 | 446 | -- }}} 447 | 448 | -- }}} 449 | 450 | -- Start, Stop, Restart, Log commands {{{ 451 | vim.api.nvim_create_user_command("LspStart", function() 452 | vim.cmd.e() 453 | end, { desc = "Starts LSP clients in the current buffer" }) 454 | 455 | vim.api.nvim_create_user_command("LspStop", function(opts) 456 | for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0 })) do 457 | if opts.args == "" or opts.args == client.name then 458 | client:stop(true) 459 | vim.notify(client.name .. ": stopped") 460 | end 461 | end 462 | end, { 463 | desc = "Stop all LSP clients or a specific client attached to the current buffer.", 464 | nargs = "?", 465 | complete = function(_, _, _) 466 | local clients = vim.lsp.get_clients({ bufnr = 0 }) 467 | local client_names = {} 468 | for _, client in ipairs(clients) do 469 | table.insert(client_names, client.name) 470 | end 471 | return client_names 472 | end, 473 | }) 474 | 475 | vim.api.nvim_create_user_command("LspRestart", function() 476 | local detach_clients = {} 477 | for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0 })) do 478 | client:stop(true) 479 | if vim.tbl_count(client.attached_buffers) > 0 then 480 | detach_clients[client.name] = { client, vim.lsp.get_buffers_by_client_id(client.id) } 481 | end 482 | end 483 | local timer = vim.uv.new_timer() 484 | if not timer then 485 | return vim.notify("Servers are stopped but havent been restarted") 486 | end 487 | timer:start( 488 | 100, 489 | 50, 490 | vim.schedule_wrap(function() 491 | for name, client in pairs(detach_clients) do 492 | local client_id = vim.lsp.start(client[1].config, { attach = false }) 493 | if client_id then 494 | for _, buf in ipairs(client[2]) do 495 | vim.lsp.buf_attach_client(buf, client_id) 496 | end 497 | vim.notify(name .. ": restarted") 498 | end 499 | detach_clients[name] = nil 500 | end 501 | if next(detach_clients) == nil and not timer:is_closing() then 502 | timer:close() 503 | end 504 | end) 505 | ) 506 | end, { 507 | desc = "Restart all the language client(s) attached to the current buffer", 508 | }) 509 | 510 | vim.api.nvim_create_user_command("LspLog", function() 511 | vim.cmd.vsplit(vim.lsp.log.get_filename()) 512 | end, { 513 | desc = "Get all the lsp logs", 514 | }) 515 | 516 | vim.api.nvim_create_user_command("LspInfo", function() 517 | vim.cmd("silent checkhealth vim.lsp") 518 | end, { 519 | desc = "Get all the information about all LSP attached", 520 | }) 521 | -- }}} 522 | 523 | -- vim: fdm=marker:fdl=0 524 | --- lsp.lua ends here 525 | -------------------------------------------------------------------------------- /lua/rj/mini-deps.lua: -------------------------------------------------------------------------------- 1 | -- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps' 2 | local path_package = vim.fn.stdpath("data") .. "/site/" 3 | local mini_path = path_package .. "pack/deps/start/mini.nvim" 4 | if not vim.uv.fs_stat(mini_path) then 5 | vim.cmd('echo "Installing `mini.nvim`" | redraw') 6 | local clone_cmd = { 7 | "git", 8 | "clone", 9 | "--filter=blob:none", 10 | "https://github.com/echasnovski/mini.nvim", 11 | mini_path, 12 | } 13 | vim.fn.system(clone_cmd) 14 | vim.cmd("packadd mini.nvim | helptags ALL") 15 | vim.cmd('echo "Installed `mini.nvim`" | redraw') 16 | end 17 | 18 | -- Set up 'mini.deps' (customize to your liking) 19 | require("mini.deps").setup({ path = { package = path_package } }) 20 | Add, Now, Later = MiniDeps.add, MiniDeps.now, MiniDeps.later 21 | -------------------------------------------------------------------------------- /lua/rj/options.lua: -------------------------------------------------------------------------------- 1 | require("rj.extras.gui-apps") 2 | require("rj.extras.quickfix") 3 | 4 | local options = { 5 | backup = false, -- creates a backup file 6 | autochdir = false, 7 | cmdheight = 1, -- more space in the neovim command line for displaying messages 8 | completeopt = { 9 | "menuone", 10 | "popup", 11 | "noselect", --[["noinsert", "fuzzy"]] 12 | }, -- mostly just for completion plugins 13 | conceallevel = 0, -- so that `` is visible in markdown files 14 | fileencoding = "utf-8", -- the encoding written to a file 15 | hlsearch = true, -- highlight all matches on previous search pattern 16 | ignorecase = true, -- ignore case in search patterns 17 | mouse = "a", -- allow the mouse to be used in neovim 18 | pumheight = 10, -- pop up menu height 19 | showmode = false, -- we don't need to see things like -- INSERT -- anymore 20 | smartcase = true, -- smart case 21 | smartindent = true, -- make indenting smarter again 22 | splitbelow = true, -- force all horizontal splits to go below current window 23 | splitright = true, -- force all vertical splits to go to the right of current window 24 | swapfile = false, -- creates a swapfile 25 | termguicolors = true, -- set term gui colors (most terminals support this) 26 | timeoutlen = 500, -- time to wait for a mapped sequence to complete (in milliseconds) 27 | undofile = true, -- enable persistent undo 28 | updatetime = 300, -- faster completion (4000ms default) 29 | writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited 30 | expandtab = true, -- convert tabs to spaces 31 | shiftwidth = 4, -- the number of spaces inserted for each indentation 32 | tabstop = 4, -- insert 2 spaces for a tab 33 | cursorline = true, -- highlight the current line 34 | number = true, -- set numbered lines 35 | relativenumber = true, -- set relative numbered lines 36 | numberwidth = 2, -- set number column width to 2 {default 4} 37 | signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time 38 | wrap = false, -- display lines as one long line 39 | scrolloff = 8, -- is one of my fav 40 | guifont = "JetBrainsMono NF:h14", -- the font used in graphical neovim applications 41 | sidescrolloff = 8, -- the number of lines to keep visible at the top and bottom of the screen 42 | laststatus = 3, -- controls how the command line looks when there is no message to display 43 | virtualedit = "onemore", -- allows the cursor to move beyond the end of a line 44 | linebreak = true, -- determines whether text will wrap at the edge of the screen 45 | showtabline = 1, -- determines whether the tab line will be displayed 46 | spelllang = "en_us", -- sets the language for spell checking 47 | textwidth = 80, -- limits the width of text that is being inserted 48 | foldtext = "", 49 | foldexpr = "v:lua.vim.treesitter.foldexpr()", -- specifies the expression used to calculate folds 50 | indentexpr = "nvim_treesitter#indent()", -- specifies the function used to calculate the indentation level 51 | fillchars = { eob = " ", fold = " " }, -- defines the characters used for certain parts of the screen 52 | wildoptions = { "fuzzy", "pum", "tagfile" }, 53 | -- messagesopt = "wait:10000,history:1000", 54 | splitkeep = "screen", 55 | inccommand = "split", 56 | } 57 | 58 | for k, v in pairs(options) do 59 | vim.opt[k] = v 60 | end 61 | 62 | vim.opt.formatoptions:remove({ "c", "r", "o" }) 63 | vim.opt.iskeyword:append("-") 64 | vim.opt.whichwrap:append("<,>,[,],h,l") 65 | vim.opt.diffopt:append("linematch:60") 66 | vim.opt.shortmess:append({ C = true, c = true, I = true }) 67 | vim.opt.cinkeys:remove(":") 68 | vim.opt.indentkeys:remove(":") 69 | vim.g.c_syntax_for_h = true 70 | -------------------------------------------------------------------------------- /lua/rj/plugins/auto-save.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "okuuva/auto-save.nvim", 4 | }) 5 | require("auto-save").setup({ 6 | enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) 7 | trigger_events = { -- See :h events 8 | immediate_save = { "BufLeave", "FocusLost", "InsertLeave" }, -- vim events that trigger an immediate save 9 | defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`) 10 | cancel_deffered_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save 11 | }, 12 | condition = function(buf) 13 | local fn = vim.fn 14 | 15 | if fn.getbufvar(buf, "&modifiable") == 1 and vim.bo.filetype ~= "harpoon" then 16 | return true -- met condition(s), can save 17 | end 18 | return false -- can't save 19 | end, 20 | write_all_buffers = false, -- write all buffers when the current one meets `condition` 21 | debounce_delay = 1000, -- delay after which a pending save is executed 22 | -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable 23 | debug = false, 24 | }) 25 | end) 26 | -------------------------------------------------------------------------------- /lua/rj/plugins/barbecue.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "mbwilding/barbecue.nvim", 4 | depends = { "SmiteshP/nvim-navic" }, 5 | }) 6 | 7 | local barbecue = require("barbecue") 8 | 9 | vim.api.nvim_set_hl(0, "NavicSeparator", { link = "Normal" }) 10 | 11 | barbecue.setup({ 12 | ---whether to create winbar updater autocmd 13 | ---@type boolean 14 | create_autocmd = true, 15 | theme = "catppuccin", 16 | ---buftypes to enable winbar in 17 | ---@type table 18 | include_buftypes = { "" }, 19 | ---returns a string to be shown at the end of winbar 20 | -- param bufnr number 21 | ---@return string 22 | -- custom_section = function(bufnr) 23 | -- return "" 24 | -- end, 25 | 26 | ---:help filename-modifiers 27 | modifiers = { 28 | ---@type string 29 | -- dirname = ":s?.*??", 30 | dirname = ":~:.", 31 | ---@type string 32 | basename = "", 33 | }, 34 | symbols = { 35 | ---string to be shown at the start of winbar 36 | ---@type string 37 | prefix = " ", 38 | ---entry separator 39 | ---@type string 40 | separator = ">", 41 | ---string to be shown when buffer is modified 42 | ---@type string 43 | modified = "", 44 | ---string to be shown when context is available but empty 45 | ---@type string 46 | default_context = "", 47 | }, 48 | ---icons for different context entry kinds 49 | kinds = { 50 | Array = "󰅨", 51 | Boolean = "󰔡", 52 | Class = "󰌗", 53 | Color = "󰏘", 54 | Constant = "󰇽", 55 | Constructor = "󰆧", 56 | Enum = "", 57 | EnumMember = "", 58 | Event = "", 59 | Field = "", 60 | File = "󰈙", 61 | Folder = "󰉋", 62 | Function = "󰆧", 63 | Interface = "", 64 | Key = "󰉿", 65 | Keyword = "󰉨", 66 | Method = "󰆧", 67 | Module = "󰅩", 68 | Namespace = "󰅩", 69 | Null = "󰟢", 70 | Number = "", 71 | Object = "󰅩", 72 | Operator = "󰆕", 73 | Package = "", 74 | Property = "", 75 | Reference = "", 76 | Snippet = "󰃐", 77 | String = "󰉿", 78 | Struct = "", 79 | Text = "󰉿", 80 | TypeParameter = "󰊄", 81 | Unit = "", 82 | Value = "󰎠", 83 | Variable = "", 84 | }, 85 | }) 86 | end) 87 | -------------------------------------------------------------------------------- /lua/rj/plugins/blink.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: missing-fields 2 | Later(function() 3 | Add({ 4 | source = "saghen/blink.cmp", 5 | depends = { 6 | "rafamadriz/friendly-snippets", 7 | }, 8 | checkout = "v1.1.1", 9 | }) 10 | 11 | require("blink.cmp").setup({ 12 | keymap = { 13 | preset = "default", 14 | }, 15 | 16 | appearance = { 17 | use_nvim_cmp_as_default = true, 18 | nerd_font_variant = "normal", 19 | }, 20 | 21 | completion = { 22 | list = { 23 | selection = { 24 | preselect = function(ctx) 25 | return ctx.mode ~= "cmdline" and not require("blink.cmp").snippet_active({ direction = 1 }) 26 | end, 27 | auto_insert = function(ctx) 28 | return ctx.mode == "cmdline" 29 | end, 30 | }, 31 | }, 32 | trigger = { 33 | prefetch_on_insert = true, 34 | }, 35 | documentation = { 36 | auto_show = true, 37 | auto_show_delay_ms = 150, 38 | }, 39 | accept = { 40 | auto_brackets = { 41 | enabled = true, 42 | }, 43 | }, 44 | }, 45 | 46 | sources = { 47 | default = { "lsp", "path", "snippets", "buffer" }, 48 | }, 49 | cmdline = { 50 | enabled = true, 51 | completion = { 52 | menu = { 53 | auto_show = false, 54 | }, 55 | }, 56 | keymap = { 57 | preset = "default", 58 | [""] = { 59 | function(cmp) 60 | if not cmp.is_menu_visible() then 61 | cmp.show_and_insert() 62 | end 63 | return cmp.select_next() 64 | end, 65 | }, 66 | [""] = { 67 | function(cmp) 68 | if not cmp.is_menu_visible() then 69 | cmp.show_and_insert() 70 | end 71 | return cmp.select_prev() 72 | end, 73 | }, 74 | }, 75 | sources = function() 76 | local type = vim.fn.getcmdtype() 77 | if type == ":" then 78 | return { "cmdline" } 79 | end 80 | return {} 81 | end, 82 | }, 83 | signature = { enabled = false }, 84 | }) 85 | 86 | local capabilities = require("blink.cmp").get_lsp_capabilities() 87 | vim.lsp.config("*", { capabilities = capabilities }) 88 | end) 89 | -------------------------------------------------------------------------------- /lua/rj/plugins/catppuccin.lua: -------------------------------------------------------------------------------- 1 | Now(function() 2 | Add({ 3 | source = "catppuccin/nvim", 4 | name = "catppuccin", 5 | hooks = { 6 | post_checkout = function() 7 | vim.cmd("CatppuccinCompile") 8 | end, 9 | }, 10 | }) 11 | 12 | require("catppuccin").setup({ 13 | flavour = "mocha", -- latte, frappe, macchiato, mocha 14 | background = { 15 | -- :h background 16 | light = "latte", 17 | dark = "mocha", 18 | }, 19 | transparent_background = false, 20 | term_colors = false, 21 | dim_inactive = { 22 | enabled = false, 23 | shade = "dark", 24 | percentage = 0.15, 25 | }, 26 | no_italic = false, -- Force no italic 27 | no_bold = false, -- Force no bold 28 | styles = { 29 | comments = { "italic" }, 30 | conditionals = { "italic" }, 31 | }, 32 | color_overrides = {}, 33 | integrations = { 34 | cmp = true, 35 | gitsigns = true, 36 | nvimtree = true, 37 | telescope = true, 38 | mini = true, 39 | noice = true, 40 | markdown = true, 41 | }, 42 | custom_highlights = { 43 | WhichKeyGroup = { fg = "#FAB387" }, 44 | WhichKeySeparator = { fg = "#cdd6f4" }, 45 | IndentBlankLineContextChar = { fg = "#cdd6f4" }, 46 | LspInlayHint = { bg = "none", italic = true }, 47 | FloatBorder = { fg = "#89b4fa", bg = "none" }, 48 | }, 49 | }) 50 | vim.cmd("colorscheme catppuccin-mocha") 51 | end) 52 | -------------------------------------------------------------------------------- /lua/rj/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "stevearc/conform.nvim", 4 | }) 5 | local conform = require("conform") 6 | 7 | conform.setup({ 8 | formatters_by_ft = { 9 | -- general 10 | ["*"] = { --[[ "codespell", ]] 11 | "injected", 12 | }, 13 | ["_"] = { "trim_whitespace" }, 14 | 15 | -- biome filetypes 16 | javascript = { "biome" }, 17 | typescript = { "biome" }, 18 | javascriptreact = { "biome" }, 19 | json = { "biome" }, 20 | jsonc = { "biome" }, 21 | 22 | -- prettier filetypes 23 | typescriptreact = { "prettier" }, 24 | svelte = { "prettier" }, 25 | css = { "prettier" }, 26 | html = { "prettier" }, 27 | yaml = { "prettier" }, 28 | markdown = { "prettier" }, 29 | graphql = { "prettier" }, 30 | vue = { "prettier" }, 31 | 32 | lua = { "stylua" }, 33 | python = { 34 | "pyfix_imports", 35 | "ruff_fix", 36 | "ruff_organize_imports", 37 | "ruff_format", 38 | }, 39 | java = { "astyle" }, 40 | rust = { "rustfmt" }, 41 | sh = { "shfmt" }, 42 | bash = { "shfmt" }, 43 | cpp = { "clang_format" }, 44 | go = { "gofmt", "goimports" }, 45 | cmake = { "cmake_format" }, 46 | typst = { "typstfmt" }, 47 | }, 48 | 49 | format_on_save = function(bufnr) 50 | local function myCallback(err) 51 | if err then 52 | vim.notify("Error during formatting: ", err) 53 | else 54 | vim.notify("Formatting completed successfully.") 55 | end 56 | end 57 | -- Disable with a global or buffer-local variable 58 | if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then 59 | return 60 | end 61 | -- Disable autoformat for files in a certain path 62 | local bufname = vim.api.nvim_buf_get_name(bufnr) 63 | if bufname:match("/node_modules/") then 64 | return 65 | end 66 | return { timeout_ms = 1000, lsp_fallback = true }, myCallback() 67 | end, 68 | 69 | formatters = { 70 | pyfix_imports = { 71 | command = "pyfix-imports", 72 | args = { "$FILENAME" }, 73 | stdin = true, 74 | cwd = require("conform.util").root_file({ "requirements.txt", "pyproject.toml", ".git" }), 75 | }, 76 | }, 77 | }) 78 | 79 | vim.g.disable_autoformat = true 80 | 81 | vim.api.nvim_create_user_command("Format", function() 82 | local function myCallback(err) 83 | if err then 84 | vim.notify("Error during formatting: ", string(err)) 85 | else 86 | vim.notify("Formatting completed successfully.") 87 | end 88 | end 89 | require("conform").format({ 90 | lsp_fallback = true, 91 | async = false, 92 | timeout_ms = 1000, 93 | }, myCallback()) 94 | end, { 95 | desc = "format", 96 | }) 97 | 98 | vim.api.nvim_create_user_command("FormatToggle", function() 99 | if vim.b.disable_autoformat or vim.g.disable_autoformat then 100 | vim.b.disable_autoformat = false 101 | vim.g.disable_autoformat = false 102 | vim.notify("AutoFormat Enabled") 103 | else 104 | vim.b.disable_autoformat = true 105 | vim.g.disable_autoformat = true 106 | vim.notify("AutoFormat Disabled") 107 | end 108 | end, { 109 | desc = "Toggle autoformat-on-save", 110 | }) 111 | 112 | vim.keymap.set("n", "lf", "silent Format", { desc = "Format the current file", silent = true }) 113 | end) 114 | -------------------------------------------------------------------------------- /lua/rj/plugins/cybu.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "ghillb/cybu.nvim", 4 | depends = { "nvim-tree/nvim-web-devicons" }, 5 | }) 6 | require("cybu").setup({ 7 | position = { 8 | relative_to = "win", -- win, editor, cursor 9 | anchor = "topright", -- topleft, topcenter, topright, 10 | }, 11 | display_time = 1750, -- time the cybu window is displayed 12 | style = { 13 | path = "relative", -- absolute, relative, tail (filename only) 14 | border = "single", -- single, double, rounded, none 15 | separator = " ", -- string used as separator 16 | prefix = "…", -- string used as prefix for truncated paths 17 | padding = 1, -- left & right padding in number of spaces 18 | hide_buffer_id = true, 19 | devicons = { 20 | enabled = true, -- enable or disable web dev icons 21 | colored = true, -- enable color for web dev icons 22 | }, 23 | }, 24 | }) 25 | 26 | vim.keymap.set("n", "bn", vim.cmd.CybuNext, { desc = "Next buffer" }) 27 | vim.keymap.set("n", "", vim.cmd.CybuNext, { desc = "Cycle buffer" }) 28 | vim.keymap.set("n", "", vim.cmd.CybuPrev, { desc = "Cycle buffer" }) 29 | vim.keymap.set("n", "bp", vim.cmd.CybuPrev, { desc = "Prev buffer" }) 30 | end) 31 | -------------------------------------------------------------------------------- /lua/rj/plugins/gitsigns.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "lewis6991/gitsigns.nvim", 4 | }) 5 | require("gitsigns").setup({ 6 | signs = { 7 | add = { text = "▎" }, 8 | change = { text = "▎" }, 9 | delete = { text = "󰐊" }, 10 | topdelete = { text = "󰐊" }, 11 | changedelete = { text = "▎" }, 12 | untracked = { text = "▎" }, 13 | }, 14 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 15 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 16 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 17 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 18 | watch_gitdir = { 19 | interval = 1000, 20 | follow_files = true, 21 | }, 22 | attach_to_untracked = true, 23 | current_line_blame = false, -- `:Gitsigns toggle_current_line_blame` 24 | current_line_blame_opts = { 25 | virt_text = true, 26 | virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' 27 | delay = 1000, 28 | ignore_whitespace = false, 29 | }, 30 | sign_priority = 6, 31 | update_debounce = 100, 32 | status_formatter = nil, -- Use default 33 | max_file_length = 40000, 34 | preview_config = { 35 | -- Options passed to nvim_open_win 36 | border = "single", 37 | style = "minimal", 38 | relative = "cursor", 39 | row = 0, 40 | col = 1, 41 | }, 42 | }) 43 | vim.keymap.set( "n", "gp", "Gitsigns preview_hunk_inline", { silent = true, desc = "Preview Hunk Inline" }) 44 | vim.keymap.set("n", "gP", "Gitsigns preview_hunk", { silent = true, desc = "Preview Hunk Float" }) 45 | vim.keymap.set("n", "gb", "Gitsigns blame_line", { silent = true, desc = "Blame Line" }) 46 | vim.keymap.set("n", "gn", "Gitsigns next_hunk", { silent = true, desc = "Next Hunk" }) 47 | vim.keymap.set("n", "gh", "Gitsigns prev_hunk", { silent = true, desc = "Prev Hunk" }) 48 | end) 49 | -------------------------------------------------------------------------------- /lua/rj/plugins/harpoon.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "ThePrimeagen/harpoon", 4 | checkout = "harpoon2", 5 | depends = { "nvim-lua/plenary.nvim", }, 6 | }) 7 | local harpoon = require("harpoon") 8 | -- Keybinds 9 | local keymap = vim.keymap.set 10 | --stylua: ignore start 11 | keymap("n", "ha", function() harpoon:list():add() end, { noremap = true, silent = true, desc = "Add file" }) 12 | keymap("n", "hh", function() harpoon:list():select(1) end, { noremap = true, silent = true, desc = "Goto 1" }) 13 | keymap("n", "hj", function() harpoon:list():select(2) end, { noremap = true, silent = true, desc = "Goto 2" }) 14 | keymap("n", "hk", function() harpoon:list():select(3) end, { noremap = true, silent = true, desc = "Goto 3" }) 15 | keymap("n", "hl", function() harpoon:list():select(4) end, { noremap = true, silent = true, desc = "Goto 4" }) 16 | keymap("n", "hn", function() harpoon:list():next() end, { noremap = true, silent = true, desc = "Goto next" }) 17 | keymap("n", "hp", function() harpoon:list():prev() end, { noremap = true, silent = true, desc = "Goto prev" }) 18 | keymap("n", "ht", function() harpoon.ui:toggle_quick_menu(harpoon:list())end, { noremap = true, silent = true, desc = "Toggle menu" }) 19 | --stylua: ignore end 20 | 21 | end) 22 | -------------------------------------------------------------------------------- /lua/rj/plugins/hop.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "smoka7/hop.nvim", 4 | }) 5 | require("hop").setup({ keys = "etovxqpdygfblzhckisuran" }) 6 | -- place this in one of your configuration file(s) 7 | local hop = require("hop") 8 | local directions = require("hop.hint").HintDirection 9 | 10 | vim.keymap.set("n", "f", function() 11 | hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true }) 12 | end, { remap = true }) 13 | 14 | vim.keymap.set("n", "F", function() 15 | hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true }) 16 | end, { remap = true }) 17 | 18 | vim.keymap.set("n", "t", function() 19 | hop.hint_char1() 20 | end, { remap = true }) 21 | 22 | vim.keymap.set("n", "T", function() 23 | hop.hint_char2() 24 | end, { remap = true }) 25 | end) 26 | -------------------------------------------------------------------------------- /lua/rj/plugins/init.lua: -------------------------------------------------------------------------------- 1 | require("rj.plugins.auto-save") 2 | -- require("rj.plugins.catppuccin") 3 | 4 | -- All the mini plugins 5 | require("rj.plugins.mini-ai") 6 | require("rj.plugins.mini-bracketed") 7 | require("rj.plugins.mini-bufremove") 8 | require("rj.plugins.mini-clue") 9 | require("rj.plugins.mini-color") 10 | require("rj.plugins.mini-comment") 11 | require("rj.plugins.mini-cursorword") 12 | require("rj.plugins.mini-files") 13 | require("rj.plugins.mini-git") 14 | require("rj.plugins.mini-hipatterns") 15 | require("rj.plugins.mini-icons") 16 | require("rj.plugins.mini-indentscope") 17 | require("rj.plugins.mini-notify") 18 | require("rj.plugins.mini-pairs") 19 | require("rj.plugins.mini-pick") 20 | require("rj.plugins.mini-sessions") 21 | require("rj.plugins.mini-statusline") 22 | require("rj.plugins.mini-surround") 23 | 24 | -- require("rj.plugins.notifier") 25 | require("rj.plugins.nvim-bqf") 26 | require("rj.plugins.gitsigns") 27 | require("rj.plugins.hop") 28 | require("rj.plugins.harpoon") 29 | require("rj.plugins.conform") 30 | require("rj.plugins.cybu") 31 | require("rj.plugins.jaq") 32 | require("rj.plugins.barbecue") 33 | require("rj.plugins.nvim-treesitter") 34 | require("rj.plugins.nvim-ts-autotag") 35 | require("rj.plugins.mason") 36 | require("rj.plugins.blink") 37 | require("rj.plugins.leetcode") 38 | require("rj.plugins.typst-preview") 39 | -------------------------------------------------------------------------------- /lua/rj/plugins/jaq.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "is0n/jaq-nvim", 4 | }) 5 | 6 | require("jaq-nvim").setup({ 7 | -- Commands used with 'Jaq' 8 | cmds = { 9 | -- Default UI used (see `Usage` for options) 10 | default = "term", 11 | 12 | -- Uses external commands such as 'g++' and 'cargo' 13 | external = { 14 | typescript = "bun run --hot %", 15 | javascript = "bun run --hot %", 16 | java = "java %", 17 | markdown = "glow %", 18 | python = "python %", 19 | -- rust = "rustc % -o $fileBase.out && ./$fileBase.out && rm $fileBase.out", 20 | rust = "cargo run", 21 | cpp = "g++ % -o $fileBase.out -std=c++23 && ./$fileBase.out && rm $fileBase.out", 22 | c = "gcc % -o $fileBase.out && ./$fileBase.out", 23 | go = "go run %", 24 | sh = "chmod +x % && sh %", 25 | zsh = "zsh %", 26 | lua = "lua %", 27 | }, 28 | -- Uses internal commands such as 'source' and 'luafile' 29 | internal = { 30 | -- lua = "luafile %", 31 | vim = "source %", 32 | }, 33 | }, 34 | 35 | behavior = { 36 | -- Default type 37 | default = "terminal", 38 | 39 | -- Start in insert mode 40 | startinsert = false, 41 | 42 | -- Use `wincmd p` on startup 43 | wincmd = false, 44 | 45 | -- Auto-save files 46 | autosave = false, 47 | }, 48 | 49 | -- UI settings 50 | ui = { 51 | -- Floating Window / FTerm settings 52 | float = { 53 | -- Floating window border (see ':h nvim_open_win') 54 | border = "none", 55 | 56 | -- Num from `0 - 1` for measurements 57 | height = 0.8, 58 | width = 0.8, 59 | x = 0.5, 60 | y = 0.5, 61 | 62 | -- Highlight group for floating window/border (see ':h winhl') 63 | border_hl = "FloatBorder", 64 | float_hl = "Normal", 65 | 66 | -- Floating Window Transparency (see ':h winblend') 67 | blend = 0, 68 | }, 69 | 70 | terminal = { 71 | -- Position of terminal 72 | position = "bot", 73 | 74 | -- Open the terminal without line numbers 75 | line_no = false, 76 | 77 | -- Size of terminal 78 | size = 10, 79 | }, 80 | }, 81 | }) 82 | 83 | vim.keymap.set("n", "j", vim.cmd.Jaq, { silent = true, desc = "Run the File" }) 84 | end) 85 | -------------------------------------------------------------------------------- /lua/rj/plugins/leetcode.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "kawre/leetcode.nvim", 4 | depends = { 5 | "nvim-telescope/telescope.nvim", 6 | "nvim-lua/plenary.nvim", 7 | "MunifTanjim/nui.nvim", 8 | }, 9 | }) 10 | require("leetcode").setup({ 11 | lang = "python3", 12 | storage = { 13 | home = vim.fn.stdpath("data") .. "/leetcode", 14 | cache = vim.fn.stdpath("cache") .. "/leetcode", 15 | }, 16 | plugins = { 17 | non_standalone = true, 18 | }, 19 | }) 20 | end) 21 | -------------------------------------------------------------------------------- /lua/rj/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "WhoIsSethDaniel/mason-tool-installer.nvim", 4 | depends = { "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim" }, 5 | post_checkout = function() 6 | vim.cmd("MasonToolsInstall") 7 | end 8 | }) 9 | require("mason").setup({ 10 | ui = { 11 | border = "single", 12 | }, 13 | registries = { 14 | "github:nvim-java/mason-registry", 15 | "github:mason-org/mason-registry", 16 | }, 17 | }) 18 | 19 | require("mason-tool-installer").setup({ 20 | ensure_installed = { 21 | -- language servers 22 | "basedpyright", 23 | "bashls", 24 | "clangd", 25 | "cssls", 26 | "gopls", 27 | "html-lsp", 28 | "lua_ls", 29 | "tailwindcss", 30 | "ts_ls", 31 | 32 | -- debug adapters 33 | "codelldb", 34 | 35 | -- formatters 36 | -- astyle missing 37 | "biome", 38 | "clang-format", 39 | "cmakelang", 40 | "goimports", 41 | "prettier", 42 | "ruff", 43 | "shfmt", 44 | "stylua", 45 | 46 | -- linters 47 | -- "eslint_d", 48 | -- "luacheck", 49 | -- "proselint", 50 | "shellcheck", 51 | }, 52 | }) 53 | end) 54 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-ai.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "nvim-treesitter/nvim-treesitter-textobjects", 4 | depends = { "nvim-treesitter/nvim-treesitter" }, 5 | }) 6 | 7 | local gen_spec = require("mini.ai").gen_spec 8 | local gen_ai_spec = require("mini.extra").gen_ai_spec 9 | require("mini.ai").setup({ 10 | custom_textobjects = { 11 | -- Make `|` select both edges in non-balanced way 12 | ["|"] = gen_spec.pair("|", "|", { type = "non-balanced" }), 13 | a = require('mini.ai').gen_spec.argument({ brackets = { '%b()' } }), 14 | 15 | -- Tweak function call to not detect dot in function name 16 | f = gen_spec.function_call({ name_pattern = "[%w_]" }), 17 | 18 | -- Function definition (needs treesitter queries with these captures) 19 | F = gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), 20 | o = gen_spec.treesitter({ 21 | a = { "@conditional.outer", "@loop.outer" }, 22 | i = { "@conditional.inner", "@loop.inner" }, 23 | }), 24 | c = gen_spec.treesitter({ 25 | i = { "@class.inner" }, 26 | a = { "@class.outer" }, 27 | }), 28 | 29 | g = gen_ai_spec.buffer(), 30 | D = gen_ai_spec.diagnostic(), 31 | I = gen_ai_spec.indent(), 32 | L = gen_ai_spec.line(), 33 | N = gen_ai_spec.number(), 34 | }, 35 | }) 36 | end) 37 | 38 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-bracketed.lua: -------------------------------------------------------------------------------- 1 | Later(function () 2 | require("mini.bracketed").setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-bufremove.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require("mini.bufremove").setup() 3 | vim.keymap.set("n", "c", function() 4 | MiniBufremove.delete(0) 5 | end, { silent = true, desc = "Close the buffer" }) 6 | end) 7 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-clue.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | local miniclue = require("mini.clue") 3 | miniclue.setup({ 4 | window = { 5 | delay = 500, 6 | }, 7 | triggers = { 8 | -- Leader triggers 9 | { mode = "n", keys = "" }, 10 | { mode = "x", keys = "" }, 11 | 12 | -- Built-in completion 13 | { mode = "i", keys = "" }, 14 | 15 | -- `g` key 16 | { mode = "n", keys = "g" }, 17 | { mode = "x", keys = "g" }, 18 | 19 | -- Marks 20 | { mode = "n", keys = "'" }, 21 | { mode = "n", keys = "`" }, 22 | { mode = "x", keys = "'" }, 23 | { mode = "x", keys = "`" }, 24 | 25 | -- Registers 26 | { mode = "n", keys = '"' }, 27 | { mode = "x", keys = '"' }, 28 | { mode = "i", keys = "" }, 29 | { mode = "c", keys = "" }, 30 | 31 | -- Window commands 32 | { mode = "n", keys = "" }, 33 | 34 | -- `z` key 35 | { mode = "n", keys = "z" }, 36 | { mode = "x", keys = "z" }, 37 | 38 | { mode = "n", keys = "[" }, 39 | { mode = "n", keys = "]" }, 40 | }, 41 | 42 | clues = { 43 | { mode = "n", keys = "g", desc = "+Git" }, 44 | { mode = "n", keys = "h", desc = "+Harpoon" }, 45 | { mode = "n", keys = "b", desc = "+Buffers" }, 46 | { mode = "n", keys = "l", desc = "+LSP" }, 47 | { mode = "n", keys = "t", desc = "+Terminal" }, 48 | { mode = "n", keys = "n", desc = "+Notify" }, 49 | { mode = "n", keys = "m", desc = "+Sessions" }, 50 | { mode = "n", keys = "s", desc = "+Search" }, 51 | { mode = "n", keys = "y", desc = "+Yank" }, 52 | { mode = "n", keys = "d", desc = "+Diagnostic" }, 53 | 54 | miniclue.gen_clues.builtin_completion(), 55 | miniclue.gen_clues.g(), 56 | miniclue.gen_clues.marks(), 57 | miniclue.gen_clues.registers(), 58 | miniclue.gen_clues.windows(), 59 | miniclue.gen_clues.z(), 60 | }, 61 | }) 62 | end) 63 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-color.lua: -------------------------------------------------------------------------------- 1 | Later(require("mini.colors").setup) 2 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-comment.lua: -------------------------------------------------------------------------------- 1 | Later(require("mini.comment").setup) 2 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-completion.lua: -------------------------------------------------------------------------------- 1 | Later( 2 | function() 3 | require("mini.completion").setup({ 4 | -- Delay (debounce type, in ms) between certain Neovim event and action. 5 | -- This can be used to (virtually) disable certain automatic actions by 6 | -- setting very high delay time (like 10^7). 7 | delay = { completion = 100, info = 100, signature = 50 }, 8 | 9 | -- Configuration for action windows: 10 | -- - `height` and `width` are maximum dimensions. 11 | -- - `border` defines border (as in `nvim_open_win()`). 12 | window = { 13 | info = { height = 25, width = 80, border = 'none' }, 14 | signature = { height = 25, width = 80, border = 'none' }, 15 | }, 16 | 17 | -- Way of how module does LSP completion 18 | lsp_completion = { 19 | -- `source_func` should be one of 'completefunc' or 'omnifunc'. 20 | source_func = 'omnifunc', 21 | 22 | -- `auto_setup` should be boolean indicating if LSP completion is set up 23 | -- on every `BufEnter` event. 24 | auto_setup = false, 25 | }, 26 | -- Module mappings. Use `''` (empty string) to disable one. Some of them 27 | -- might conflict with system mappings. 28 | mappings = { 29 | force_twostep = '', -- Force two-step completion 30 | force_fallback = '', -- Force fallback completion 31 | }, 32 | 33 | -- Whether to set Vim's settings for better experience (modifies 34 | -- `shortmess` and `completeopt`) 35 | set_vim_settings = true, 36 | }) 37 | end 38 | ) 39 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-cursorword.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require("mini.cursorword").setup() 3 | vim.api.nvim_set_hl(0, "MiniCursorword", { link = "Visual" }) 4 | vim.api.nvim_set_hl(0, "MiniCursorwordCurrent", {}) 5 | end 6 | ) 7 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-files.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require("mini.files").setup() 3 | 4 | vim.keymap.set("n", "e", function() 5 | MiniFiles.open() 6 | end, { silent = true, desc = "Opens mini.files" }) 7 | 8 | vim.keymap.set("n", "E", function() 9 | MiniFiles.open(vim.api.nvim_buf_get_name(0), false) 10 | end, { silent = true, desc = "Opens mini.files in currect dir" }) 11 | 12 | local map_split = function(buf_id, lhs, direction) 13 | local rhs = function() 14 | -- Make new window and set it as target 15 | local cur_target = MiniFiles.get_explorer_state().target_window 16 | local new_target = vim.api.nvim_win_call(cur_target, function() 17 | vim.cmd(direction .. " split") 18 | return vim.api.nvim_get_current_win() 19 | end) 20 | 21 | MiniFiles.set_target_window(new_target) 22 | MiniFiles.go_in() 23 | end 24 | 25 | -- Adding `desc` will result into `show_help` entries 26 | local desc = "Split " .. direction 27 | vim.keymap.set("n", lhs, rhs, { buffer = buf_id, desc = desc }) 28 | end 29 | 30 | vim.api.nvim_create_autocmd("User", { 31 | pattern = "MiniFilesBufferCreate", 32 | callback = function(args) 33 | local buf_id = args.data.buf_id 34 | -- Tweak keys to your liking 35 | map_split(buf_id, "", "belowright horizontal") 36 | map_split(buf_id, "", "belowright vertical") 37 | end, 38 | }) 39 | 40 | vim.api.nvim_create_autocmd("User", { 41 | pattern = "MiniFilesWindowOpen", 42 | callback = function(args) 43 | local buf_id = args.data.buf_id 44 | vim.keymap.set("n", "q", function() 45 | vim.cmd.norm("q") 46 | end, { buffer = buf_id }) 47 | end, 48 | }) 49 | end) 50 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-git.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require("mini.git").setup({ 3 | -- General CLI execution 4 | job = { 5 | -- Path to Git executable 6 | git_executable = "git", 7 | 8 | -- Timeout (in ms) for each job before force quit 9 | timeout = 30000, 10 | }, 11 | 12 | -- Options for `:Git` command 13 | command = { 14 | -- Default split direction 15 | split = "auto", 16 | }, 17 | }) 18 | end) 19 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-hipatterns.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | local hipatterns = require("mini.hipatterns") 3 | hipatterns.setup({ 4 | highlighters = { 5 | -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' 6 | fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" }, 7 | hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" }, 8 | todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" }, 9 | note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" }, 10 | 11 | -- Highlight hex color strings (`#rrggbb`) using that color 12 | hex_color = hipatterns.gen_highlighter.hex_color(), 13 | }, 14 | }) 15 | end) 16 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-icons.lua: -------------------------------------------------------------------------------- 1 | Later(require("mini.icons").setup) 2 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-indentscope.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require("mini.indentscope").setup({ 3 | -- Draw options 4 | draw = { 5 | -- Delay (in ms) between event and start of drawing scope indicator 6 | delay = 20, 7 | 8 | -- Symbol priority. Increase to display on top of more symbols. 9 | priority = 2, 10 | }, 11 | 12 | -- Module mappings. Use `''` (empty string) to disable one. 13 | mappings = { 14 | -- Textobjects 15 | object_scope = "ii", 16 | object_scope_with_border = "ai", 17 | 18 | -- Motions (jump to respective border line; if not present - body line) 19 | goto_top = "[i", 20 | goto_bottom = "]i", 21 | }, 22 | 23 | -- Options which control scope computation 24 | options = { 25 | -- Type of scope's border: which line(s) with smaller indent to 26 | -- categorize as border. Can be one of: 'both', 'top', 'bottom', 'none'. 27 | border = "both", 28 | 29 | -- Whether to use cursor column when computing reference indent. 30 | -- Useful to see incremental scopes with horizontal cursor movements. 31 | indent_at_cursor = true, 32 | 33 | -- Whether to first check input line to be a border of adjacent scope. 34 | -- Use it if you want to place cursor on function header to get scope of 35 | -- its body. 36 | try_as_border = true, 37 | }, 38 | 39 | -- Which character to use for drawing scope indicator 40 | --[[ "|" ]] 41 | symbol = "▏", 42 | -- symbol = "│", 43 | }) 44 | end) 45 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-notify.lua: -------------------------------------------------------------------------------- 1 | Now(function() 2 | local opts = { 3 | ERROR = { duration = 5000, hl_group = "DiagnosticError" }, 4 | WARN = { duration = 5000, hl_group = "DiagnosticWarn" }, 5 | INFO = { duration = 5000, hl_group = "DiagnosticInfo" }, 6 | DEBUG = { duration = 0, hl_group = "DiagnosticHint" }, 7 | TRACE = { duration = 0, hl_group = "DiagnosticOk" }, 8 | OFF = { duration = 0, hl_group = "MiniNotifyNormal" }, 9 | } 10 | require("mini.notify").setup(opts) 11 | vim.notify = require("mini.notify").make_notify() 12 | 13 | vim.keymap.set("n", "nc", function() 14 | vim.cmd.lua("MiniNotify.clear()") 15 | end, { silent = true, desc = "Clear all the notification" }) 16 | vim.keymap.set("n", "nh", function() 17 | vim.cmd.lua("MiniNotify.show_history()") 18 | end, { silent = true, desc = "Replay all the notification" }) 19 | end) 20 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-pairs.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require('mini.pairs').setup() 3 | end) 4 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-pick.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require("mini.extra").setup() 3 | require("mini.pick").setup({ 4 | window = { 5 | config = { 6 | width = 70, 7 | height = 20, 8 | }, 9 | }, 10 | mappings = { 11 | choose = "", 12 | -- choose = "", 13 | }, 14 | options = { 15 | content_from_bottom = false, 16 | use_cache = false, 17 | }, 18 | }) 19 | require("rj.extras.mini-pickproject") 20 | 21 | vim.ui.select = MiniPick.ui_select 22 | 23 | local keymap = vim.keymap.set 24 | keymap("n", "sf", function() 25 | MiniPick.builtin.files({ tool = "fd", cwd = nil }, { source = { cwd = vim.uv.cwd() } }) 26 | end, { desc = "Find Files" }) 27 | 28 | keymap("n", "sF", function() 29 | MiniPick.builtin.grep_live({ tool = "rg" }, { source = { cwd = vim.uv.cwd() } }) 30 | end, { desc = "Live Grep" }) 31 | 32 | keymap("n", "\\", function() 33 | local wipeout_cur = function() 34 | vim.api.nvim_buf_delete(MiniPick.get_picker_matches().current.bufnr, {}) 35 | end 36 | local buffer_mappings = { wipeout = { char = "", func = wipeout_cur } } 37 | MiniPick.builtin.buffers({}, { mappings = buffer_mappings }) 38 | end, { desc = "Buffers" }) 39 | 40 | keymap("n", "sr", function() 41 | MiniExtra.pickers.oldfiles() 42 | end, { desc = "Oldfiles" }) 43 | 44 | keymap("n", "sp", function() 45 | vim.cmd.Projects() 46 | end, { desc = "Projects" }) 47 | 48 | keymap("n", "sk", function() 49 | MiniExtra.pickers.keymaps({}, { 50 | window = { 51 | config = { 52 | width = 100, 53 | height = 20, 54 | }, 55 | }, 56 | }) 57 | end, { desc = "Search Keymaps" }) 58 | 59 | keymap("n", "sh", function() 60 | MiniPick.builtin.help() 61 | end, { desc = "Search Help" }) 62 | 63 | keymap("n", "se", function() 64 | MiniExtra.pickers.explorer() 65 | end, { desc = "Explorer in Pick" }) 66 | 67 | keymap("n", "sd", function() 68 | MiniExtra.pickers.diagnostic() 69 | end, { desc = "Lsp diagnostics" }) 70 | 71 | keymap("n", "sg", function() 72 | local success, err = pcall(MiniExtra.pickers.git_hunks, {}, { 73 | window = { 74 | config = { 75 | width = 100, 76 | height = 20, 77 | }, 78 | }, 79 | }) 80 | if not success then 81 | vim.notify("Error opening git hunks: " .. tostring(err), vim.log.levels.ERROR) 82 | end 83 | end, { desc = "Git hunks" }) 84 | end) 85 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-sessions.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | require("mini.sessions").setup({ 3 | autowrite = true, 4 | }) 5 | local keymap = vim.keymap.set 6 | keymap("n", "mw", function() 7 | MiniSessions.write(vim.fn.fnamemodify(vim.fn.getcwd(), ":t"), {}) 8 | end, { desc = "Write current session" }) 9 | 10 | keymap("n", "ms", function() 11 | MiniSessions.select() 12 | end, { desc = "Select a session" }) 13 | 14 | keymap("n", "md", function() 15 | MiniSessions.select("delete") 16 | end, { desc = "Delete a session to delete" }) 17 | 18 | keymap("n", "mW", function() 19 | MiniSessions.select("write") 20 | end, { desc = "Select and write a session" }) 21 | 22 | keymap("n", "mq", "qa!", { desc = "close all" }) 23 | end) 24 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-statusline.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | local blocked_filetypes = { 3 | ["man"] = true, 4 | ["dashboard"] = true, 5 | ["leetcode.nvim"] = true, 6 | } 7 | local MiniStatusline = require("mini.statusline") 8 | require("mini.statusline").setup({ 9 | content = { 10 | active = function() 11 | if blocked_filetypes[vim.bo.filetype] then 12 | vim.cmd("highlight StatusLine guibg=NONE guifg=NONE") 13 | return "" 14 | end 15 | local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 75 }) 16 | local git = MiniStatusline.section_git({ trunc_width = 75 }) 17 | local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 }) 18 | local filename = MiniStatusline.section_filename({ trunc_width = 120 }) 19 | local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 }) 20 | local location = MiniStatusline.section_location({ trunc_width = 75 }) 21 | local search = MiniStatusline.section_searchcount({ trunc_width = 75 }) 22 | return MiniStatusline.combine_groups({ 23 | { hl = mode_hl, strings = { mode } }, 24 | { hl = "MiniStatuslineDevinfo", strings = { git, diagnostics } }, 25 | "%<", -- Mark general truncate point 26 | { hl = "MiniStatuslineFilename", strings = { filename } }, 27 | "%=", -- End left alignment 28 | { hl = "MiniStatuslineFileinfo", strings = { fileinfo } }, 29 | { hl = mode_hl, strings = { search, location } }, 30 | }) 31 | end, 32 | }, 33 | use_icons = true, 34 | }) 35 | end) 36 | -------------------------------------------------------------------------------- /lua/rj/plugins/mini-surround.lua: -------------------------------------------------------------------------------- 1 | Later( 2 | function() 3 | require("mini.surround").setup() 4 | end 5 | ) 6 | -------------------------------------------------------------------------------- /lua/rj/plugins/notifier.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "vigoux/notifier.nvim", 4 | }) 5 | vim.tbl_islist = vim.islist 6 | require("notifier").setup() 7 | vim.keymap.set("n", "nc", vim.cmd.NotifierClear, { silent = true, desc = "Clear all the notification" }) 8 | vim.keymap.set("n", "nh", vim.cmd.NotifierReplay, { silent = true, desc = "Replay all the notification" }) 9 | end) 10 | -------------------------------------------------------------------------------- /lua/rj/plugins/nvim-bqf.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "kevinhwang91/nvim-bqf", 4 | }) 5 | 6 | require("bqf").setup({ 7 | auto_resize_height = true, 8 | preview = { 9 | border = {"┌", "─", "┐", "│", "┘", "─", "└", "│"}, 10 | should_preview_cb = function(bufnr, _) 11 | local ret = true 12 | local bufname = vim.api.nvim_buf_get_name(bufnr) 13 | local fsize = vim.fn.getfsize(bufname) 14 | if fsize > 5000 * 1024 then 15 | ret = false 16 | end 17 | return ret 18 | end, 19 | }, 20 | filter = { 21 | fzf = { 22 | extra_opts = { "--bind", "ctrl-o:toggle-all", "--delimiter", "│" }, 23 | }, 24 | }, 25 | }) 26 | end) 27 | -------------------------------------------------------------------------------- /lua/rj/plugins/nvim-treesitter.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "nvim-treesitter/nvim-treesitter", 4 | }) 5 | local configs = require("nvim-treesitter.configs") 6 | configs.setup({ 7 | ensure_installed = { 8 | "bash", 9 | "c", 10 | "cpp", 11 | "css", 12 | "go", 13 | "html", 14 | "html", 15 | "java", 16 | "javascript", 17 | "lua", 18 | "markdown", 19 | "markdown_inline", 20 | "python", 21 | "python", 22 | "rust", 23 | "toml", 24 | "vim", 25 | "vimdoc", 26 | }, -- put the language you want in this table 27 | -- ensure_installed = "all", 28 | sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) 29 | ignore_install = {}, -- List of parsers to ignore installing 30 | highlight = { 31 | enable = true, -- false will disable the whole extension 32 | disable = function(_, bufnr) -- Disable in files with more than 10K lines 33 | return vim.api.nvim_buf_line_count(bufnr) > 10000 34 | end, 35 | }, 36 | matchup = { 37 | enable = true, 38 | }, 39 | indent = { 40 | enable = true, 41 | disable = function(lang, bufnr) -- Disable in files with more than 10K lines 42 | local langs = { "html", "cpp", "css" } 43 | return vim.api.nvim_buf_line_count(bufnr) > 10000 or vim.tbl_contains(langs, lang) 44 | end, 45 | }, 46 | }) 47 | end) 48 | -------------------------------------------------------------------------------- /lua/rj/plugins/nvim-ts-autotag.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "windwp/nvim-ts-autotag", 4 | depends = { "nvim-treesitter/nvim-treesitter" }, 5 | }) 6 | require("nvim-ts-autotag").setup() 7 | end) 8 | -------------------------------------------------------------------------------- /lua/rj/plugins/typst-preview.lua: -------------------------------------------------------------------------------- 1 | Later(function() 2 | Add({ 3 | source = "chomosuke/typst-preview.nvim", 4 | }) 5 | require("typst-preview").setup({ 6 | dependencies_bin = { 7 | ["tinymist"] = "/home/rishabh/.local/share/nvim/mason/bin/tinymist", 8 | ["websocat"] = nil, 9 | }, 10 | }) 11 | end) 12 | -------------------------------------------------------------------------------- /mini-deps-snap: -------------------------------------------------------------------------------- 1 | return { 2 | ["auto-save.nvim"] = "29f793a3a7f98129387590269ffe3ad61ab5e509", 3 | ["barbecue.nvim"] = "3e31404f0b93a2c30d151abf0648650ac811c664", 4 | ["blink.cmp"] = "1cc3b1a908fbcfd15451c4772759549724f38524", 5 | ["conform.nvim"] = "70019124aa4f2e6838be9fbd2007f6d13b27a96d", 6 | ["cybu.nvim"] = "fe07ac6825c30c5e8c4506ff27571a7f58f327ee", 7 | ["friendly-snippets"] = "efff286dd74c22f731cdec26a70b46e5b203c619", 8 | ["gitsigns.nvim"] = "9541f5e8e24571723cb02a5c2bf078aeacc5a711", 9 | harpoon = "a84ab829eaf3678b586609888ef52f7779102263", 10 | ["hop.nvim"] = "efe58182f71fbe592f82fb211ab026f2819e855d", 11 | ["jaq-nvim"] = "236296aae555657487d1bb4d066cbde9d79d8cd4", 12 | ["leetcode.nvim"] = "db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951", 13 | ["mason-lspconfig.nvim"] = "e942edf5c85b6a2ab74059ea566cac5b3e1514a4", 14 | ["mason-tool-installer.nvim"] = "c5e07b8ff54187716334d585db34282e46fa2932", 15 | ["mason.nvim"] = "e2f7f9044ec30067bc11800a9e266664b88cda22", 16 | ["mini.nvim"] = "9e603a31d3fbc7ee61c9b556cd84e97fa2dcff53", 17 | ["nui.nvim"] = "53e907ffe5eedebdca1cd503b00aa8692068ca46", 18 | ["nvim-bqf"] = "ebb6d2689e4427452180f17c53f29f7e460236f1", 19 | ["nvim-navic"] = "8649f694d3e76ee10c19255dece6411c29206a54", 20 | ["nvim-treesitter"] = "a67a312e7b08cbf2895d8f29a4b1f38f18d9a8e8", 21 | ["nvim-treesitter-textobjects"] = "ad8f0a472148c3e0ae9851e26a722ee4e29b1595", 22 | ["nvim-ts-autotag"] = "1cca23c9da708047922d3895a71032bc0449c52d", 23 | ["nvim-web-devicons"] = "aafa5c187a15701a7299a392b907ec15d9a7075f", 24 | ["plenary.nvim"] = "3707cdb1e43f5cea73afb6037e6494e7ce847a66", 25 | ["telescope.nvim"] = "415af52339215926d705cccc08145f3782c4d132" 26 | } 27 | -------------------------------------------------------------------------------- /snippets/c.json: -------------------------------------------------------------------------------- 1 | { 2 | "C Function with Main Loop": { 3 | "prefix": "cc", 4 | "body": [ 5 | "#include ", 6 | "#include ", 7 | "#include ", 8 | "#include ", 9 | "", 10 | "void solve() {", 11 | " int x, y;", 12 | " scanf(\"%i%i\", &x, &y);", 13 | " $1", 14 | "};", 15 | "", 16 | "int main() {", 17 | " int t;", 18 | " scanf(\"%i\", &t);", 19 | " while (t--) {", 20 | " solve(); $0", 21 | " }", 22 | " return 0;", 23 | "}" 24 | ], 25 | "description": "C program with function and main loop template" 26 | }, 27 | 28 | "C Program Main Template": { 29 | "prefix": "c", 30 | "body": [ 31 | "#include ", 32 | "#include ", 33 | "#include ", 34 | "#include ", 35 | "", 36 | "int main() {", 37 | " $0", 38 | " return 0;", 39 | "}" 40 | ], 41 | "description": "Basic main template in C" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /snippets/cpp.json: -------------------------------------------------------------------------------- 1 | { 2 | "C++ Function with Main Loop": { 3 | "prefix": "cc", 4 | "body": [ 5 | "#include ", 6 | "#include ", 7 | "#include ", 8 | "#include ", 9 | "#include ", 10 | "", 11 | "using std::ios, std::cout, std::cin, std::endl, std::string, std::vector;", 12 | "", 13 | "void solve() {", 14 | " int x, y;", 15 | " cin >> x >> y;", 16 | " $1", 17 | "}", 18 | "", 19 | "int main() {", 20 | " ios::sync_with_stdio(0);", 21 | " cin.tie(0);", 22 | " long long t;", 23 | " cin >> t;", 24 | " while (t--)", 25 | " solve();", 26 | " return 0;", 27 | "}" 28 | ], 29 | "description": "C++ program with solve function and main loop template" 30 | }, 31 | 32 | "C++ AoC File Handling Template": { 33 | "prefix": "aoc", 34 | "body": [ 35 | "#include ", 36 | "#include ", 37 | "#include ", 38 | "#include ", 39 | "", 40 | "using std::cout, std::cin, std::string;", 41 | "", 42 | "int main() {", 43 | " std::ifstream myfile(\"input.txt\");", 44 | "", 45 | " if (!myfile) {", 46 | " std::cerr << \"Input file cannot be opened for reading.\\n\";", 47 | " return 1;", 48 | " }", 49 | "", 50 | " while (myfile) {", 51 | " string line;", 52 | " myfile >> line;", 53 | " if (line.empty()) {", 54 | " break;", 55 | " }", 56 | " $1", 57 | " }", 58 | " myfile.close();", 59 | " return 0;", 60 | "}" 61 | ], 62 | "description": "Advent of Code file handling template in C++" 63 | }, 64 | 65 | "C++ Solution Class Template": { 66 | "prefix": "ccc", 67 | "body": [ 68 | "#include ", 69 | "#include ", 70 | "#include ", 71 | "#include ", 72 | "#include ", 73 | "", 74 | "using std::ios, std::cout, std::cin, std::endl, std::string, std::vector;", 75 | "", 76 | "class Solution {", 77 | " $1", 78 | "};", 79 | "", 80 | "int main() {", 81 | " Solution sol;", 82 | " $2", 83 | " return 0;", 84 | "}" 85 | ], 86 | "description": "Solution class template in C++" 87 | }, 88 | 89 | "C++ Basic Main Template": { 90 | "prefix": "c", 91 | "body": [ 92 | "#include ", 93 | "#include ", 94 | "", 95 | "using std::cout, std::cin, std::string;", 96 | "", 97 | "int main() {", 98 | " $1", 99 | " return 0;", 100 | "}" 101 | ], 102 | "description": "Basic main template in C++" 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /snippets/python.json: -------------------------------------------------------------------------------- 1 | { 2 | "Python Solution Class": { 3 | "prefix": "cc", 4 | "body": [ 5 | "sol = Solution()", 6 | "print(sol.$0)" 7 | ], 8 | "description": "Template for a Solution class in Python" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /snippets/rust.json: -------------------------------------------------------------------------------- 1 | { 2 | "Leetcode snip": { 3 | "prefix": "cc", 4 | "body": [ 5 | "struct Solution;", 6 | "", 7 | "impl Solution {", 8 | " pub fn $1($2) {", 9 | " $3", 10 | " }", 11 | "}", 12 | "", 13 | "#[cfg(test)]", 14 | "mod test {", 15 | " use super::*;", 16 | " #[test]", 17 | " fn test_case() {", 18 | " let a = Solution::$0();", 19 | " assert!(a);", 20 | " }", 21 | "}" 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | chirality 2 | lua 3 | Neovim 4 | neovim 5 | nvim 6 | TCET 7 | Bitwise 8 | bitwise 9 | boolean 10 | Decrement 11 | decrement 12 | postfix 13 | -------------------------------------------------------------------------------- /spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rishabh672003/Neovim/e871ab0a6a16ceac6b5fdef167b2d9dcae19ab88/spell/en.utf-8.add.spl -------------------------------------------------------------------------------- /syntax/qf.vim: -------------------------------------------------------------------------------- 1 | if exists('b:current_syntax') 2 | finish 3 | endif 4 | 5 | syn match qfFileName /^[^│]*/ nextgroup=qfSeparatorLeft 6 | syn match qfSeparatorLeft /│/ contained nextgroup=qfLineNr 7 | syn match qfLineNr /[^│]*/ contained nextgroup=qfSeparatorRight 8 | syn match qfSeparatorRight '│' contained nextgroup=qfError,qfWarning,qfInfo,qfNote 9 | syn match qfError / E .*$/ contained 10 | syn match qfWarning / W .*$/ contained 11 | syn match qfInfo / I .*$/ contained 12 | syn match qfNote / [NH] .*$/ contained 13 | 14 | hi def link qfFileName Directory 15 | hi def link qfSeparatorLeft Delimiter 16 | hi def link qfSeparatorRight Delimiter 17 | hi def link qfLineNr LineNr 18 | hi def link qfError DiagnosticError 19 | hi def link qfWarning DiagnosticWarn 20 | hi def link qfInfo DiagnosticInfo 21 | hi def link qfNote DiagnosticHint 22 | 23 | let b:current_syntax = 'qf' 24 | -------------------------------------------------------------------------------- /utils/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Maintainer: Rishabh672003 3 | # only supported for ArchLinux and Windows 4 | 5 | import os 6 | import platform 7 | import shutil 8 | import subprocess 9 | from pathlib import Path 10 | 11 | # fmt: off 12 | neovim_linux_config = Path.home() / ".config" / "nvim" 13 | neovim_windows_config = Path.home() / "AppData" / "Local" / "nvim" 14 | repo_link = "https://github.com/Rishabh672003/Neovim" 15 | mason_dependencies = [ "git", "curl", "unzip", "tar", "gzip", "luarocks", "npm", "python-pip", "yarn", "go" ] 16 | # fmt: on 17 | 18 | 19 | def arch_linux_setup(): 20 | # get the neovim and the dependencies 21 | if shutil.which("pacman"): 22 | # fmt: off 23 | subprocess.run(["sudo", "pacman", "-S", "--needed", "--noconfirm", "neovim" ]) 24 | subprocess.run(["sudo", "pacman", "-S", "--needed", "--noconfirm", *mason_dependencies ]) 25 | # fmt: on 26 | # make the dir if it doesnt exit 27 | if not os.path.isdir(neovim_linux_config): 28 | os.makedirs(neovim_linux_config, exist_ok=True) 29 | print(f"Created directory: {neovim_linux_config}") 30 | else: 31 | pass 32 | 33 | # if already a directory exists and not not empty take a backup 34 | if os.listdir(neovim_linux_config): 35 | backup_path = f"{neovim_linux_config}.backup" 36 | shutil.move(neovim_linux_config, backup_path) 37 | print(f"Directory was not empty. Backed up to: {backup_path}") 38 | 39 | # Recreate the empty nvim directory for cloning 40 | os.makedirs(neovim_linux_config, exist_ok=True) 41 | else: 42 | print("Directory is empty. No backup needed.") 43 | 44 | # finally clone the rep in the directory 45 | subprocess.run(["git", "clone", repo_link, neovim_linux_config]) 46 | 47 | 48 | def windown_setup(): 49 | if not shutil.which("winget"): 50 | return Exception("Winget not found, please install winget") 51 | else: 52 | subprocess.run(["winget", "install", "Neovim.Neovim"]) 53 | if not shutil.which("git"): 54 | subprocess.run(["winget", "install", "Git.Git"]) 55 | subprocess.run(["git", "clone", repo_link, neovim_windows_config]) 56 | 57 | 58 | if __name__ == "__main__": 59 | if platform.system() == "Windows": 60 | windown_setup() 61 | else: 62 | arch_linux_setup() 63 | -------------------------------------------------------------------------------- /utils/startuptime.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import time 4 | from subprocess import DEVNULL, run 5 | 6 | startup_log_file: str = "tmp_" + str(time.time()).replace(".", "_") 7 | 8 | 9 | def get_time(filepath: str = startup_log_file): 10 | # we want the second line that contains nvim started 11 | # TODO: is there a better way to get this 12 | found = False 13 | with open(filepath, "r") as file: 14 | for i in file.readlines(): 15 | if "NVIM STARTED" in i: 16 | time = i.split()[0] 17 | if found: 18 | return time 19 | found = True 20 | 21 | 22 | time = lambda: get_time() 23 | 24 | for i in range(5): 25 | print(f"Warmup #{i+1}") 26 | run(["nvim", "-c", "q"], stdout=DEVNULL, stderr=DEVNULL) 27 | 28 | 29 | run(["nvim", "--clean", "-nu", "NORC", "--startuptime", startup_log_file]) 30 | print(f"No config: {time()}ms") 31 | run(["rm", startup_log_file]) 32 | 33 | run(["nvim", "--startuptime", startup_log_file]) 34 | print(f"With config: {time()}ms") 35 | run(["rm", startup_log_file]) 36 | 37 | run(["nvim", "tmp.lua", "--startuptime", startup_log_file]) 38 | print(f"Opening init.lua: {time()}ms") 39 | run(["rm", startup_log_file]) 40 | 41 | run(["nvim", "tmp.py", "--startuptime", startup_log_file]) 42 | print(f"Opening Python file: {time()}ms") 43 | run(["rm", startup_log_file]) 44 | 45 | run(["nvim", "tmp.cpp", "--startuptime", startup_log_file]) 46 | print(f"Opening CPP file: {time()}ms") 47 | run(["rm", startup_log_file]) 48 | 49 | run(["nvim", "tmp.go", "--startuptime", startup_log_file]) 50 | print(f"Opening Go file: {time()}ms") 51 | run(["rm", startup_log_file]) 52 | 53 | run(["nvim", "tmp.rs", "--startuptime", startup_log_file]) 54 | print(f"Opening Rust file: {time()}ms") 55 | run(["rm", startup_log_file]) 56 | --------------------------------------------------------------------------------