├── .github
└── README
├── .gitignore
├── .stylua.toml
├── LICENSE
├── after
├── colors
│ └── radium.vim
├── compiler
│ ├── lua.vim
│ ├── nvim.vim
│ └── python.vim
├── ftplugin
│ ├── TelescopePrompt.vim
│ ├── c.lua
│ ├── go.vim
│ ├── help.vim
│ ├── java.vim
│ ├── lspinfo.lua
│ ├── lua.vim
│ ├── qf.vim
│ ├── tex.vim
│ └── vim.vim
├── plugin
│ └── gx.vim
└── queries
│ ├── lua
│ └── highlights.scm
│ └── markdown
│ └── highlights.scm
├── init.lua
├── lua
├── core
│ ├── commands.lua
│ ├── kinds.lua
│ ├── mappings.lua
│ └── options.lua
├── plugins
│ ├── coding
│ │ ├── comments.lua
│ │ ├── dial.lua
│ │ └── init.lua
│ ├── completions
│ │ ├── autopairs.lua
│ │ ├── cmp.lua
│ │ ├── init.lua
│ │ └── snippets.lua
│ ├── explore.lua
│ ├── filetype.lua
│ ├── git.lua
│ ├── lib.lua
│ ├── lsp
│ │ ├── attach.lua
│ │ ├── config.lua
│ │ ├── init.lua
│ │ ├── jdtls.lua
│ │ ├── none.lua
│ │ ├── rename.lua
│ │ └── servers
│ │ │ ├── clangd.lua
│ │ │ ├── emmet_ls.lua
│ │ │ ├── jsonls.lua
│ │ │ ├── lua_ls.lua
│ │ │ ├── phpactor.lua
│ │ │ ├── sourcery.lua
│ │ │ ├── texlab.lua
│ │ │ └── tsserver.lua
│ ├── syntax
│ │ ├── context.lua
│ │ ├── illuminate.lua
│ │ ├── init.lua
│ │ └── treesitter.lua
│ ├── telescope
│ │ ├── actions.lua
│ │ ├── config.lua
│ │ └── init.lua
│ └── ui
│ │ ├── bufferline.lua
│ │ ├── feline.lua
│ │ ├── indents.lua
│ │ ├── init.lua
│ │ ├── scroll.lua
│ │ └── todo.lua
├── scratch
│ ├── close.lua
│ ├── ethos.lua
│ ├── github.lua
│ ├── node.lua
│ ├── on.lua
│ ├── overview.lua
│ └── paste.lua
└── telescope
│ └── _extensions
│ ├── gradle.lua
│ └── kao.lua
└── spell
└── words.add
/.github/README:
--------------------------------------------------------------------------------
1 | NEOVIM CONFIG
2 | =============
3 |
4 | Startuptime: 25.25ms
5 | Just drop this in your ~/.config.
6 | Screenshots can be found at https://imgur.com/a/ICzwXbg.
7 |
8 | Screenshots can be found here:
9 | LazyStart 8.28ms
10 | LazyDone 15.94ms (+7.66ms)
11 | UIEnter 25.25ms (+9.31ms)
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Lua sources
2 | luac.out
3 |
4 | # luarocks build files
5 | *.src.rock
6 | *.zip
7 | *.tar.gz
8 |
9 | # Object files
10 | *.o
11 | *.os
12 | *.ko
13 | *.obj
14 | *.elf
15 |
16 | # Precompiled Headers
17 | *.gch
18 | *.pch
19 |
20 | # Libraries
21 | *.lib
22 | *.a
23 | *.la
24 | *.lo
25 | *.def
26 | *.exp
27 |
28 | # Shared objects (inc. Windows DLLs)
29 | *.dll
30 | *.so
31 | *.so.*
32 | *.dylib
33 |
34 | # Executables
35 | *.exe
36 | *.out
37 | *.app
38 | *.i*86
39 | *.x86_64
40 | *.hex
41 |
42 | # Neovim
43 | **packer_compiled.lua
44 | **compiledSpec.lua
45 | .startup-time.log.txt
46 | .startup.log
47 | .startup-time.log
48 | .luarc.json
49 | test.lua
50 | spell/*.spl
51 | node_modules/
52 | lua/dharmx/plugin/spec/local.lua
53 |
54 | .sourcery
55 | log.txt
56 | lazy-lock.json
57 | lock.json
58 | *.swp
59 |
--------------------------------------------------------------------------------
/.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 = "Always"
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/after/colors/radium.vim:
--------------------------------------------------------------------------------
1 | " Radium
2 | " A radioactive colorscheme.
3 | " Authored by: https://github.com/dharmx
4 | " License: GPL-3.0
5 |
6 | " GNU GENERAL PUBLIC LICENSE
7 | " Version 3, 29 June 2007
8 | "
9 | " Permissions of this strong copyleft license are conditioned on
10 | " making available complete source code of licensed works and
11 | " modifications, which include larger works using a licensed work,
12 | " under the same license. Copyright and license notices must be
13 | " preserved. Contributors provide an express grant of patent rights.
14 | "
15 | " Read the complete license here: https://www.gnu.org/licenses/gpl-3.0.en.html
16 |
17 | set encoding=UTF-8
18 | let g:colors_name = 'radium'
19 | set background=dark
20 |
21 | let g:terminal_color_0 = '#181C24 '
22 | let g:terminal_color_1 = '#F87070'
23 | let g:terminal_color_2 = '#79DCAA'
24 | let g:terminal_color_3 = '#FFE59E'
25 | let g:terminal_color_4 = '#7AB0DF'
26 | let g:terminal_color_5 = '#C397D8'
27 | let g:terminal_color_6 = '#70C0BA'
28 | let g:terminal_color_7 = '#D4D4D5'
29 | let g:terminal_color_8 = '#1C2228'
30 | let g:terminal_color_9 = '#FB7373'
31 | let g:terminal_color_10 = '#36C692'
32 | let g:terminal_color_11 = '#FCCF67'
33 | let g:terminal_color_12 = '#5FB0FC'
34 | let g:terminal_color_13 = '#B77EE0'
35 | let g:terminal_color_14 = '#54CED6'
36 | let g:terminal_color_15 = '#FFFFFF'
37 |
38 | let $FZF_DEFAULT_OPTS = "
39 | \ --color=border:#161B20,preview-bg:#161B20
40 | \ --color='scrollbar:#24292E,gutter:#161B20'
41 | \ --color='bg+:#24292E,fg+:#D4D4D5,spinner:#79DCAA'
42 | \ --color='pointer:#C397D8,marker:#F87070'
43 | \ --color='info:#70C0BA,bg:#11161B'
44 | \ --scrollbar='░'
45 | \ --border='none'
46 | \ --separator='▓'
47 | \ --marker=' '
48 | \ --ellipsis='… '
49 | \ --prompt='ﭑ '
50 | \ --pointer=' λ'
51 | \ --layout=reverse
52 | \ --bind='ctrl-v:execute(nvim {}),shift-up:preview-page-up,shift-down:preview-page-down'
53 | \ --cycle
54 | \ --height=40
55 | \ --color='border:#161B20,preview-bg:#161B20'
56 | \ --color='scrollbar:#24292E,gutter:#161B20'
57 | \ --color='bg+:#24292E,fg+:#D4D4D5,spinner:#79DCAA'
58 | \ --color='pointer:#C397D8,marker:#F87070'
59 | \ --color='info:#70C0BA,bg:#11161B'
60 | \ --scrollbar='░'
61 | \ --border='none'
62 | \ --separator='▓'
63 | \ --marker=' '
64 | \ --ellipsis='… '
65 | \ --prompt='ﭑ '
66 | \ --pointer=' λ'
67 | \ --layout=reverse
68 | \ --bind='ctrl-v:execute(nvim {}),shift-up:preview-page-up,shift-down:preview-page-down'
69 | \ --cycle
70 | \ --height=40
71 | \ --color='border:#161B20,preview-bg:#161B20'
72 | \ --color='scrollbar:#24292E,gutter:#161B20'
73 | \ --color='bg+:#24292E,fg+:#D4D4D5,spinner:#79DCAA'
74 | \ --color='pointer:#C397D8,marker:#F87070'
75 | \ --color='info:#70C0BA,bg:#11161B'
76 | \ --scrollbar='░'
77 | \ --border='none'
78 | \ --separator='▓'
79 | \ --marker=' '
80 | \ --ellipsis='… '
81 | \ --prompt='ﭑ '
82 | \ --pointer=' λ'
83 | \ --layout=reverse
84 | \ --bind='ctrl-v:execute(nvim {}),shift-up:preview-page-up,shift-down:preview-page-down'
85 | \ --cycle
86 | \ --height=40"
87 |
88 | hi Title gui=bold guifg=#66b3ff
89 | hi LazyProp guibg=#151a1f guifg=#5FB0FC
90 | hi AlphaButtonLabelText guifg=#FFE59E
91 | hi AlphaFooting gui=bold guifg=#C397D8
92 | hi AlphaHeading guifg=#1A1F25
93 | hi AlphaKeyPrefix guibg=#7AB0DF gui=bold guifg=#101317
94 | hi AlphaLoaded guifg=#24292F
95 | hi AlphaScroll guifg=#C397D8
96 | hi Bold gui=bold
97 | hi BookmarkAnnotationLine guifg=#DDB1F2
98 | hi BookmarkAnnotationSign guifg=#C397D8
99 | hi BookmarkLine guibg=#31363B
100 | hi BookmarkSign guifg=#F87070
101 | hi Boolean gui=bold guifg=#F87070
102 | hi BufferLineBackground guibg=#14171E guifg=#242A36
103 | hi BufferLineBuffer guibg=#14171E guifg=#14171E
104 | hi BufferLineBufferSelected guibg=#7AB0DF gui=bold guifg=#101317
105 | hi BufferLineBufferVisible guibg=#14171E guifg=#7AB0DF
106 | hi BufferLineCloseButton guibg=#14171E guifg=#F87070
107 | hi BufferLinecloseButtonSelected guibg=#7AB0DF guifg=#101317
108 | hi BufferLineCloseButtonVisible guibg=#14171E guifg=#F87070
109 | hi BufferLineDuplicate guibg=#14171E guifg=#242A36
110 | hi BufferLineDuplicateSelected guibg=#14171E guifg=#242A36
111 | hi BufferLineDuplicateVisible guibg=#14171E guifg=#242A36
112 | hi BufferLineFill guibg=#101317 guifg=#313743
113 | hi BufferLineIndicatorSelected guibg=#7AB0DF guifg=#7AB0DF
114 | hi BufferLineIndicatorVisible guibg=#14171E guifg=#14171E
115 | hi BufferLineModified guibg=#14171E guifg=#79DCAA
116 | hi BufferLineModifiedSelected guibg=#7AB0DF guifg=#101317
117 | hi BufferLineModifiedVisible guibg=#14171E guifg=#79DCAA
118 | hi BufferLineOffsetSeparator guibg=#7AB0DF guifg=#7AB0DF
119 | hi BufferLinePick guibg=#14171E gui=bold guifg=#D997C8
120 | hi BufferLinePickSelected guibg=#7AB0DF gui=bold guifg=#E6CFA1
121 | hi BufferLinePickVisible guibg=#14171E gui=bold guifg=#FCCF67
122 | hi BufferLineSeparator guibg=#14171E guifg=#14171E
123 | hi BufferLineSeparatorSelected guibg=#7AB0DF guifg=#7AB0DF
124 | hi BufferLineSeparatorVisible guibg=#14171E guifg=#14171E
125 | hi BufferLineTabClose guibg=#101317 guifg=#F87070
126 | hi BufferLineTab guibg=#14171E guifg=#242A36
127 | hi BufferLineTabSelected guibg=#101317 gui=bold guifg=#7AB0DF
128 | hi BufferLineTabSeparator guibg=#14171E guifg=#14171E
129 | hi BufferLineTabSeparatorSelected guifg=#101317
130 | hi Character guifg=#E1C58D
131 | hi CmpItemAbbrDeprecated guifg=#3E4450
132 | hi CmpItemAbbr guifg=#BABABE
133 | hi CmpItemAbbrMatchFuzzy guifg=#FCCF67
134 | hi CmpItemAbbrMatch guifg=#79DCAA
135 | hi CmpItemKindClass guifg=#F87070
136 | hi CmpItemKindColor guifg=#7AB0DF
137 | hi CmpItemKindConstant guifg=#FF6666
138 | hi CmpItemKindConstructor guifg=#5FB0FC
139 | hi CmpItemKindEnum guifg=#54CED6
140 | hi CmpItemKindEnumMember guifg=#C297B9
141 | hi CmpItemKindEvent guifg=#7AAFF3
142 | hi CmpItemKindField guifg=#FFE69F
143 | hi CmpItemKindFile guifg=#FCCF67
144 | hi CmpItemKindFolder guifg=#FCCF67
145 | hi CmpItemKindFunction guifg=#BE8FD7
146 | hi CmpItemKind guifg=#3E4450
147 | hi CmpItemKindInterface guifg=#C397D8
148 | hi CmpItemKindKeyword guifg=#66B3FF
149 | hi CmpItemKindMethod guifg=#DC7272
150 | hi CmpItemKindModule guifg=#5FB0FC
151 | hi CmpItemKindOperator guifg=#70C0BA
152 | hi CmpItemKindProperty guifg=#54CED6
153 | hi CmpItemKindReference guifg=#FB7373
154 | hi CmpItemKindSnippet guifg=#FFE59E
155 | hi CmpItemKindStruct guifg=#5FB0FC
156 | hi CmpItemKindText guifg=#5FB0FC
157 | hi CmpItemKindTypeParameter guifg=#FFE49D
158 | hi CmpItemKindUnit guifg=#54CED6
159 | hi CmpItemKindValue guifg=#79DCAA
160 | hi CmpItemKindVariable guifg=#36C692
161 | hi CmpItemMenu guifg=#7AB0DF
162 | hi ColorColumn guibg=#111419 guifg=#171A20
163 | hi Comment guifg=#515C68
164 | hi Conceal guifg=#353E47 guibg=NONE
165 | hi Conditional guifg=#F87070
166 | hi Constant guifg=#FF6666
167 | hi CursorColumn guibg=#191D21
168 | hi Cursor guibg=#DFC184 guifg=#101317
169 | hi CursorLineFold guibg=#101317 guifg=#70C0BA
170 | hi CursorLine guibg=#191D21
171 | hi CursorLineNr gui=bold guifg=#FFE59E
172 | hi CursorLineSign guibg=#101317
173 | hi Debug guifg=#FB7373
174 | hi Decorator guifg=#FFE59E
175 | hi Define guifg=#C397D8
176 | hi Delimeter guifg=#7AB0DF
177 | hi Delimiter guifg=#FB7373
178 | hi DiagnosticError guifg=#F87070
179 | hi DiagnosticFloatingError guifg=#F87070
180 | hi DiagnosticFloatingHint guifg=#C397D8
181 | hi DiagnosticFloatingInfo guifg=#7AB0DF
182 | hi DiagnosticFloatingWarn guifg=#F97F7F
183 | hi DiagnosticHint guifg=#C397D8
184 | hi DiagnosticInfo guifg=#7AB0DF
185 | hi DiagnosticSignError guifg=#FB7373
186 | hi DiagnosticSignHint guifg=#C397D8
187 | hi DiagnosticSignInfo guifg=#7AB0DF
188 | hi DiagnosticSignWarn guifg=#F97F7F
189 | hi DiagnosticUnderlineError guifg=#F87070
190 | hi DiagnosticUnderlineHint guifg=#C397D8
191 | hi DiagnosticUnderlineInfo guifg=#7AB0DF
192 | hi DiagnosticUnderlineWarn guifg=#F97F7F
193 | hi DiagnosticVirtualTextError guifg=#F87070
194 | hi DiagnosticVirtualTextHint guifg=#C397D8
195 | hi DiagnosticVirtualTextInfo guifg=#7AB0DF
196 | hi DiagnosticVirtualTextWarn guifg=#F97F7F
197 | hi DiagnosticWarn guifg=#F97F7F
198 | hi DiffAdd guifg=#79DCAA gui=reverse
199 | hi DiffChange guifg=#C397D8 gui=reverse
200 | hi DiffDelete guifg=#F87070 gui=reverse
201 | hi DiffText guifg=#7AB0DF gui=reverse
202 | hi DiffviewCursorLine guibg=#191D21
203 | hi DiffviewDiffAddAsDelete guifg=#F87070 gui=reverse
204 | hi DiffviewDiffDelete guifg=#515C68
205 | hi DiffviewDim1 guifg=#515C68
206 | hi DiffviewEndOfBuffer guifg=#C397D8
207 | hi DiffviewFilePanelConflicts guifg=#F97F7F
208 | hi DiffviewFilePanelCounter gui=bold guifg=#36C692
209 | hi DiffviewFilePanelFileName guifg=#D4D4D5
210 | hi DiffviewFilePanelPath guifg=#515C68
211 | hi DiffviewFilePanelRootPath gui=bold guifg=#F87070
212 | hi DiffviewFilePanelSelected guifg=#F87070
213 | hi DiffviewFilePanelTitle gui=bold guifg=#F87070
214 | hi DiffviewFolderName guifg=#FFE59E
215 | hi DiffviewFolderSign guifg=#F96262
216 | hi DiffviewNonText guifg=#222931
217 | hi DiffviewNormal guibg=#101317 guifg=#D4D4D5
218 | hi DiffviewPrimary guifg=#BE8FD7
219 | hi DiffviewReference guifg=#BE8FD7
220 | hi DiffviewSecondary guifg=#79DCAA
221 | hi DiffviewSignColumn guibg=#101317 guifg=#D4D4D5
222 | hi DiffviewStatusIgnored guifg=#515C68
223 | hi DiffviewStatusLine guibg=#101317 guifg=#7AB0DF
224 | hi DiffviewStatusLineNC guifg=#7AB0DF
225 | hi DiffviewWinSeparator guifg=#171C21
226 | hi Directory guifg=#FFE59E
227 | hi EndOfBuffer guifg=#C397D8
228 | hi Error guifg=#F76262 guibg=NONE
229 | hi ErrorMsg guifg=#F87070 guibg=#151A1F
230 | hi Exception guifg=#36C692
231 | hi FidgetTask guifg=#1A1E27
232 | hi FidgetTitle gui=bold guifg=#36C692
233 | hi FloatBorder guibg=#151A1F guifg=#151A1F
234 | hi Float guifg=#F3A4F1
235 | hi FloatShadow guibg=#000000 blend=80
236 | hi FloatShadowThrough guibg=#000000 blend=100
237 | hi FocusedSymbol guibg=#666666 guifg=#FFA0A0
238 | hi FoldColumn guibg=#101317 guifg=#70C0BA
239 | hi Folded guibg=#101317 guifg=#282F3C
240 | hi Function guifg=#BE8FD7
241 | hi GitSignsAdd guifg=#7AB0DF
242 | hi GitSignsAddInline gui=reverse
243 | hi GitSignsAddLn guifg=#7AB0DF
244 | hi GitSignsAddLnInline gui=reverse
245 | hi GitSignsAddNr guifg=#5FB0FC
246 | hi GitSignsAddPreview guifg=#79DCAA gui=reverse
247 | hi GitSignsChangedelete guifg=#21272D
248 | hi GitSignsChangedeleteLn guifg=#CB9FE0
249 | hi GitSignsChangedeleteNr guifg=#B77EE0
250 | hi GitSignsChange guifg=#21272D
251 | hi GitSignsChangeInline gui=reverse
252 | hi GitSignsChangeLn guifg=#CB9FE0
253 | hi GitSignsChangeLnInline gui=reverse
254 | hi GitSignsChangeNr guifg=#B77EE0
255 | hi GitSignsCurrentLineBlame guifg=#222931
256 | hi GitSignsDelete guifg=#FB7373
257 | hi GitSignsDeleteInline gui=reverse
258 | hi GitSignsDeleteLn guifg=#F87070
259 | hi GitSignsDeleteLnInline gui=reverse
260 | hi GitSignsDeleteNr guifg=#FE7676
261 | hi GitSignsDeletePreview guifg=#F87070 gui=reverse
262 | hi GitSignsDeleteVirtLn guifg=#F87070 gui=reverse
263 | hi GitSignsDeleteVirtLnInLine gui=reverse
264 | hi GitSignsStagedAdd guifg=#3D586F
265 | hi GitSignsStagedAddLn guifg=#3D586F
266 | hi GitSignsStagedAddNr guifg=#2F587E
267 | hi GitSignsStagedChangedelete guifg=#101316
268 | hi GitSignsStagedChangedeleteLn guifg=#654F70
269 | hi GitSignsStagedChangedeleteNr guifg=#5B3F70
270 | hi GitSignsStagedChange guifg=#101316
271 | hi GitSignsStagedChangeLn guifg=#654F70
272 | hi GitSignsStagedChangeNr guifg=#5B3F70
273 | hi GitSignsStagedDelete guifg=#7D3939
274 | hi GitSignsStagedDeleteLn guifg=#7C3838
275 | hi GitSignsStagedDeleteNr guifg=#7F3B3B
276 | hi GitSignsStagedTopdelete guifg=#7D3939
277 | hi GitSignsStagedTopdeleteNr guifg=#7F3B3B
278 | hi GitSignsTopdelete guifg=#FB7373
279 | hi GitSignsTopdeleteNr guifg=#FE7676
280 | hi GitSignsUntracked guifg=#7AB0DF
281 | hi GitSignsUntrackedLn guifg=#7AB0DF
282 | hi GitSignsUntrackedNr guifg=#5FB0FC
283 | hi HarpoonBorder guibg=#151A1F guifg=#151A1F
284 | hi HarpoonCurrentFile gui=bold guifg=#FFE59E
285 | hi HarpoonCursor guibg=#1A1F25 guifg=#7AB0DF
286 | hi HarpoonTitle guibg=#F87070 guifg=#171C21
287 | hi HarpoonWindow guibg=#151A1F guifg=#BABABE
288 | hi HighlightUrl guifg=#70C0BA gui=underline
289 | hi HlSearchFloat guibg=#1A1E27 guifg=#D0A4E5
290 | hi HlSearchLens guibg=#1A1E27 guifg=#87BDEC
291 | hi HlSearchLensNear guibg=#FFE28F gui=bold guifg=#101317
292 | hi HlSearchNear guibg=#1A1E27 gui=bold guifg=#7DCDC7
293 | hi Identifier guifg=#36C692
294 | hi InclineBG guibg=#171C21
295 | hi InclineBGNC guibg=#14171E
296 | hi InclineCursorLine guibg=#151A1F
297 | hi InclineCursorLineNC guibg=#141A1D
298 | hi InclineFG guifg=#D4D4D5
299 | hi InclineFGNC guifg=#C397D8
300 | hi InclineNormal guibg=#151A1F guifg=#BABABE
301 | hi InclineNormalNC guibg=#151A1F guifg=#BABABE
302 | hi InclineThemeBG guibg=#FFE59E
303 | hi Include gui=bold guifg=#6AA6DF
304 | hi IncSearch guibg=#70C0BA guifg=#101317
305 | hi IndentBlanklineChar guifg=#22272C
306 | hi IndentBlanklineContextChar guifg=#7AB0DF
307 | hi IndentBlanklineContextStart guibg=#16191F
308 | hi Italic gui=italic
309 | hi JaqBorder guibg=#161921
310 | hi JaqWin guibg=#161921
311 | hi Keyword guifg=#66B3FF
312 | hi Label guifg=#F87070
313 | hi LightBulbFloatWin guifg=#FCCF67
314 | hi LightBulbSign guifg=#FFE59E
315 | hi LightBulbVirtualText guifg=#FFE59E
316 | hi LineNrAbove guifg=#2E3645
317 | hi LineNrBelow guifg=#2E3645
318 | hi LineNr guifg=#2E3645
319 | hi LspDiagnosticsSignError guifg=#FB7373
320 | hi LspDiagnosticsSignHint guifg=#C397D8
321 | hi LspDiagnosticsSignInfo guifg=#7AB0DF
322 | hi LspDiagnosticsSignWarn guifg=#FF7D7D
323 | hi LspReferenceRead guibg=#161921 gui=bold guifg=#82B8E7
324 | hi LspReferenceText guibg=#161921 gui=bold guifg=#CB9FE0
325 | hi LspReferenceWrite guibg=#161921 gui=bold guifg=#DC97CA
326 | hi LspSignatureActiveParameter guibg=#161921 gui=bold guifg=#78C8C2
327 | hi luaCommentDelimiter guifg=#515C68
328 | hi luaComment guifg=#515C68
329 | hi luaCondElse guifg=#F87070
330 | hi luaCond guifg=#F87070
331 | hi luaConstant guifg=#FF6666
332 | hi luaError guifg=#F76262
333 | hi luaFor guifg=#B77EE0
334 | hi luaFunc guifg=#36C692
335 | hi luaFunction guifg=#BE8FD7
336 | hi luaLabel guifg=#F87070
337 | hi luaMetaMethod guifg=#BE8FD7
338 | hi luaNumber guifg=#54CED6
339 | hi luaOperator guifg=#70C0BA
340 | hi luaParenError guifg=#F76262
341 | hi luaRepeat guifg=#B77EE0
342 | hi luaSpecial guifg=#C397D8
343 | hi luaStatement guifg=#F87070
344 | hi luaString2 guifg=#79DCAA
345 | hi luaStringDelimiter guifg=#79DCAA
346 | hi luaString guifg=#79DCAA
347 | hi luaSymbolOperator guifg=#70C0BA
348 | hi luaTable guifg=#5FB0FC
349 | hi Macro guifg=#F98989
350 | hi MatchBackground guibg=#111419 guifg=#171A20
351 | hi MatchParenCur guibg=#202530 gui=bold
352 | hi MatchParen guibg=#202530 gui=bold
353 | hi MatchWord guibg=#202530 gui=bold
354 | hi ModeMsg gui=bold guifg=#7AB0DF
355 | hi monarkCommand guifg=#5FB0FC
356 | hi monarkInsert guifg=#7AB0DF
357 | hi monarkNormal guifg=#79DCAA
358 | hi monarkReplace guifg=#C397D8
359 | hi MonarkSelect guifg=#54CED6
360 | hi MonarkTerminal guifg=#54CED6
361 | hi MonarkVisualBlock guifg=#FCCF67
362 | hi monarkVisual guifg=#FFE59E
363 | hi MonarkVisualLine guifg=#F87070
364 | hi MoreMsg guifg=#FFE59E
365 | hi MsgArea guifg=#CACACD
366 | hi MsgSeparator guifg=#C397D8
367 | hi NavicIconsArray guifg=#FCCF67
368 | hi NavicIconsBoolean gui=bold guifg=#F87070
369 | hi NavicIconsClass guifg=#F75858
370 | hi NavicIconsConstant gui=bold guifg=#FF6666
371 | hi NavicIconsConstructor guifg=#5FB0FC
372 | hi NavicIconsEnum guifg=#7AB0DF
373 | hi NavicIconsEnumMember guifg=#F96262
374 | hi NavicIconsEvent guifg=#79CFAA
375 | hi NavicIconsField guifg=#36C692
376 | hi NavicIconsFile guifg=#FFE59E
377 | hi NavicIconsFunction guifg=#BE8FD7
378 | hi NavicIconsInterface guifg=#FF7070
379 | hi NavicIconsKey guifg=#F87070
380 | hi NavicIconsMethod guifg=#B77EE0
381 | hi NavicIconsModule guifg=#F98989
382 | hi NavicIconsNull gui=bold guifg=#FFDF85
383 | hi NavicIconsNumber guifg=#54CED6
384 | hi NavicIconsObject guifg=#FFE390
385 | hi NavicIconsOperator guifg=#70C0BA
386 | hi NavicIconsPackage gui=bold guifg=#6AA6DF
387 | hi NavicIconsProperty guifg=#54CED6
388 | hi NavicIconsString guifg=#79DCAA
389 | hi NavicIconsStruct guifg=#5FB0FC
390 | hi NavicIconsTypeParameter guifg=#FFE49D
391 | hi NavicIconsVariable gui=bold guifg=#FA6969
392 | hi NavicSeparator guifg=#7AB0DF
393 | hi NavicText guifg=#AAAAAF
394 | hi NeogitBranch gui=bold guifg=#36C692
395 | hi NeogitCommitViewHeader guibg=#7AB0DF gui=bold guifg=#101317
396 | hi NeogitDiffAdd guibg=#16191D guifg=#7AB0DF
397 | hi NeogitDiffContextHighlight guibg=#1A1D24
398 | hi NeogitDiffDelete guibg=#1C1F22 guifg=#F87070
399 | hi NeogitFilePath guifg=#70C0BA
400 | hi NeogitFold guifg=#54CED6
401 | hi NeogitHunkHeader guibg=#171C21 guifg=#FFE59E
402 | hi NeogitHunkHeaderHighlight guibg=#FFE59E guifg=#101317
403 | hi NeogitNotificationError guibg=#101317 guifg=#F87070
404 | hi NeogitNotificationInfo guibg=#101317 guifg=#7AB0DF
405 | hi NeogitNotificationWarning guibg=#101317 guifg=#FFE59E
406 | hi NeogitObjectId guifg=#C397D8
407 | hi NeogitRebaseDone gui=bold guifg=#79DCAA
408 | hi NeogitRebasing gui=bold guifg=#FFE59E
409 | hi NeogitRecentcommits gui=bold guifg=#79DCAA
410 | hi NeogitRemote gui=bold guifg=#FCCF67
411 | hi NeogitStagedchanges gui=bold guifg=#FFE59E
412 | hi NeogitStashes gui=bold guifg=#70C0BA
413 | hi NeogitStash guifg=#70C0BA
414 | hi NeogitUnmergedchanges gui=bold guifg=#36C692
415 | hi NeogitUnmergedInto guifg=#7AB0DF
416 | hi NeogitUnpulledchanges gui=bold guifg=#54CED6
417 | hi NeogitUnpulledFrom guifg=#54CED6
418 | hi NeogitUnstagedchanges gui=bold guifg=#FB7373
419 | hi NeogitUntrackedfiles gui=bold guifg=#5FB0FC
420 | hi NonText guifg=#222931
421 | hi NormalFloat guibg=#151A1F guifg=#BABABE
422 | hi Normal guibg=#101317 guifg=#D4D4D5
423 | hi NotifyBackground guibg=#101317 guifg=#D4D4D5
424 | hi NotifyDEBUGBody guibg=#171C21 guifg=#C397D8
425 | hi NotifyDEBUGBorder guibg=#171C21 guifg=#171C21
426 | hi NotifyDEBUGIcon guibg=#171C21 guifg=#B77EE0
427 | hi NotifyDEBUGTitle guibg=#171C21 guifg=#C397D8
428 | hi NotifyERRORBody guibg=#171C21 guifg=#F87070
429 | hi NotifyERRORBorder guibg=#171C21 guifg=#171C21
430 | hi NotifyERRORIcon guibg=#171C21 guifg=#FB7373
431 | hi NotifyERRORTitle guibg=#171C21 guifg=#F87070
432 | hi NotifyINFOBody guibg=#171C21 guifg=#7AB0DF
433 | hi NotifyINFOBorder guibg=#171C21 guifg=#171C21
434 | hi NotifyINFOIcon guibg=#171C21 guifg=#5FB0FC
435 | hi NotifyINFOTitle guibg=#171C21 guifg=#7AB0DF
436 | hi NotifyLogTime guifg=#515C68
437 | hi NotifyLogTitle guifg=#FB7373
438 | hi NotifyTRACEBody guibg=#171C21 guifg=#79DCAA
439 | hi NotifyTRACEBorder guibg=#171C21 guifg=#171C21
440 | hi NotifyTRACEIcon guibg=#171C21 guifg=#36C692
441 | hi NotifyTRACETitle guibg=#171C21 guifg=#79DCAA
442 | hi NotifyWARNBody guibg=#171C21 guifg=#FFE59E
443 | hi NotifyWARNBorder guibg=#171C21 guifg=#171C21
444 | hi NotifyWARNIcon guibg=#171C21 guifg=#FCCF67
445 | hi NotifyWARNTitle guibg=#171C21 guifg=#FFE59E
446 | hi NUICancel guifg=#222931
447 | hi NUIHeading guibg=#151A1F guifg=#F87070
448 | hi NUILine guibg=#151A1F guifg=#22272C
449 | hi NUINo guifg=#F87070
450 | hi NUINormal guibg=#151A1F guifg=#151A1F
451 | hi NUIPrompt guibg=#151A1F guifg=#7AB0DF
452 | hi NUIText guibg=#151A1F guifg=#BABABE
453 | hi NUIYes guifg=#7AB0DF
454 | hi Number guifg=#54CED6
455 | hi NvimTreeBookmark guifg=#FFE59E
456 | hi NvimTreeClosedFolderIcon guifg=#B77EE0
457 | hi NvimTreeCursorLine guifg=#12151B
458 | hi NvimTreeCursorLineNr gui=bold guifg=#36C692
459 | hi NvimTreeEmptyFolderName guifg=#B58ED1
460 | hi NvimTreeExecFile guifg=#D997C8
461 | hi NvimTreeFileDeleted guifg=#FB7373
462 | hi NvimTreeFileDirty guifg=#70C0BA
463 | hi NvimTreeFileIgnored guifg=#171C21
464 | hi NvimTreeFileMerge guifg=#36C692
465 | hi NvimTreeFileNew guifg=#FFE59E
466 | hi NvimTreeFileRenamed guifg=#5FB0FC
467 | hi NvimTreeFileStaged guifg=#D997C8
468 | hi NvimTreeFolderIcon guifg=#B77EE0
469 | hi NvimTreeFolderName guifg=#B77EE0
470 | hi NvimTreeGitDeleted guifg=#F87070
471 | hi NvimTreeGitDirty guifg=#70C0BA
472 | hi NvimTreeGitIgnored guifg=#171C21
473 | hi NvimTreeGitMerge guifg=#54CED6
474 | hi NvimTreeGitNew guifg=#FFE59E
475 | hi NvimTreeGitRenamed guifg=#5FB0FC
476 | hi NvimTreeGitStaged guifg=#D997C8
477 | hi NvimTreeImageFile guifg=#B77EE0
478 | hi NvimTreeIndentMarker guifg=#1D2529
479 | hi NvimTreeNormal guibg=#0C0E11 guifg=#BABABE
480 | hi NvimTreeNormalNC guibg=#0C0E11 guifg=#BABABE
481 | hi NvimTreePopup guifg=#7AB0DF
482 | hi NvimTreeRootFolder gui=bold guifg=#F87070
483 | hi NvimTreeSymlink guifg=#70C0BA
484 | hi NvimTreeVertSplit guibg=#0C0E11 guifg=#0C0E11
485 | hi NvimTreeWindowPicker guibg=#191C24 guifg=#7AB0DF
486 | hi NvimTreeWinSeparator guibg=#0C0E11 guifg=#0C0E11
487 | hi NvimUnaryMinus guifg=#70C0BA
488 | hi NvimUnaryOperator guifg=#70C0BA
489 | hi NvimUnaryPlus guifg=#70C0BA
490 | hi Operator guifg=#70C0BA
491 | hi Pmenu guibg=#171D20 guifg=#A0A0A5
492 | hi PmenuSbar guibg=#171D20 guifg=#A0A0A5
493 | hi PmenuSel guibg=#1B2226 guifg=#ADADB2
494 | hi PmenuThumb guibg=#1E2225
495 | hi PreCondit guifg=#F96262
496 | hi PreProc guifg=#F96262
497 | hi Question guifg=#79DCAA
498 | hi QuickFixLine guibg=#FFE59E guifg=#101317
499 | hi TSRainbowBlue guifg=#94CAF9
500 | hi TSRainbowCyan guifg=#79CAFF
501 | hi TSRainbowGreen guifg=#50E0AC
502 | hi TSRainbowOrange guifg=#FF9393
503 | hi TSRainbowRed guifg=#F96262
504 | hi TSRainbowViolet guifg=#D098FF
505 | hi TSRainbowYellow guifg=#FFE981
506 | hi RedrawDebugClear guibg=#FFFF00
507 | hi RedrawDebugComposed guibg=#008000
508 | hi RedrawDebugNormal gui=reverse
509 | hi RedrawDebugRecompose guibg=#FF0000
510 | hi Repeat guifg=#B77EE0
511 | hi RnvimrCurses guibg=#101317 guifg=#D4D4D5
512 | hi RnvimrNormal guibg=#151A1F guifg=#BABABE
513 | hi ScrollbarCursor guifg=#54CED6
514 | hi ScrollbarCursorHandle guibg=#20272E guifg=#54CED6
515 | hi ScrollbarError guifg=#F87070
516 | hi ScrollbarErrorHandle guifg=#F87070
517 | hi ScrollbarGitAdd guifg=#7AB0DF
518 | hi ScrollbarGitAddHandle guifg=#82B8E7
519 | hi ScrollbarGitChange guifg=#C397D8
520 | hi ScrollbarGitChangeHandle guifg=#BD84E6
521 | hi ScrollbarGitDelete guifg=#F87070
522 | hi ScrollbarGitDeleteHandle guifg=#FF7B7B
523 | hi ScrollbarHandle guifg=#7AB0DF
524 | hi ScrollbarHint guifg=#C397D8
525 | hi ScrollbarHintHandle guifg=#B77EE0
526 | hi ScrollbarInfo guifg=#7AB0DF
527 | hi ScrollbarInfoHandle guifg=#7AB0DF
528 | hi ScrollbarMisc guifg=#DC97CA
529 | hi ScrollbarMiscHandle guifg=#70C0BA
530 | hi ScrollbarSearch guifg=#FFE59E
531 | hi ScrollbarSearchHandle guifg=#FFD76F
532 | hi ScrollbarWarn guifg=#F97F7F
533 | hi ScrollbarWarnHandle guifg=#FA6969
534 | hi Search guibg=#FFE59E guifg=#101317
535 | hi SignColumn guibg=#101317
536 | hi SpecialChar guifg=#C397D8
537 | hi SpecialComment guifg=#FFDF8F
538 | hi Special guifg=#FB7373
539 | hi SpecialKey gui=bold guifg=#FFE59E
540 | hi SpellBad guifg=#F87070
541 | hi SpellCap guifg=#FCCF67
542 | hi SpellLocal guifg=#FB7373
543 | hi SpellRare guifg=#54CED6
544 | hi Statement guifg=#F87070
545 | hi StatusLine guifg=#191D21 guibg=#7AB0DF
546 | hi StatusLineNC guifg=#7AB0DF guibg=#101317
547 | hi StorageClass guifg=#F75858
548 | hi String guifg=#79DCAA
549 | hi Structure guifg=#5FB0FC
550 | hi Substitute guibg=#B77EE0 guifg=#101317
551 | hi TabLine guibg=#101317 gui=bold guifg=#2C3640
552 | hi TabLineFill guifg=#101317 guibg=#7AB0DF
553 | hi TabLineSel guibg=#7AB0DF gui=bold guifg=#101317
554 | hi Tag guifg=#7AB0DF
555 | hi TelescopeMatching gui=bold guifg=#DC97CA
556 | hi TelescopePreviewBorder guibg=#0E1014 guifg=#0E1014
557 | hi TelescopePreviewLine guibg=#15181E
558 | hi TelescopePreviewNormal guibg=#0E1014 guifg=#BABABE
559 | hi TelescopePreviewTitle guibg=#7AB0DF guifg=#101317
560 | hi TelescopePromptBorder guibg=#12151B guifg=#14191D
561 | hi TelescopePromptCounter guibg=#12151B gui=bold guifg=#D997C8
562 | hi TelescopePromptNormal guibg=#12151B guifg=#BABABE
563 | hi TelescopePromptPrefix guibg=#12151B guifg=#F87070
564 | hi TelescopePromptTitle guibg=#F87070 guifg=#101317
565 | hi TelescopePromptBorder guibg=#12151B guifg=#2E7DC2
566 | hi TelescopeResultsBorder guibg=#0C0E11 guifg=#0C0E11
567 | hi TelescopeResultsNormal guibg=#0C0E11 guifg=#BABABE
568 | hi TelescopeResultsTitle guibg=#79DCAA guifg=#101317
569 | hi TelescopeSelectionCaret guibg=#101317 guifg=#FB7373
570 | hi TelescopeSelection guibg=#101317 guifg=#54CED6
571 | hi TermCursor gui=reverse
572 | hi TodoBgBUG guibg=#F87070 gui=bold guifg=#171C21
573 | hi TodoBgCHORE guibg=#70C0BA gui=bold guifg=#171C21
574 | hi TodoBgCLEAN guibg=#7AB0DF gui=bold guifg=#171C21
575 | hi TodoBgDEMO guibg=#5FB0FC gui=bold guifg=#171C21
576 | hi TodoBgFIX guibg=#FFE59E gui=bold guifg=#171C21
577 | hi TodoBgHACK guibg=#79DCAA gui=bold guifg=#171C21
578 | hi TodoBgIMPROVE guibg=#5FB0FC gui=bold guifg=#171C21
579 | hi TodoBgNOTE guibg=#36C692 gui=bold guifg=#171C21
580 | hi TodoBgPERF guibg=#FCCF67 gui=bold guifg=#171C21
581 | hi TodoBgTEST guibg=#54CED6 gui=bold guifg=#171C21
582 | hi TodoBgTODO guibg=#C397D8 gui=bold guifg=#171C21
583 | hi TodoBgUPDATE guibg=#B77EE0 gui=bold guifg=#171C21
584 | hi TodoBgWANTS guibg=#FFEDA6 gui=bold guifg=#171C21
585 | hi TodoBgWARN guibg=#E17272 gui=bold guifg=#171C21
586 | hi TodoFgBUG guifg=#F87070
587 | hi TodoFgCHORE guifg=#70C0BA
588 | hi TodoFgCLEAN guifg=#7AB0DF
589 | hi TodoFgDEMO guifg=#5FB0FC
590 | hi TodoFgFIX guifg=#FFE59E
591 | hi TodoFgHACK guifg=#79DCAA
592 | hi TodoFgIMPROVE guifg=#5FB0FC
593 | hi TodoFgNOTE guifg=#36C692
594 | hi TodoFgPERF guifg=#FCCF67
595 | hi TodoFgTEST guifg=#54CED6
596 | hi TodoFgTODO guifg=#C397D8
597 | hi TodoFgUPDATE guifg=#B77EE0
598 | hi TodoFgWANTS guifg=#FFEDA6
599 | hi TodoFgWARN guifg=#E17272
600 | hi Todo guifg=#FFE59E guibg=NONE
601 | hi TodoSignBUG guibg=#101317 guifg=#F87070
602 | hi TodoSignCHORE guibg=#101317 guifg=#70C0BA
603 | hi TodoSignCLEAN guibg=#101317 guifg=#7AB0DF
604 | hi TodoSignDEMO guibg=#101317 guifg=#5FB0FC
605 | hi TodoSignFIX guibg=#101317 guifg=#FCCF67
606 | hi TodoSignHACK guibg=#101317 guifg=#79DCAA
607 | hi TodoSignIMPROVE guibg=#101317 guifg=#5FB0FC
608 | hi TodoSignNOTE guibg=#101317 guifg=#36C692
609 | hi TodoSignPERF guibg=#101317 guifg=#FCCF67
610 | hi TodoSignTEST guibg=#101317 guifg=#54CED6
611 | hi TodoSignTODO guibg=#101317 guifg=#C397D8
612 | hi TodoSignUPDATE guibg=#101317 guifg=#B77EE0
613 | hi TodoSignWANTS guibg=#101317 guifg=#FFEDA6
614 | hi TodoSignWARN guibg=#101317 guifg=#E17272
615 | hi TreesitterContext guibg=#171A20
616 | hi TroubleNormal guibg=#0C0E11
617 | hi Typedef guifg=#C397D8
618 | hi Type guifg=#F87070
619 | hi Underlined gui=underline
620 | hi UndotreeBranch guifg=#FF6666
621 | hi UndotreeCurrent guifg=#F87070
622 | hi UndotreeFirstNode guifg=#BE8FD7
623 | hi UndotreeHead guifg=#36C692
624 | hi UndotreeHelp guifg=#515C68
625 | hi UndotreeHelpKey gui=bold guifg=#F87070
626 | hi UndotreeHelpTitle guifg=#F87070
627 | hi UndotreeNext guifg=#7AB0DF
628 | hi UndotreeNodeCurrent guifg=#E1C58D
629 | hi UndotreeNode guifg=#79DCAA
630 | hi UndotreeSavedBig guibg=#202530 gui=bold
631 | hi UndotreeSavedSmall guifg=#FB7373
632 | hi UndotreeSeq guifg=#515C68
633 | hi UndotreeTimeStamp guifg=#70C0BA
634 | hi VertSplit guifg=#171C21
635 | hi VirtColumn guibg=#101317 guifg=#171A20
636 | hi Visual guibg=#192023
637 | hi WarningMsg guifg=#FB7373
638 | hi WhichKeyBorder guibg=#0E1014
639 | hi WhichKeyDesc guifg=#FFE59E
640 | hi WhichKeyFloat guibg=#0E1014
641 | hi WhichKeyGroup gui=bold guifg=#F87070
642 | hi WhichKey guifg=#C397D8
643 | hi WhichKeySeparator guifg=#7AB0DF
644 | hi WhichKeyValue guifg=#929299
645 | hi Whitespace guifg=#1E222A
646 | hi WildMenu guibg=#7AB0DF guifg=#101317
647 | hi WinBar guibg=#101317
648 | hi WinBarNC guibg=#101317
649 | hi WinSeparator guifg=#171C21
650 |
651 | if has('nvim')
652 | hi @boolean gui=bold guifg=#F87070
653 | hi @character guifg=#E1C58D
654 | hi @comment guifg=#515C68
655 | hi @conditional guifg=#F87070
656 | hi @constant.builtin gui=bold guifg=#FFDF85
657 | hi @constant gui=bold guifg=#FF6666
658 | hi @constant.macro guifg=#E37070
659 | hi @constructor guifg=#5FB0FC
660 | hi @debug guifg=#7AAFC5
661 | hi @define guifg=#C397D8
662 | hi @exception guifg=#6AA6DF
663 | hi @field guifg=#36C692
664 | hi @float guifg=#F3A4F1
665 | hi @function.builtin gui=bold guifg=#36C692
666 | hi @function guifg=#BE8FD7
667 | hi @function.macro guifg=#FF7070
668 | hi @include gui=bold guifg=#6AA6DF
669 | hi @keyword.function guifg=#FB7373
670 | hi @keyword guifg=#66B3FF
671 | hi @keyword.operator guifg=#70C0BA
672 | hi @keyword.return guifg=#66B3FF
673 | hi @label guifg=#F87070
674 | hi @lua.constant.cmd gui=bold guifg=#60B0FC
675 | hi @lua.constant.vim gui=bold guifg=#FF6666
676 | hi @lua.function.pcall gui=bold guifg=#F98989
677 | hi @lua.parameter.self gui=bold guifg=#FFCE66
678 | hi @macro guifg=#F98989
679 | hi @method guifg=#B77EE0
680 | hi @namespace guifg=#60B0FC
681 | hi @number guifg=#54CED6
682 | hi @operator guifg=#70C0BA
683 | hi @parameter guifg=#FFE49D
684 | hi @preproc guifg=#F96262
685 | hi @property guifg=#54CED6
686 | hi @punctuation.bracket guifg=#FF7D7D
687 | hi @punctuation.delimiter guifg=#7AB0DF
688 | hi @punctuation guifg=#7AB0DF
689 | hi @repeat guifg=#B77EE0
690 | hi @storageclass guifg=#F75858
691 | hi @string.escape guifg=#E5E49D
692 | hi @string guifg=#79DCAA
693 | hi @string.regex guifg=#FFE390
694 | hi @string.special guifg=#FCCF67
695 | hi @structure guifg=#5FB0FC
696 | hi @tag guifg=#7AB0DF
697 | hi @text guifg=#D4D4D5
698 | hi @text.literal guifg=#79CFAA
699 | hi @text.reference guifg=#7AB0DF
700 | hi @text.title gui=bold guifg=#FA6969
701 | hi @text.todo guifg=#FFE59E
702 | hi @text.underline gui=underline
703 | hi @text.uri guifg=#70C0BA gui=underline
704 | hi @type.definition guifg=#C397D8
705 | hi @type guifg=#F87070
706 | hi @variable guifg=#D4D4D5
707 | hi @module.builtin guifg=#54CED6 gui=bold
708 |
709 | hi link @lsp.type.boolean @boolean
710 | hi link @lsp.type.builtinType @type.builtin
711 | hi link @lsp.type.comment @comment
712 | hi link @lsp.type.enum @type
713 | hi link @lsp.type.enumMember @constant
714 | hi link @lsp.type.escapeSequence @string.escape
715 | hi link @lsp.type.formatSpecifier @punctuation.special
716 | hi link @lsp.type.interface Structure
717 | hi link @lsp.type.keyword @keyword
718 | hi link @lsp.type.namespace @namespace
719 | hi link @lsp.type.number @number
720 | hi link @lsp.type.operator @operator
721 | hi link @lsp.type.parameter @parameter
722 | hi link @lsp.type.property @property
723 | hi link @lsp.type.selfKeyword @variable.builtin
724 | hi link @lsp.type.typeAlias @type.definition
725 | hi link @lsp.type.unresolvedReference @error
726 | hi link @lsp.typemod.class.defaultLibrary @type.builtin
727 | hi link @lsp.typemod.enum.defaultLibrary @type.builtin
728 | hi link @lsp.typemod.enumMember.defaultLibrary @constant.builtin
729 | hi link @lsp.typemod.function.defaultLibrary @function.builtin
730 | hi link @lsp.typemod.keyword.async @keyword.coroutine
731 | hi link @lsp.typemod.macro.defaultLibrary @function.builtin
732 | hi link @lsp.typemod.method.defaultLibrary @function.builtin
733 | hi link @lsp.typemod.operator.injected @operator
734 | hi link @lsp.typemod.string.injected @string
735 | hi link @lsp.typemod.type.defaultLibrary @type.builtin
736 | hi link @lsp.typemod.variable.defaultLibrary @variable.builtin
737 | hi link @lsp.typemod.variable.injected @variable
738 |
739 | hi link @markup.heading.1.markdown Type
740 | hi link @markup.heading.2.markdown Type
741 | hi link @markup.heading.3.markdown Type
742 | hi link @markup.heading.4.markdown Type
743 | hi link @markup.heading.5.markdown Type
744 | hi link @markup.heading.6.markdown Type
745 | hi link @markup.heading.1.marker.markdown Title
746 | hi link @markup.heading.2.marker.markdown Title
747 | hi link @markup.heading.3.marker.markdown Title
748 | hi link @markup.heading.4.marker.markdown Title
749 | hi link @markup.heading.5.marker.markdown Title
750 | hi link @markup.heading.6.marker.markdown Title
751 | endif
752 |
--------------------------------------------------------------------------------
/after/compiler/lua.vim:
--------------------------------------------------------------------------------
1 | setlocal makeprg=lua\ %
2 |
--------------------------------------------------------------------------------
/after/compiler/nvim.vim:
--------------------------------------------------------------------------------
1 | setlocal makeprg=nvim\ --headless\ -c\ so\ %\ +qa!
2 |
--------------------------------------------------------------------------------
/after/compiler/python.vim:
--------------------------------------------------------------------------------
1 | setlocal makeprg=python\ %
2 |
--------------------------------------------------------------------------------
/after/ftplugin/TelescopePrompt.vim:
--------------------------------------------------------------------------------
1 | nmap q
2 |
--------------------------------------------------------------------------------
/after/ftplugin/c.lua:
--------------------------------------------------------------------------------
1 | vim.opt_local.shiftwidth = 4
2 | vim.opt_local.tabstop = 4
3 |
4 | local saved_channel
5 | vim.api.nvim_create_user_command("DevHelp", function(args)
6 | if saved_channel then
7 | vim.fn.jobstop(saved_channel)
8 | saved_channel = nil
9 | end
10 |
11 | local keyword = vim.tbl_isempty(args.fargs) and vim.fn.expand("") or args.fargs[1]
12 | local channel = vim.fn.jobstart({ "devhelp", "--search=" .. keyword })
13 | if channel == -1 then
14 | vim.notify("devhelp is not executable.")
15 | elseif channel == 0 then
16 | vim.notify("Invalid number of arguments.")
17 | else
18 | saved_channel = channel
19 | end
20 | end, {
21 | nargs = 1,
22 | desc = ":Man equivalent for GTK/Gnome libraries."
23 | })
24 |
--------------------------------------------------------------------------------
/after/ftplugin/go.vim:
--------------------------------------------------------------------------------
1 | set autoindent
2 | set noexpandtab
3 | set tabstop=4
4 | set shiftwidth=4
5 |
--------------------------------------------------------------------------------
/after/ftplugin/help.vim:
--------------------------------------------------------------------------------
1 | setlocal signcolumn=no
2 | wincmd L
3 |
--------------------------------------------------------------------------------
/after/ftplugin/java.vim:
--------------------------------------------------------------------------------
1 | setlocal shiftwidth=4
2 | setlocal tabstop=4
3 |
--------------------------------------------------------------------------------
/after/ftplugin/lspinfo.lua:
--------------------------------------------------------------------------------
1 | vim.opt_local.winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel"
2 | local window = vim.api.nvim_get_current_win()
3 | local config = vim.api.nvim_win_get_config(window)
4 | config.border = "solid"
5 | vim.api.nvim_win_set_config(window, config)
6 |
--------------------------------------------------------------------------------
/after/ftplugin/lua.vim:
--------------------------------------------------------------------------------
1 | let working = getcwd()
2 | if working == stdpath('config')
3 | setlocal keywordprg=:help
4 | elseif match(working, '^' . $HOME . '/Projects/neovim') != -1
5 | setlocal keywordprg=:help
6 | elseif match(working, '^' . $HOME . '/Scratch/neovim') != -1
7 | setlocal keywordprg=:help
8 | endif
9 |
--------------------------------------------------------------------------------
/after/ftplugin/qf.vim:
--------------------------------------------------------------------------------
1 | setlocal winhighlight=Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,SignColumn:NormalFloat,WinSeparator:NormalFloat,ColorColumn:NormalFloat
2 |
--------------------------------------------------------------------------------
/after/ftplugin/tex.vim:
--------------------------------------------------------------------------------
1 | " syntax off
2 | " TSDisable highlight indent illuminate rainbow matchup
3 |
--------------------------------------------------------------------------------
/after/ftplugin/vim.vim:
--------------------------------------------------------------------------------
1 | if bufname() == '[Command Line]'
2 | setlocal signcolumn=no
3 | setlocal norelativenumber
4 | nmap q :q
5 | endif
6 |
--------------------------------------------------------------------------------
/after/plugin/gx.vim:
--------------------------------------------------------------------------------
1 | " Better gx to open URLs.
2 | func! __BetterGx() abort
3 | if exists('$WSLENV')
4 | lcd /mnt/c
5 | let cmd = ':silent !cmd.exe /C start'
6 | elseif has('win32') || has('win32unix')
7 | let cmd = ':silent !start'
8 | elseif executable('xdg-open')
9 | let cmd = ':silent !xdg-open'
10 | elseif executable('open')
11 | let cmd = ':silent !open'
12 | else
13 | echohl Error
14 | echomsg "Can't find proper opener for an URL!"
15 | echohl None
16 | return
17 | endif
18 |
19 | " URL regexes
20 | let rx_base = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S'
21 | let rx_bare = rx_base . '\+'
22 | let rx_embd = rx_base . '\{-}'
23 |
24 | let URL = ''
25 |
26 | " markdown URL [link text](http://ya.ru 'yandex search')
27 | try
28 | let save_view = winsaveview()
29 | if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0
30 | let URL = matchstr(getline('.')[col('.')-1:], '\[.\{-}\](\zs'.rx_embd.'\ze\(\s\+.\{-}\)\?)')
31 | endif
32 | finally
33 | call winrestview(save_view)
34 | endtry
35 |
36 | " asciidoc URL http://yandex.ru[yandex search]
37 | if empty(URL)
38 | try
39 | let save_view = winsaveview()
40 | if searchpair(rx_bare . '\[', '', '\]\zs', 'cbW', '', line('.')) > 0
41 | let URL = matchstr(getline('.')[col('.')-1:], '\S\{-}\ze[')
42 | endif
43 | finally
44 | call winrestview(save_view)
45 | endtry
46 | endif
47 |
48 | " HTML URL Python is here
49 | "
50 | if empty(URL)
51 | try
52 | let save_view = winsaveview()
53 | if searchpair('\|/>\)\zs', 'cbW', '', line('.')) > 0
54 | let URL = matchstr(getline('.')[col('.')-1:], 'href=["'."'".']\?\zs\S\{-}\ze["'."'".']\?/\?>')
55 | endif
56 | finally
57 | call winrestview(save_view)
58 | endtry
59 | endif
60 |
61 | " barebone URL http://google.com
62 | if empty(URL)
63 | let URL = matchstr(expand(''), rx_bare)
64 | endif
65 |
66 | if empty(URL)
67 | return
68 | endif
69 |
70 | exe cmd . ' "' . escape(URL, '#%!') . '"'
71 | if exists('$WSLENV') | lcd - | endif
72 | endfunc
73 | nnoremap gx :call __BetterGx()
74 |
--------------------------------------------------------------------------------
/after/queries/lua/highlights.scm:
--------------------------------------------------------------------------------
1 | ; extends
2 |
3 | (_ table: (identifier) @lua.constant.vim
4 | (#match? @lua.constant.vim "^vim$"))
5 |
6 | (_ value: (identifier) @lua.constant.vim
7 | (#match? @lua.constant.vim "^vim$"))
8 |
9 | ((dot_index_expression) @_dot_index_expression
10 | (#match? @_dot_index_expression "^vim.cmd.*")
11 | (identifier) @lua.function.cmd)
12 |
13 | ((identifier) @lua.parameter.self
14 | (#match? @lua.parameter.self "^(self|this)$"))
15 |
16 | ((function_call
17 | (arguments
18 | (identifier) @function.pcall.lua
19 | (#match? @function.pcall.lua "^require$"))))
20 |
--------------------------------------------------------------------------------
/after/queries/markdown/highlights.scm:
--------------------------------------------------------------------------------
1 | ;; extends
2 |
3 | ((task_list_marker_unchecked) @markdown.check.undone (#set! conceal ""))
4 | ((task_list_marker_checked) @markdown.check.done (#set! conceal ""))
5 |
6 | ((atx_h1_marker) @markdown.h1.marker (#set! conceal ""))
7 | ((atx_h2_marker) @markdown.h2.marker (#set! conceal "▐"))
8 | ((atx_h3_marker) @markdown.h3.marker (#set! conceal "▐"))
9 | ((atx_h4_marker) @markdown.h4.marker (#set! conceal "▐"))
10 |
11 | (([(list_marker_star) (list_marker_plus) (list_marker_minus) ]) @markdown.list.marker
12 | (#offset! @markdown.list.marker 0 0 0 -1)
13 | (#set! conceal "•"))
14 |
15 | (pipe_table_header ("|") @punctuation.special @conceal (#set! conceal "│"))
16 | (pipe_table_delimiter_row ("|") @punctuation.special @conceal (#set! conceal "│"))
17 | (pipe_table_delimiter_cell ("-") @punctuation.special @conceal (#set! conceal "─"))
18 | (pipe_table_row ("|") @punctuation.special @conceal (#set! conceal "│"))
19 |
20 | ((block_quote_marker) @markdown.quote.marker (#set! conceal "▍"))
21 | ((block_quote
22 | (paragraph (inline
23 | (block_continuation) @markdown.quote.marker (#set! conceal "▍")))))
24 |
25 | (fenced_code_block (fenced_code_block_delimiter) @markdown.code_block.marker
26 | (#set! conceal ""))
27 |
28 | ([(info_string (language))] @markdown.code_block.lang.javascript
29 | (#eq? @markdown.code_block.lang.javascript "javascript")
30 | (#set! conceal ""))
31 | ([(info_string (language))] @markdown.code_block.lang.typescript
32 | (#eq? @markdown.code_block.lang.typescript "typescript")
33 | (#set! conceal ""))
34 | ([(info_string (language))] @markdown.code_block.lang.json
35 | (#eq? @markdown.code_block.lang.json "json")
36 | (#set! conceal ""))
37 | ([(info_string (language))] @markdown.code_block.lang.bash
38 | (#eq? @markdown.code_block.lang.bash "bash")
39 | (#set! conceal ""))
40 | ([(info_string (language))] @markdown.code_block.lang.bash
41 | (#eq? @markdown.code_block.lang.bash "sh")
42 | (#set! conceal ""))
43 | ([(info_string (language))] @markdown.code_block.lang.lua
44 | (#eq? @markdown.code_block.lang.lua "lua")
45 | (#set! conceal ""))
46 | ([(info_string (language))] @markdown.code_block.lang.diff
47 | (#eq? @markdown.code_block.lang.diff "diff")
48 | (#set! conceal ""))
49 | ([(info_string (language))] @markdown.code_block.lang.vim
50 | (#eq? @markdown.code_block.lang.vim "vim")
51 | (#set! conceal ""))
52 | ([(info_string (language))] @markdown.code_block.lang.yaml
53 | (#eq? @markdown.code_block.lang.yaml "yaml")
54 | (#set! conceal ""))
55 | ([(info_string (language))] @markdown.code_block.lang.java
56 | (#eq? @markdown.code_block.lang.java "java")
57 | (#set! conceal ""))
58 | ([(info_string (language))] @markdown.code_block.lang.html
59 | (#eq? @markdown.code_block.lang.html "html")
60 | (#set! conceal ""))
61 | ([(info_string (language))] @markdown.code_block.lang.css
62 | (#eq? @markdown.code_block.lang.css "css")
63 | (#set! conceal ""))
64 | ( [(info_string (language))] @markdown.code_block.lang.sql
65 | (#eq? @markdown.code_block.lang.sql "sql")
66 | (#set! conceal ""))
67 |
--------------------------------------------------------------------------------
/init.lua:
--------------------------------------------------------------------------------
1 | function P(...) vim.notify(vim.inspect(...)) end
2 | vim.cmd.colorscheme("radium")
3 | require("core.commands")
4 | require("core.options")
5 | require("core.mappings")
6 |
7 | local data = vim.fn.stdpath("data")
8 | local lazypath = data .. "/plugins/lazy.nvim"
9 | if not vim.loop.fs_stat(lazypath) then
10 | vim.fn.system({
11 | "git",
12 | "clone",
13 | "--filter=blob:none",
14 | "https://github.com/folke/lazy.nvim.git",
15 | "--branch=stable",
16 | lazypath,
17 | })
18 | end
19 | vim.opt.runtimepath:prepend(lazypath)
20 |
21 | -- LAZY {{{
22 | require("lazy").setup("plugins", {
23 | root = vim.fn.fnamemodify(lazypath, ":h"),
24 | defaults = { lazy = true },
25 | dev = { path = vim.env.HOME .. "/Projects/neovim" },
26 | install = {
27 | missing = true,
28 | colorscheme = { "radium" },
29 | },
30 | ui = {
31 | backdrop = 100,
32 | size = { width = 0.8, height = 0.8 },
33 | border = "solid",
34 | icons = {
35 | cmd = " ",
36 | config = "",
37 | event = "",
38 | ft = " ",
39 | init = " ",
40 | import = " ",
41 | keys = " ",
42 | lazy = "鈴 ",
43 | loaded = "●",
44 | not_loaded = "○",
45 | plugin = " ",
46 | runtime = " ",
47 | source = " ",
48 | start = "",
49 | task = "✔ ",
50 | list = { "●", "➜", "★", "‒" },
51 | },
52 | throttle = 20,
53 | },
54 | diff = {
55 | cmd = "diffview.nvim",
56 | },
57 | performance = {
58 | cache = {
59 | enabled = true,
60 | path = vim.fn.stdpath("cache") .. "/lazy/cache",
61 | ttl = 3600 * 24 * 5,
62 | disable_events = { "VimEnter", "BufReadPre", "UIEnter" },
63 | },
64 | reset_packpath = true,
65 | rtp = {
66 | disabled_plugins = {
67 | "netrwPlugin",
68 | "netrwSettings",
69 | "netrwFileHandlers",
70 | "netrw",
71 | "2html_plugin",
72 | "tohtml",
73 | "getscript",
74 | "getscriptPlugin",
75 | "gzip",
76 | "logipat",
77 | "matchit",
78 | "tar",
79 | "tarPlugin",
80 | "rrhelper",
81 | "vimball",
82 | "vimballPlugin",
83 | "zip",
84 | "zipPlugin",
85 | "tutor",
86 | "rplugin",
87 | "bugreport",
88 | "tutor_mode_plugin",
89 | "sleuth",
90 | },
91 | },
92 | },
93 | readme = {
94 | root = vim.fn.stdpath("state") .. "/lazy/readme",
95 | files = { "README.md", "lua/**/README.md", ".github/README.md" },
96 | skip_if_doc_exists = true,
97 | },
98 | })
99 | -- }}}
100 |
101 | vim.schedule(function()
102 | require("scratch.ethos").setup()
103 | require("scratch.overview").setup()
104 | require("scratch.paste").setup()
105 | end)
106 |
--------------------------------------------------------------------------------
/lua/core/commands.lua:
--------------------------------------------------------------------------------
1 | GROUP = vim.api.nvim_create_augroup("DharmxGroup", {})
2 | local cmd = vim.api.nvim_create_user_command
3 | local on = require("scratch.on")
4 |
5 | -- Auto Commands {{{
6 | on.TextYankPost:group(GROUP):ex(function()
7 | vim.highlight.on_yank({
8 | higroup = "MoreMsg",
9 | on_visual = true
10 | })
11 | end)()
12 |
13 | on.TermOpen.BufReadCmd:group(GROUP):set("nonu", "nornu"):pat({
14 | "term://*",
15 | "zsh",
16 | "*/zsh",
17 | "sh",
18 | "bash",
19 | "toggleterm"
20 | })()
21 |
22 | on.BufWritePre:group(GROUP):ex(function()
23 | local directory = vim.fn.expand(":p:h")
24 | if directory:find("%l+://") == 1 then return end
25 | if vim.fn.isdirectory(directory) == 0 then vim.fn.mkdir(directory, "p") end
26 | end)()
27 |
28 | on.FileType:group(GROUP):ex("nmap q :q"):pat({
29 | "checkhealth",
30 | "help",
31 | "notify",
32 | "oil",
33 | "qf",
34 | "query",
35 | "man://*"
36 | })()
37 |
38 | on.FileType:group(GROUP):ex(function()
39 | if not vim.loop.fs_realpath("./gradlew") then return end
40 | vim.keymap.set("n", "", "Telescope gradle", {
41 | buffer = true,
42 | silent = true,
43 | })
44 | end)()
45 |
46 | on.FileType.BufWinEnter:group(GROUP):pat("*.md"):ex("silent! loadview")()
47 | on.FileType.BufWinLeave:group(GROUP):pat("*.md"):ex("mkview")()
48 | on.FileType:group(GROUP):pat("notify"):set("ft=markdown")()
49 | on.FileType:group(GROUP):pat("tsplayground"):ex("nmap q :TSPlaygroundToggle")()
50 | on.FileType:group(GROUP):pat("qf"):ex("setlocal number!")()
51 | on.InsertLeave:group(GROUP):ex(function() vim.diagnostic.enable(0) end)()
52 | on.InsertEnter:group(GROUP):ex(function() vim.diagnostic.disable(0) end)()
53 | -- }}}
54 |
55 | -- Commands {{{
56 | cmd("PickColors", function()
57 | local J = require("plenary.job")
58 | J:new({
59 | command = "xcolor",
60 | on_exit = vim.schedule_wrap(function(self, code, _)
61 | if code ~= 0 then
62 | vim.notify("Could not run xcolor.")
63 | return
64 | end
65 | local result = self:result()
66 | vim.notify("Copied " .. result[1]:upper() .. " into +.")
67 | vim.fn.setreg("+", result)
68 | end),
69 | }):start()
70 | end, { nargs = 0 })
71 |
72 | cmd("Paste", function(args)
73 | require("scratch.paste").command(args)
74 | end, {
75 | desc = "Upload/delete files/snippets to a pastebin site.",
76 | range = true,
77 | bang = true,
78 | nargs = "?",
79 | complete = function(arg, name, _)
80 | if name:match("^'<,'>Paste") then return {} end
81 | if name:match("^Paste!") then
82 | return vim.tbl_keys(require("scratch.paste")._responses)
83 | end
84 | return vim.fn.getcompletion(arg, "file")
85 | end,
86 | })
87 |
88 | cmd("GHBrowse", function(args)
89 | local starting
90 | local ending
91 | local file = vim.F.if_nil(args.fargs[1], vim.fn.expand("%"))
92 | if args.range ~= 0 then
93 | starting = args.line1
94 | ending = args.line2
95 | end
96 | require("scratch.github").fetch_permalink(file, starting, ending, { open_browser = true })
97 | end, {
98 | range = true,
99 | desc = "Browse GH.",
100 | complete = "file",
101 | nargs = "?",
102 | })
103 |
104 | cmd("Overview", function()
105 | require("scratch.overview").toggle()
106 | end, {
107 | desc = "Open keymap overview.",
108 | nargs = 0,
109 | })
110 |
111 | cmd("FormatNode", function()
112 | require("scratch.node").apply()
113 | end, {
114 | desc = "Format node under the cursor.",
115 | nargs = 0,
116 | })
117 |
118 | cmd("Terminal", function(args)
119 | local command = args.args == "" and vim.env.SHELL or args.args
120 | local width = 150
121 | local height = 20
122 | local config = {
123 | relative = "editor",
124 | width = width,
125 | height = height,
126 | border = "solid",
127 | title = string.format(" Terminal (%s) ", command),
128 | title_pos = "left",
129 | style = "minimal",
130 | row = (vim.o.lines - height - 2) / 2,
131 | col = (vim.o.columns - width) / 2,
132 | }
133 |
134 | local buffer = vim.api.nvim_create_buf(true, false)
135 | local window = vim.api.nvim_open_win(buffer, true, config)
136 | vim.api.nvim_win_set_option(window, "winhighlight", "FloatTitle:HarpoonTitle,FloatBorder:NormalFloat")
137 |
138 | vim.keymap.set("n", "q", function()
139 | if vim.api.nvim_win_is_valid(window) then vim.api.nvim_win_close(window, true) end
140 | if vim.api.nvim_buf_is_valid(buffer) then vim.api.nvim_buf_delete(buffer, { force = true }) end
141 | end, { buffer = buffer })
142 | vim.api.nvim_buf_set_option(buffer, "filetype", "terminal")
143 | vim.api.nvim_feedkeys("i", "n", true)
144 | vim.fn.termopen(command)
145 | end, {
146 | desc = "Home-made terminal command.",
147 | nargs = "*",
148 | complete = "shellcmd",
149 | })
150 |
151 | local index = 0
152 | cmd("PMark", function()
153 | local _, branch = require("track.util").root_and_branch()
154 | if not branch then return end
155 | index = math.max(index, math.min(#branch.views, index)) % #branch.views + 1
156 | vim.cmd.SelectMark(index)
157 | end, {})
158 |
159 | cmd("NMark", function()
160 | local _, branch = require("track.util").root_and_branch()
161 | if not branch then return end
162 | index = (index - 2 + #branch.views) % #branch.views + 1
163 | vim.cmd.SelectMark(index)
164 | end, {})
165 | -- }}}
166 |
--------------------------------------------------------------------------------
/lua/core/kinds.lua:
--------------------------------------------------------------------------------
1 | return {
2 | Namespace = " ",
3 | Text = " ",
4 | Method = " ",
5 | Function = " ",
6 | Constructor = " ",
7 | Field = " ",
8 | Variable = " ",
9 | Class = " ",
10 | Interface = " ",
11 | Module = " ",
12 | Property = " ",
13 | Unit = " ",
14 | Number = " ",
15 | Constant = " ",
16 | Enum = " ",
17 | EnumMember = " ",
18 | Keyword = " ",
19 | Snippet = " ",
20 | Color = " ",
21 | File = " ",
22 | Reference = " ",
23 | Folder = " ",
24 | Struct = " ",
25 | Event = " ",
26 | Operator = " ",
27 | TypeParameter = " ",
28 | Table = " ",
29 | Object = " ",
30 | Tag = " ",
31 | Array = " ",
32 | Boolean = " ",
33 | Value = " ",
34 | Null = " ",
35 | String = " ",
36 | Calendar = " ",
37 | Watch = " ",
38 | Package = " ",
39 | Copilot = " ",
40 | }
41 |
--------------------------------------------------------------------------------
/lua/core/mappings.lua:
--------------------------------------------------------------------------------
1 | local set = vim.keymap.set
2 | local silent = { remap = false, silent = true }
3 | local remap = { remap = false }
4 |
5 | set("n", "q", "copen")
6 | set("v", "<", "", ">gv", remap)
8 | set("n", "", "nohlsearch", silent)
9 | set("n", "c", "lua require('scratch.close')()", silent)
10 |
11 | set("n", "y", [["+y]])
12 | set("n", "Y", [["+Y]])
13 | set("v", "Y", [["+Y]])
14 | set("v", "y", [["+y]])
15 | set("v", "#", "g//#")
16 |
17 | set("n", "", "h")
18 | set("n", "", "j")
19 | set("n", "", "k")
20 | set("n", "", "l")
21 |
22 | set("n", "", "Track", silent)
23 | set("n", "ee", "Track branches", silent)
24 | set("n", "aa", "Mark", silent)
25 | set("n", "dd", "Unmark", silent)
26 |
27 | set("n", "", "ColorizerToggle", remap)
28 | set("n", "", "setlocal spell!", remap)
29 | set("n", "", "make", remap)
30 |
31 | set("n", "", "update", remap)
32 | set("n", "", "RnvimrToggle", remap)
33 | set("n", "", "Terminal", remap)
34 |
35 | set("n", "[q", "", remap)
36 | set("n", "]q", "cnext", remap)
37 | set("n", "[Q", "cfirst", remap)
38 | set("n", "]Q", "clast", remap)
39 | set("n", "[l", "lprevious", remap)
40 | set("n", "]l", "lnext", remap)
41 | set("n", "[b", "bprevious", remap)
42 | set("n", "]b", "bnext", remap)
43 | set("n", "[a", "previous", remap)
44 | set("n", "]a", "next", remap)
45 |
46 | set("n", "", "resize -2", silent)
47 | set("n", "", "resize +2", silent)
48 | set("n", "", "vertical resize -2", silent)
49 | set("n", "", "vertical resize +2", silent)
50 |
51 | set("n", "uu", "UndotreeToggle", silent)
52 | set("n", "bb", "Telescope buffers", silent)
53 | set("n", "ff", "Telescope media", silent)
54 | set("n", "gg", "Telescope live_grep", silent)
55 | set("n", "mm", "Telescope marks", silent)
56 | set("n", "rr", "Telescope registers", silent)
57 |
58 | set("n", "", "MoveLine(-1)", silent)
59 | set("n", "", "MoveLine(1)", silent)
60 | set("n", "", "MoveHChar(1)", silent)
61 | set("n", "", "MoveHChar(-1)", silent)
62 | set("n", "wf", "MoveWord(1)", silent)
63 | set("n", "wb", "MoveWord(-1)", silent)
64 |
65 | set("v", "", "MoveBlock(1)", silent)
66 | set("v", "", "MoveBlock(-1)", silent)
67 | set("v", "", "MoveHBlock(1)", silent)
68 | set("v", "", "MoveHBlock(-1)", silent)
69 |
70 | set("n", "s", "mm$F r`m")
71 | set("c", "%%", "getcmdtype() == ':' ? expand('%:h') .. '/' : '%%'", { expr = true })
72 |
73 | set("n", "e", vim.diagnostic.open_float)
74 | set("n", "[d", vim.diagnostic.goto_prev)
75 | set("n", "]d", vim.diagnostic.goto_next)
76 | set("n", "q", vim.diagnostic.setloclist)
77 |
--------------------------------------------------------------------------------
/lua/core/options.lua:
--------------------------------------------------------------------------------
1 | local opt = vim.opt
2 | local g = vim.g
3 |
4 | g.mapleader = ";"
5 | opt.backupdir = { vim.fn.stdpath("state") .. "/backup" }
6 | opt.spellfile = { vim.fn.stdpath("config") .. "/spell/words.add" }
7 |
8 | opt.backup = true
9 | opt.spell = false
10 | opt.wildmode = "longest,list,full"
11 | opt.spelllang = "en_us,en_gb,cjk"
12 | opt.spellsuggest = "best,9"
13 | opt.spelloptions = "camel,noplainbuffer"
14 | opt.exrc = true
15 | opt.termguicolors = true
16 | opt.textwidth = 120
17 | opt.laststatus = 3
18 | opt.backspace = "indent,eol,start"
19 | opt.completeopt = "menuone,noselect"
20 | opt.title = true
21 | opt.hidden = true
22 | opt.signcolumn = "yes"
23 | opt.splitbelow = true
24 | opt.splitright = true
25 | opt.clipboard = ""
26 | opt.cmdheight = 1
27 | opt.autowrite = true
28 | opt.autoindent = true
29 | opt.expandtab = true
30 | opt.shiftwidth = 2
31 | opt.smartindent = true
32 | opt.wildignore = "*/cache/*,*/tmp/*"
33 | opt.foldcolumn = "auto"
34 | opt.foldmethod = "marker"
35 | opt.ignorecase = false
36 | opt.smartcase = true
37 | opt.mouse = "nv"
38 | opt.undolevels = 10000
39 | opt.number = true
40 | opt.numberwidth = 1
41 | opt.relativenumber = false
42 | opt.fileencoding = "UTF-8"
43 | opt.tabstop = 4
44 | opt.timeoutlen = 250
45 | opt.undofile = true
46 | opt.updatetime = 500
47 | opt.wrap = false
48 | opt.scrolloff = 8
49 | opt.sidescrolloff = 8
50 | opt.showmode = true
51 | opt.showcmd = true
52 | opt.showtabline = 2
53 | opt.hlsearch = true
54 | opt.conceallevel = 2
55 | opt.swapfile = false
56 | opt.cursorline = false
57 | opt.cursorlineopt = "both"
58 | opt.pumheight = 25
59 | opt.pumwidth = 35
60 | opt.pumblend = 0
61 | opt.winblend = 0
62 | opt.history = 10000
63 | opt.emoji = true
64 | opt.ruler = true
65 | opt.list = true
66 | opt.menuitems = 30
67 | opt.magic = true
68 | opt.icon = true
69 | opt.background = "dark"
70 |
71 | opt.whichwrap:append("<>[]hl")
72 | opt.shortmess:append("sI")
73 | opt.diffopt:append("algorithm:patience")
74 | opt.formatoptions:remove("cro")
75 | opt.fillchars = {
76 | stlnc = " ",
77 | diff = "░",
78 | msgsep = "━",
79 | foldopen = "",
80 | foldsep = "│",
81 | foldclose = "",
82 | horiz = "━",
83 | horizup = "┻",
84 | horizdown = "┳",
85 | vert = "┃",
86 | vertleft = "┫",
87 | vertright = "┣",
88 | verthoriz = "╋",
89 | fold = "─"
90 | }
91 |
92 | local sign = vim.fn.sign_define
93 | sign("DiagnosticSignError", { text = "┃", texthl = "LspDiagnosticsSignError", linehl = "LspDiagnosticsSignError" })
94 | sign("DiagnosticSignHint", { text = "┃", texthl = "LspDiagnosticsSignHint", linehl = "LspDiagnosticsSignHint" })
95 | sign("DiagnosticSignInfo", { text = "┃", texthl = "LspDiagnosticsSignInfo", linehl = "LspDiagnosticsSignInfo" })
96 | sign("DiagnosticSignWarn", { text = "┃", texthl = "LspDiagnosticsSignWarn", linehl = "LspDiagnosticsSignWarn" })
97 | sign("DapBreakpoint", { text = "", texthl = "ErrorMsg", linehl = "ErrorMsg" })
98 | sign("DapLogPoint", { text = "", texthl = "ErrorMsg", linehl = "ErrorMsg" })
99 | sign("DapBreakpointCondition", { text = "", texthl = "ErrorMsg", linehl = "ErrorMsg" })
100 | sign("DapBreakpointRejected", { text = "", texthl = "ErrorMsg", linehl = "ErrorMsg" })
101 | sign("DapStopped", { text = "", texthl = "ErrorMsg", linehl = "ErrorMsg" })
102 |
--------------------------------------------------------------------------------
/lua/plugins/coding/comments.lua:
--------------------------------------------------------------------------------
1 | local ok, Comment = pcall(require, "Comment")
2 | if not ok then return end
3 |
4 | Comment.setup({
5 | padding = true,
6 | sticky = true,
7 | ignore = "^$",
8 | toggler = {
9 | line = "gcc",
10 | block = "gbc",
11 | },
12 | opleader = {
13 | line = "gc",
14 | block = "gb",
15 | },
16 | extra = {
17 | above = "gcO",
18 | below = "gco",
19 | eol = "gcA",
20 | },
21 | mappings = {
22 | basic = true,
23 | extra = true,
24 | },
25 | })
26 |
--------------------------------------------------------------------------------
/lua/plugins/coding/dial.lua:
--------------------------------------------------------------------------------
1 | local ok, dial = pcall(require, "dial.config")
2 | if not ok then return end
3 |
4 | local map = require("dial.map")
5 | local augend = require("dial.augend")
6 |
7 | vim.keymap.set("n", "", map.inc_normal())
8 | vim.keymap.set("n", "", map.dec_normal())
9 | vim.keymap.set("v", "", map.inc_visual())
10 | vim.keymap.set("v", "", map.dec_visual())
11 | vim.keymap.set("v", "g", map.inc_gvisual())
12 | vim.keymap.set("v", "g", map.dec_gvisual())
13 |
14 | local Bool = augend.constant.new({
15 | elements = {
16 | "True",
17 | "False",
18 | },
19 | })
20 |
21 | local BOOL = augend.constant.new({
22 | elements = {
23 | "TRUE",
24 | "FALSE",
25 | },
26 | })
27 |
28 | dial.augends:register_group({
29 | default = {
30 | augend.integer.alias.decimal,
31 | augend.integer.alias.hex,
32 | augend.constant.alias.bool,
33 | Bool,
34 | BOOL,
35 | augend.constant.alias.Alpha,
36 | augend.constant.alias.alpha,
37 | augend.date.alias["%Y/%m/%d"],
38 | augend.date.alias["%m/%d/%Y"],
39 | augend.hexcolor.new({
40 | case = "lower",
41 | cyclic = true,
42 | }),
43 | augend.constant.new({
44 | elements = { "and", "or" },
45 | word = true,
46 | cyclic = true,
47 | }),
48 | augend.constant.new({
49 | elements = { "&&", "||" },
50 | word = false,
51 | cyclic = true,
52 | }),
53 | augend.constant.new({
54 | elements = { "[x]", "[ ]" },
55 | word = false,
56 | cyclic = true,
57 | }),
58 | },
59 | })
60 |
--------------------------------------------------------------------------------
/lua/plugins/coding/init.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "numToStr/Comment.nvim",
4 | keys = { "g", { mode = "v", "g" }, { mode = "i", "g" }, { mode = "x", "g" } },
5 | config = function()
6 | require("plugins.coding.comments")
7 | end,
8 | },
9 | {
10 | "monaqa/dial.nvim",
11 | keys = { mode = "n", { "", "", "", "" } },
12 | config = function()
13 | require("plugins.coding.dial")
14 | end,
15 | },
16 | {
17 | "itchyny/vim-highlighturl",
18 | event = "CursorMoved",
19 | },
20 | {
21 | "tyru/open-browser.vim",
22 | event = "CmdlineEnter"
23 | },
24 | {
25 | "fedepujol/move.nvim",
26 | opts = {
27 | line = {
28 | enable = true,
29 | indent = true,
30 | },
31 | block = {
32 | enable = true,
33 | indent = true,
34 | },
35 | word = {
36 | enable = true,
37 | },
38 | char = {
39 | enable = true,
40 | }
41 | },
42 | event = { "CursorHold", "CursorMoved", "InsertEnter", "CmdlineEnter" },
43 | },
44 | {
45 | "mbbill/undotree",
46 | init = function()
47 | vim.g.undotree_WindowLayout = 4
48 | vim.g.undotree_ShortIndicators = 0
49 | vim.g.undotree_DiffpanelHeight = 10
50 | vim.g.undotree_DiffAutoOpen = 1
51 | vim.g.undotree_SetFocusWhenToggle = 1
52 | vim.g.undotree_SplitWidth = 40
53 | vim.g.undotree_TreeNodeShape = "*"
54 | vim.g.undotree_TreeVertShape = "|"
55 | vim.g.undotree_TreeSplitShape = "/"
56 | vim.g.undotree_TreeReturnShape = "\\"
57 | vim.g.undotree_DiffCommand = "diff"
58 | vim.g.undotree_RelativeTimestamp = 1
59 | vim.g.undotree_HighlightChangedText = 1
60 | vim.g.undotree_HighlightChangedWithSign = 1
61 | vim.g.undotree_HighlightSyntaxAdd = "DiffAdd"
62 | vim.g.undotree_HighlightSyntaxChange = "DiffChange"
63 | vim.g.undotree_HighlightSyntaxDel = "DiffDelete"
64 | vim.g.undotree_HelpLine = 1
65 | vim.g.undotree_CursorLine = 1
66 | end,
67 | cmd = "UndotreeToggle",
68 | },
69 | {
70 | "lervag/vimtex",
71 | ft = "tex",
72 | init = function()
73 | vim.g.vimtex_view_method = "zathura"
74 | vim.g.vimtex_context_pdf_viewer = "zathura"
75 | vim.g.vimtex_compiler_latexmk = {
76 | aux_dir = "",
77 | out_dir = "",
78 | callback = 1,
79 | continuous = 1,
80 | executable = "latexmk",
81 | hooks = {},
82 | options = {
83 | "-shell-escape",
84 | "-verbose",
85 | "-file-line-error",
86 | "-synctex=1",
87 | "-interaction=nonstopmode",
88 | "-pdf",
89 | },
90 | }
91 | end,
92 | },
93 | {
94 | "sindrets/diffview.nvim",
95 | config = true,
96 | event = "CmdlineEnter",
97 | },
98 | {
99 | "tpope/vim-repeat",
100 | event = { "CursorHold", "CursorMoved", "InsertEnter", "CmdlineEnter" },
101 | },
102 | }
103 |
--------------------------------------------------------------------------------
/lua/plugins/completions/autopairs.lua:
--------------------------------------------------------------------------------
1 | local ok, autopairs = pcall(require, "nvim-autopairs")
2 | if not ok then return end
3 |
4 | autopairs.setup({
5 | check_ts = true,
6 | close_triple_quotes = true,
7 | disable_filetype = {
8 | "TelescopeResults",
9 | "query",
10 | "tsplayground",
11 | "lazy",
12 | "lsp-installer",
13 | "markdown",
14 | "mason",
15 | "txt",
16 | "dashboard",
17 | "alpha",
18 | "NvimTree",
19 | "undotree",
20 | "diff",
21 | "fugitive",
22 | "fugitiveblame",
23 | "Outline",
24 | "SidebarNvim",
25 | "packer",
26 | "lsp-installer",
27 | "TelescopePrompt",
28 | "help",
29 | "telescope",
30 | "lspinfo",
31 | "Trouble",
32 | "null-ls-info",
33 | "quickfix",
34 | "chadtree",
35 | "fzf",
36 | "NeogitStatus",
37 | "terminal",
38 | "console",
39 | "term://*",
40 | "Term://*",
41 | "toggleterm",
42 | "qf",
43 | "prompt",
44 | "noice",
45 | "",
46 | },
47 | })
48 |
49 | local Rule = require("nvim-autopairs.rule")
50 | local cond = require("nvim-autopairs.conds")
51 |
52 | autopairs.add_rules({
53 | Rule(" ", " ")
54 | :with_pair(function(opts)
55 | local pair = opts.line:sub(opts.col - 1, opts.col)
56 | return vim.tbl_contains({ "()", "{}", "[]" }, pair)
57 | end)
58 | :with_move(cond.none())
59 | :with_cr(cond.none())
60 | :with_del(function(opts)
61 | local col = vim.api.nvim_win_get_cursor(0)[2]
62 | local context = opts.line:sub(col - 1, col + 2)
63 | return vim.tbl_contains({ "( )", "{ }", "[ ]" }, context)
64 | end),
65 | Rule("", " )")
66 | :with_pair(cond.none())
67 | :with_move(function(opts) return opts.char == ")" end)
68 | :with_cr(cond.none())
69 | :with_del(cond.none())
70 | :use_key(")"),
71 | Rule("", " }")
72 | :with_pair(cond.none())
73 | :with_move(function(opts) return opts.char == "}" end)
74 | :with_cr(cond.none())
75 | :with_del(cond.none())
76 | :use_key("}"),
77 | Rule("", " ]")
78 | :with_pair(cond.none())
79 | :with_move(function(opts) return opts.char == "]" end)
80 | :with_cr(cond.none())
81 | :with_del(cond.none())
82 | :use_key("]"),
83 | })
84 |
85 | autopairs.add_rules({
86 | Rule("%(.*%)%s*%=>$", " { }", { "typescript", "typescriptreact", "javascript" })
87 | :use_regex(true)
88 | :set_end_pair_length(2),
89 | })
90 |
91 | autopairs.add_rule(Rule("$", "$", "tex"))
92 |
--------------------------------------------------------------------------------
/lua/plugins/completions/cmp.lua:
--------------------------------------------------------------------------------
1 | local ok, cmp = pcall(require, "cmp")
2 | if not ok then return end
3 |
4 | -- IMPORTS/UTILS {{{
5 | local kind = require("core.kinds")
6 | local luasnip = require("luasnip")
7 |
8 | local function has_words_before()
9 | local line, col = unpack(vim.api.nvim_win_get_cursor(0))
10 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
11 | end
12 |
13 | local function custom_compare(entry1, entry2)
14 | local _, entry1_under = entry1.completion_item.label:find("^_+")
15 | local _, entry2_under = entry2.completion_item.label:find("^_+")
16 | entry1_under = entry1_under or 0
17 | entry2_under = entry2_under or 0
18 | if entry1_under > entry2_under then
19 | return false
20 | elseif entry1_under < entry2_under then
21 | return true
22 | end
23 | end
24 | -- }}}
25 |
26 | cmp.setup({
27 | snippet = { expand = function(args) require("luasnip").lsp_expand(args.body) end },
28 | -- use for path
29 | mapping = cmp.mapping.preset.insert({
30 | [""] = cmp.mapping.scroll_docs(-4),
31 | [""] = cmp.mapping.scroll_docs(4),
32 | [""] = cmp.mapping.abort(),
33 | [""] = cmp.mapping(cmp.mapping.confirm({
34 | behavior = cmp.ConfirmBehavior.Insert,
35 | select = true,
36 | }), { "i", "s" }),
37 | [""] = cmp.mapping(function(fallback)
38 | if cmp.visible() then
39 | cmp.select_next_item()
40 | elseif luasnip.expand_or_locally_jumpable() then
41 | luasnip.expand_or_jump()
42 | elseif has_words_before() then
43 | cmp.complete()
44 | else
45 | fallback()
46 | end
47 | end, { "i", "s" }),
48 | [""] = cmp.mapping(function(fallback)
49 | if cmp.visible() then
50 | cmp.select_prev_item()
51 | elseif luasnip.jumpable(-1) then
52 | luasnip.jump(-1)
53 | else
54 | fallback()
55 | end
56 | end, { "i", "s" }),
57 | [""] = cmp.mapping({
58 | i = cmp.mapping.complete(),
59 | s = function()
60 | if cmp.visible() then
61 | if not cmp.confirm({ select = true }) then return end
62 | else
63 | cmp.complete()
64 | end
65 | end,
66 | }),
67 | }),
68 | preselect = cmp.PreselectMode.Item,
69 | sources = cmp.config.sources({
70 | { name = "nvim_lsp", keyword_length = 2, group_index = 1 },
71 | { name = "luasnip", max_item_count = 3 },
72 | { name = "nvim_lsp_signature_help" },
73 | { name = "zsh", max_item_count = 5 },
74 | { name = "emoji", max_item_count = 10 },
75 | { name = "buffer", keyword_length = 5, max_item_count = 5, group_index = 2 },
76 | }),
77 | window = {
78 | documentation = { border = "solid" },
79 | completion = {
80 | border = "none",
81 | completeopt = "menu,menuone,noinsert",
82 | col_offset = 0,
83 | side_padding = 1,
84 | keyword_length = 1,
85 | },
86 | },
87 | view = { entries = { name = "custom" } },
88 | formatting = {
89 | fields = { "abbr", "kind", "menu" },
90 | format = function(entry, item)
91 | item.kind = kind[item.kind] .. " " .. item.kind
92 | return item
93 | end,
94 | },
95 | experimental = { ghost_text = { "Comment" } },
96 | completion = {
97 | completeopt = "menu,menuone,noselect,preview",
98 | autocomplete = false,
99 | },
100 | sorting = {
101 | comparators = {
102 | cmp.config.compare.offset,
103 | cmp.config.compare.exact,
104 | custom_compare,
105 | cmp.config.compare.score,
106 | cmp.config.compare.kind,
107 | cmp.config.compare.sort_text,
108 | cmp.config.compare.length,
109 | cmp.config.compare.order,
110 | },
111 | },
112 | })
113 |
--------------------------------------------------------------------------------
/lua/plugins/completions/init.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "rafamadriz/friendly-snippets",
3 | "saadparwaiz1/cmp_luasnip",
4 | "hrsh7th/cmp-nvim-lsp-signature-help",
5 | "hrsh7th/cmp-buffer",
6 | "hrsh7th/cmp-nvim-lsp",
7 | {
8 | "L3MON4D3/LuaSnip",
9 | event = "InsertEnter",
10 | config = function()
11 | require("plugins.completions.snippets")
12 | end,
13 | },
14 | {
15 | "hrsh7th/nvim-cmp",
16 | event = "InsertEnter",
17 | config = function()
18 | require("plugins.completions.cmp")
19 | end,
20 | keys = { mode = "i", "" },
21 | dependencies = {
22 | "saadparwaiz1/cmp_luasnip",
23 | "hrsh7th/cmp-nvim-lsp-signature-help",
24 | "hrsh7th/cmp-buffer",
25 | "hrsh7th/cmp-nvim-lsp",
26 | },
27 | },
28 | {
29 | "windwp/nvim-autopairs",
30 | event = "InsertEnter",
31 | config = function()
32 | require("plugins.completions.autopairs")
33 | end,
34 | },
35 | }
36 |
--------------------------------------------------------------------------------
/lua/plugins/completions/snippets.lua:
--------------------------------------------------------------------------------
1 | local ok, luasnip = pcall(require, "luasnip")
2 | if not ok then return end
3 | local types = require("luasnip.util.types")
4 |
5 | luasnip.config.set_config({
6 | history = true,
7 | region_check_events = "CursorMoved,CursorHold,InsertEnter",
8 | delete_check_events = "InsertLeave",
9 | enable_autosnippets = true,
10 | update_events = "TextChanged,TextChangedI",
11 | ext_opts = {
12 | [types.choiceNode] = {
13 | active = {
14 | virt_text = { { "●", "@float" } },
15 | },
16 | },
17 | [types.insertNode] = {
18 | active = {
19 | virt_text = { { "●", "@storageclass" } },
20 | },
21 | },
22 | },
23 | })
24 |
25 | require("luasnip.loaders.from_vscode").lazy_load({
26 | paths = {
27 | require("lazy.core.config").options.root .. "/friendly-snippets",
28 | },
29 | })
30 |
--------------------------------------------------------------------------------
/lua/plugins/explore.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "TheBallsUp/lube.nvim",
4 | dev = true,
5 | },
6 | {
7 | "toppair/peek.nvim",
8 | build = "deno task --quiet build:fast",
9 | opts = {
10 | auto_load = true,
11 | close_on_bdelete = true,
12 | syntax = true,
13 | theme = "dark",
14 | update_on_change = true,
15 | app = vim.env.BROWSER,
16 | filetype = { "markdown" },
17 | throttle_at = 200000,
18 | throttle_time = "auto",
19 | },
20 | ft = "markdown",
21 | },
22 | {
23 | "kevinhwang91/rnvimr",
24 | init = function()
25 | local g = vim.g
26 | local fn = vim.fn
27 | local api = vim.api
28 |
29 | g.rnvimr_enable_ex = 1
30 | g.rnvimr_enable_picker = 1
31 | g.rnvimr_edit_cmd = "drop"
32 | g.rnvimr_draw_border = 0
33 | g.rnvimr_hide_gitignore = 1
34 | g.rnvimr_border_attr = { ["fg"] = 14, ["bg"] = -1 }
35 | g.rnvimr_enable_bw = 1
36 | g.rnvimr_shadow_winblend = 70
37 |
38 | g.rnvimr_action = {
39 | [""] = "NvimEdit Mark true",
40 | ["gw"] = "JumpNvimCwd",
41 | ["yw"] = "EmitRangerCwd",
42 | }
43 |
44 | g.rnvimr_presets = {
45 | { ["width"] = 0.800, ["height"] = 0.800 },
46 | { ["width"] = 0.600, ["height"] = 0.600 },
47 | { ["width"] = 0.950, ["height"] = 0.950 },
48 | { ["width"] = 0.500, ["height"] = 0.500, ["col"] = 0, ["row"] = 0 },
49 | { ["width"] = 0.500, ["height"] = 0.500, ["col"] = 0, ["row"] = 0.5 },
50 | { ["width"] = 0.500, ["height"] = 0.500, ["col"] = 0.5, ["row"] = 0 },
51 | { ["width"] = 0.500, ["height"] = 0.500, ["col"] = 0.5, ["row"] = 0.5 },
52 | { ["width"] = 0.500, ["height"] = 1.000, ["col"] = 0, ["row"] = 0 },
53 | { ["width"] = 0.500, ["height"] = 1.000, ["col"] = 0.5, ["row"] = 0 },
54 | { ["width"] = 1.000, ["height"] = 0.500, ["col"] = 0, ["row"] = 0 },
55 | { ["width"] = 1.000, ["height"] = 0.500, ["col"] = 0, ["row"] = 0.5 },
56 | }
57 |
58 | g.rnvimr_ranger_views = {
59 | {
60 | ["minwidth"] = 90,
61 | ["ratio"] = {},
62 | },
63 | {
64 | ["minwidth"] = 50,
65 | ["maxwidth"] = 89,
66 | ["ratio"] = { 1, 1 },
67 | },
68 | {
69 | ["maxwidth"] = 49,
70 | ["ratio"] = { 1 },
71 | },
72 | }
73 |
74 | g.rnvimr_layout = {
75 | ["relative"] = "editor",
76 | ["width"] = fn.float2nr(fn.round(0.7 * api.nvim_win_get_width(0))),
77 | ["height"] = fn.float2nr(fn.round(0.7 * api.nvim_win_get_height(0))),
78 | ["col"] = fn.float2nr(fn.round(0.15 * api.nvim_win_get_width(0))),
79 | ["row"] = fn.float2nr(fn.round(0.15 * api.nvim_win_get_height(0))),
80 | ["style"] = "minimal",
81 | }
82 |
83 | g.rnvimr_layout = {
84 | ["relative"] = "editor",
85 | ["width"] = api.nvim_win_get_width(0),
86 | ["height"] = api.nvim_win_get_height(0) - 2,
87 | ["col"] = 0,
88 | ["row"] = 0,
89 | ["style"] = "minimal",
90 | }
91 | end,
92 | lazy = false,
93 | },
94 | }
95 |
--------------------------------------------------------------------------------
/lua/plugins/filetype.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "kovetskiy/sxhkd-vim",
4 | ft = "sxhkd",
5 | },
6 | {
7 | "pigpigyyy/yuescript-vim",
8 | ft = "yue",
9 | },
10 | {
11 | "phelipetls/vim-hugo",
12 | ft = "markdown",
13 | },
14 | {
15 | "robertbasic/vim-hugo-helper",
16 | ft = "markdown",
17 | },
18 | }
19 |
--------------------------------------------------------------------------------
/lua/plugins/git.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "NeogitOrg/neogit",
4 | opts = {
5 | signs = {
6 | section = { "", "" },
7 | item = { "", "" },
8 | hunk = { "", "" },
9 | },
10 | },
11 | cmd = "Neogit",
12 | },
13 | {
14 | "lewis6991/gitsigns.nvim",
15 | opts = {
16 | signcolumn = false,
17 | numhl = false,
18 | linehl = false,
19 | word_diff = false,
20 | watch_gitdir = { interval = 1000, follow_files = true },
21 | attach_to_untracked = true,
22 | current_line_blame = false,
23 | current_line_blame_opts = {
24 | virt_text = true,
25 | virt_text_pos = "overlay",
26 | delay = 1000,
27 | ignore_whitespace = true,
28 | },
29 | sign_priority = 6,
30 | update_debounce = 100,
31 | status_formatter = nil,
32 | max_file_length = 40000,
33 | preview_config = {
34 | border = "solid",
35 | style = "minimal",
36 | relative = "cursor",
37 | row = 0,
38 | col = 1,
39 | },
40 | },
41 | event = { "CmdlineEnter", "InsertEnter", "CursorHold", "CursorMoved" },
42 | },
43 | }
44 |
--------------------------------------------------------------------------------
/lua/plugins/lib.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "tami5/sqlite.lua",
3 | "nvim-lua/plenary.nvim",
4 | "MunifTanjim/nui.nvim",
5 | }
6 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/attach.lua:
--------------------------------------------------------------------------------
1 | local navic_ok, navic = pcall(require, "nvim-navic")
2 |
3 | local map = vim.keymap.set
4 | local autocmd = vim.api.nvim_create_autocmd
5 |
6 | local function is_none_formatting_enabled(buffer)
7 | local generators = require("null-ls.generators")
8 | local methods = require("null-ls.methods")
9 | return #generators.get_available(vim.bo[buffer].filetype, methods.internal.FORMATTING) > 0
10 | end
11 |
12 | local function formatting(buffer)
13 | return function()
14 | vim.lsp.buf.format({
15 | async = true,
16 | ---@param client vim.lsp.Client
17 | filter = function(client)
18 | if vim.bo[buffer].filetype ~= "lua" and client.supports_method("textDocument/formatting") then
19 | return not not client.name
20 | end
21 | return client.name == "null-ls"
22 | end,
23 | })
24 | end
25 | end
26 |
27 | return function(client, buffer)
28 | vim.bo[buffer].omnifunc = "v:lua.vim.lsp.omnifunc"
29 | local opts = { buffer = buffer }
30 | if client.name == "clangd" then client.server_capabilities.offsetEncoding = "UTF-8" end
31 |
32 | map("n", "K", vim.lsp.buf.hover, opts)
33 | map("n", "", vim.lsp.buf.signature_help, opts)
34 | map("n", "D", vim.lsp.buf.declaration, opts)
35 | map("n", "d", vim.lsp.buf.definition, opts)
36 | map("n", "t", vim.lsp.buf.type_definition, opts)
37 | map("n", "wa", vim.lsp.buf.add_workspace_folder, opts)
38 | map("n", "wa", vim.lsp.buf.remove_workspace_folder, opts)
39 | map("n", "wd", function() vim.notify(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts)
40 | map("n", "rn", require("plugins.lsp.rename").lsp_rename, opts)
41 | map("n", "gr", vim.lsp.buf.references, opts)
42 | map({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts)
43 | map("n", "f", formatting(buffer), opts)
44 |
45 | if client.server_capabilities.documentFormattingProvider then
46 | if client.name == "null-ls" and is_none_formatting_enabled(buffer) or client.name ~= "null-ls" then
47 | vim.bo[buffer].formatexpr = "v:lua.vim.lsp.formatexpr()"
48 | map("n", "gq", formatting(buffer), opts)
49 | else
50 | vim.bo[buffer].formatexpr = nil
51 | end
52 | end
53 |
54 | local LSP_GROUP = vim.api.nvim_create_augroup("LSPGroup", {})
55 | if client.supports_method("textDocument/codeLens") then
56 | autocmd({ "BufEnter", "InsertLeave", "BufWritePost", "CursorHold" }, {
57 | callback = vim.lsp.codelens.refresh,
58 | group = LSP_GROUP,
59 | buffer = buffer,
60 | })
61 | end
62 |
63 | if client.config.flags then client.config.flags.allow_incremental_sync = true end
64 | if navic_ok and client.server_capabilities.documentSymbolProvider then navic.attach(client, buffer) end
65 | client.server_capabilities.semanticTokensProvider = nil
66 | end
67 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/config.lua:
--------------------------------------------------------------------------------
1 | local mason_ok, mason = pcall(require, "mason-lspconfig")
2 | local cmp_ok, cmp = pcall(require, "cmp_nvim_lsp")
3 | local lsp_ok, lsp = pcall(require, "lspconfig")
4 |
5 | if not (mason_ok and cmp_ok and lsp_ok) then return end
6 |
7 | vim.lsp.set_log_level("warn")
8 | vim.lsp.protocol.CompletionItemKind = require("core.kinds")
9 | vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}"
10 | vim.diagnostic.config({
11 | signs = true,
12 | underline = true,
13 | update_in_insert = false,
14 | severity_sort = true,
15 | float = { source = "always", border = "solid" },
16 | virtual_text = { prefix = " ", source = "always" },
17 | })
18 |
19 | local capabilities = cmp.default_capabilities()
20 | capabilities.textDocument.completion.completionItem.snippetSupport = true
21 | capabilities.textDocument.completion.completionItem.preselectSupport = true
22 | capabilities.textDocument.completion.completionItem.insertReplaceSupport = true
23 | capabilities.textDocument.completion.completionItem.labelDetailsSupport = true
24 | capabilities.textDocument.completion.completionItem.deprecatedSupport = true
25 | capabilities.textDocument.completion.completionItem.commitCharactersSupport = true
26 | capabilities.textDocument.semanticHighlighting = true
27 | capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } }
28 | capabilities.textDocument.completion.completionItem.resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits" } }
29 | capabilities.textDocument.completion.completionItem.documentationFormat = { "markdown", "plaintext" }
30 |
31 | local opts = {
32 | autostart = true,
33 | init_options = { documentFormatting = true },
34 | flags = { debounce_text_changes = 150 },
35 | on_attach = require("plugins.lsp.attach"),
36 | capabilities = capabilities,
37 | handlers = {
38 | ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "solid", focusable = true }),
39 | ["textDocument/references"] = vim.lsp.with(vim.lsp.handlers["textDocument/references"], { loclist = true }),
40 | ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "solid", focusable = true }),
41 | ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
42 | virtual_text = false,
43 | signs = true,
44 | underline = true,
45 | update_in_insert = false,
46 | severity_sort = true,
47 | }),
48 | },
49 | }
50 |
51 | require("neodev")
52 | local ignore = { "rust_analyzer", "jdtls" }
53 | mason.setup_handlers({
54 | function(name)
55 | if vim.tbl_contains(ignore, name) then return end
56 | local opts_ok, more_opts = pcall(require, "plugins.lsp.servers." .. name)
57 | lsp[name].setup(vim.tbl_deep_extend("keep", opts, opts_ok and more_opts or opts))
58 | end,
59 | jdtls = function()
60 | if vim.bo.filetype ~= "java" then return end
61 | local jdtls = require("plugins.lsp.jdtls")
62 | local opts_ok, more_opts = pcall(require, "plugins.lsp.servers.jdtls")
63 | jdtls.setup(vim.tbl_deep_extend("keep", opts, opts_ok and more_opts or opts))
64 | jdtls.load_telescope()
65 | end
66 | })
67 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/init.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "mfussenegger/nvim-jdtls",
3 | {
4 | "neovim/nvim-lspconfig",
5 | dependencies = "nvimtools/none-ls.nvim",
6 | config = function()
7 | require("plugins.lsp.config")
8 | end,
9 | cmd = "LspStart",
10 | },
11 | {
12 | "williamboman/mason.nvim",
13 | opts = {
14 | install_root_dir = vim.fn.stdpath("data") .. "/servers",
15 | max_concurrent_installers = 10,
16 | border = "solid",
17 | pip = { upgrade_pip = true },
18 | ui = {
19 | icons = {
20 | package_installed = " ",
21 | package_pending = " ",
22 | package_uninstalled = "◍ ",
23 | },
24 | },
25 | },
26 | },
27 | {
28 | "nvimtools/none-ls.nvim",
29 | config = function() require("plugins.lsp.none") end,
30 | dependencies = "jayp0521/mason-null-ls.nvim",
31 | },
32 | {
33 | "williamboman/mason-lspconfig.nvim",
34 | dependencies = "williamboman/mason.nvim",
35 | opts = {
36 | ensure_installed = {
37 | "intelephense",
38 | "texlab",
39 | "jsonls",
40 | "pyright",
41 | "lua_ls",
42 | "emmet_ls",
43 | "grammarly",
44 | "vimls",
45 | "clangd",
46 | "gopls",
47 | "jdtls",
48 | "sourcery",
49 | "gradle_ls",
50 | },
51 | automatic_installation = true,
52 | },
53 | },
54 | {
55 | "jayp0521/mason-null-ls.nvim",
56 | opts = {
57 | ensure_installed = {
58 | "autopep8",
59 | "sql-formatter",
60 | "isort",
61 | "stylua",
62 | "markdownlint",
63 | "stylelint",
64 | "shellcheck",
65 | "vint",
66 | "prettier",
67 | "black",
68 | "shellharden",
69 | "proselint",
70 | "gitlint",
71 | "shfmt",
72 | },
73 | automatic_installation = true,
74 | automatic_setup = true,
75 | },
76 | },
77 | {
78 | "folke/neodev.nvim",
79 | opts = {
80 | library = {
81 | enabled = true,
82 | runtime = true,
83 | types = true,
84 | plugins = { "plenary.nvim", "telescope.nvim" },
85 | },
86 | setup_jsonls = true,
87 | lspconfig = true,
88 | pathStrict = true,
89 | },
90 | },
91 | {
92 | "SmiteshP/nvim-navic",
93 | opts = {
94 | icons = require("core.kinds"),
95 | highlight = true,
96 | depth_limit = 0,
97 | separator = " ",
98 | depth_limit_indicator = "… ",
99 | safe_output = true,
100 | },
101 | },
102 | }
103 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/jdtls.lua:
--------------------------------------------------------------------------------
1 | local M = {}
2 |
3 | function M.setup(options)
4 | local jdtls_ok, jdtls = pcall(require, "jdtls")
5 | if not jdtls_ok then return end
6 | local jdtls_setup = require("jdtls.setup")
7 |
8 | local mason_root = require("mason.settings").current.install_root_dir
9 | local roots = { ".git", "pom.xml", "mvnw", "gradlew", ".idea", ".iml" }
10 | local root = vim.fs.dirname(vim.fs.find(roots, { upward = true })[1]) or vim.loop.cwd()
11 | local workspace = vim.fn.stdpath("cache") .. "/workspace/" .. vim.fn.fnamemodify(root, ":p:h:t")
12 |
13 | local schema = {
14 | cmd = {
15 | mason_root .. "/bin/jdtls",
16 | "-jar",
17 | vim.fn.glob(mason_root .. "/packages/jdtls/plugins/*.jar"),
18 | "-configuration",
19 | mason_root .. "/packages/jdtls/config_linux",
20 | "-data",
21 | workspace,
22 | },
23 | root_dir = root,
24 | settings = {
25 | java = {
26 | configuration = {
27 | runtimes = {
28 | {
29 | name = "JavaSE-15",
30 | path = "/usr/lib/jvm/java-15-openjdk/",
31 | },
32 | {
33 | name = "JavaSE-11",
34 | path = "/usr/lib/jvm/java-11-openjdk/",
35 | },
36 | {
37 | name = "JavaSE-22",
38 | path = "/usr/lib/jvm/java-22-openjdk/",
39 | },
40 | },
41 | },
42 | saveActions = { organizeImports = true },
43 | signatureHelp = { enabled = true },
44 | completion = {
45 | favoriteStaticMembers = {
46 | "org.junit.jupiter.api.Assertions.*",
47 | "java.util.Objects.requireNonNull",
48 | "java.util.Objects.requireNonNullElse",
49 | },
50 | filteredTypes = { "com.sun.*", "io.micrometer.shaded.*", "java.awt.*", "jdk.*", "sun.*" },
51 | },
52 | sources = {
53 | organizeImports = {
54 | starThreshold = 9999,
55 | staticStarThreshold = 9999,
56 | },
57 | },
58 | codeGeneration = {
59 | hashCodeEquals = { useJava7Objects = false },
60 | useBlocks = false,
61 | toString = {
62 | template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}",
63 | },
64 | },
65 | project = {
66 | referencedLibraries = {
67 | root .. "/lib**/*.jar",
68 | root .. "/*.jar",
69 | },
70 | },
71 | },
72 | },
73 | }
74 |
75 | schema = vim.tbl_deep_extend("keep", schema, options)
76 | local extendedClientCapabilities = jdtls.extendedClientCapabilities
77 | extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
78 | schema.init_options = { extendedClientCapabilities = extendedClientCapabilities }
79 | jdtls.start_or_attach(schema)
80 | jdtls_setup.add_commands()
81 | end
82 |
83 | function M.load_telescope(options)
84 | local ui_ok, ui = pcall(require, "jdtls.ui")
85 | if not ui_ok then return end
86 | options = vim.F.if_nil(options, {})
87 |
88 | local finders = require("telescope.finders")
89 | local sorters = require("telescope.sorters")
90 | local actions = require("telescope.actions")
91 | local pickers = require("telescope.pickers")
92 |
93 | ui.pick_one_async = function(items, prompt, label, callback)
94 | pickers
95 | .new(options, {
96 | prompt_title = prompt,
97 | finder = finders.new_table({
98 | results = items,
99 | entry_maker = function(entry) return { value = entry, display = label(entry), ordinal = label(entry) } end,
100 | }),
101 | sorter = sorters.get_generic_fuzzy_sorter(),
102 | attach_mappings = function(buffer)
103 | actions.goto_file_selection_edit:replace(function()
104 | local selection = actions.get_selected_entry(buffer)
105 | actions.close(buffer)
106 | callback(selection.value)
107 | end)
108 | return true
109 | end,
110 | })
111 | :find()
112 | end
113 | end
114 |
115 | return M
116 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/none.lua:
--------------------------------------------------------------------------------
1 | local ok, none = pcall(require, "null-ls")
2 | if not ok then return end
3 |
4 | -- {{{
5 | local helpers = require("null-ls.helpers")
6 |
7 | none.register({
8 | method = none.methods.DIAGNOSTICS,
9 | filetypes = { "markdown" },
10 | generator = none.generator({
11 | command = "markdownlint",
12 | args = { "--stdin" },
13 | to_stdin = true,
14 | from_stderr = true,
15 | format = "line",
16 | check_exit_code = function(code, stderr)
17 | local success = code <= 1
18 | if not success then vim.notify(stderr) end
19 | return success
20 | end,
21 | on_output = helpers.diagnostics.from_patterns({
22 | {
23 | pattern = [[:(%d+):(%d+) [%w-/]+ (.*)]],
24 | groups = { "row", "col", "message" },
25 | },
26 | {
27 | pattern = [[:(%d+) [%w-/]+ (.*)]],
28 | groups = { "row", "message" }
29 | },
30 | }),
31 | }),
32 | })
33 | -- }}}
34 |
35 | local B = none.builtins
36 | none.setup({
37 | on_attach = require("plugins.lsp.attach"),
38 | sources = {
39 | B.code_actions.proselint,
40 | B.diagnostics.markdownlint,
41 | B.diagnostics.proselint,
42 | B.diagnostics.stylelint,
43 | B.diagnostics.vint,
44 | B.diagnostics.zsh,
45 | B.formatting.cmake_format,
46 | B.formatting.gofmt,
47 | B.formatting.markdownlint,
48 | B.formatting.nginx_beautifier,
49 | B.formatting.prettier,
50 | B.formatting.shellharden,
51 | B.formatting.sql_formatter,
52 | B.formatting.stylelint,
53 | B.formatting.stylua,
54 | B.formatting.isort,
55 | B.formatting.google_java_format.with({ extra_args = { "--aosp" } }),
56 | B.formatting.shfmt.with({
57 | extra_args = function(params)
58 | return {
59 | "--indent",
60 | vim.api.nvim_buf_get_option(params.bufnr, "shiftwidth"),
61 | "--binary-next-line",
62 | "--case-indent",
63 | "--space-redirects",
64 | "--keep-padding",
65 | }
66 | end,
67 | }),
68 | },
69 | })
70 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/rename.lua:
--------------------------------------------------------------------------------
1 | local Input = require("nui.input")
2 | local event = require("nui.utils.autocmd").event
3 | local NuiText = require("nui.text")
4 |
5 | local function nui_lsp_rename()
6 | local current_name = vim.fn.expand("")
7 | local params = vim.lsp.util.make_position_params(0, vim.bo.fileencoding)
8 |
9 | local function on_submit(new_name)
10 | if not new_name or #new_name == 0 then
11 | vim.api.nvim_notify("Cancelled: New name is empty!", vim.log.levels.INFO, {
12 | icon = "ﰸ",
13 | title = " LSP",
14 | })
15 | return
16 | elseif new_name == current_name then
17 | vim.api.nvim_notify("Cancelled: New and current names are the same!", vim.log.levels.INFO, {
18 | icon = "",
19 | title = " LSP",
20 | })
21 | return
22 | end
23 |
24 | params.newName = new_name
25 | vim.lsp.buf_request(0, "textDocument/rename", params, function(_, result, context, _)
26 | if not result then return end
27 | local client = vim.lsp.get_client_by_id(context.client_id)
28 | vim.lsp.util.apply_workspace_edit(result, client.offset_encoding)
29 |
30 | local total_files = vim.tbl_count(vim.F.if_nil(result.changes, {}))
31 | print(string.format("Changed %s file%s. To save them run ':wa'", total_files, total_files > 1 and "s" or ""))
32 | vim.api.nvim_notify("Renamed " .. current_name .. " into " .. new_name .. ".", vim.log.levels.INFO, {
33 | icon = "",
34 | title = " LSP",
35 | })
36 | end)
37 | end
38 |
39 | local popup_options = {
40 | border = {
41 | style = {
42 | top_left = NuiText(" ", "NUINormal"),
43 | top = NuiText("━", "NUILine"),
44 | top_right = NuiText(" ", "NUINormal"),
45 | left = NuiText(" ", "NUINormal"),
46 | right = NuiText(" ", "NUINormal"),
47 | bottom_left = NuiText(" ", "NUINormal"),
48 | bottom = NuiText(" ", "NUINormal"),
49 | bottom_right = NuiText(" ", "NUINormal"),
50 | },
51 | text = {
52 | top = NuiText("RENAME ", "NUIHeading"),
53 | top_align = "left",
54 | },
55 | },
56 | winblend = 0,
57 | highlight = "NUIText:NUIText",
58 | relative = {
59 | type = "buf",
60 | position = {
61 | row = params.position.line,
62 | col = params.position.character,
63 | },
64 | },
65 | position = {
66 | row = 1,
67 | col = 0,
68 | },
69 | size = {
70 | width = 25,
71 | height = 1,
72 | },
73 | }
74 |
75 | local input = Input(popup_options, {
76 | default_value = current_name,
77 | on_submit = on_submit,
78 | prompt = NuiText(" ﬦ ", "NUIPrompt"),
79 | })
80 |
81 | input:mount()
82 | vim.schedule(function() vim.api.nvim_command("stopinsert") end)
83 | input:map("n", "", input.input_props.on_close, { noremap = true })
84 | input:on(event.BufLeave, input.input_props.on_close, { once = true })
85 | end
86 |
87 | return {
88 | lsp_rename = nui_lsp_rename,
89 | }
90 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/clangd.lua:
--------------------------------------------------------------------------------
1 | local schema = {
2 | cmd = {
3 | "clangd",
4 | "--background-index",
5 | "--pch-storage=memory",
6 | "--clang-tidy",
7 | "--suggest-missing-includes",
8 | "--cross-file-rename",
9 | "--completion-style=detailed",
10 | },
11 | init_options = {
12 | clangdFileStatus = true,
13 | usePlaceholders = true,
14 | completeUnimported = true,
15 | semanticHighlighting = true,
16 | },
17 | filetypes = { "c", "cpp", "objc", "objcpp", "cuda" },
18 | log_level = 2,
19 | root_dir = require("lspconfig.util").root_pattern({
20 | ".clangd",
21 | ".clang-tidy",
22 | ".clang-format",
23 | "compile_flags.txt",
24 | "compile_commands.json",
25 | "configure.ac",
26 | ".git",
27 | }) or vim.loop.cwd(),
28 | single_file_support = true,
29 | }
30 |
31 | return schema
32 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/emmet_ls.lua:
--------------------------------------------------------------------------------
1 | local schema = {
2 | filetypes = {
3 | "html",
4 | "blade",
5 | },
6 | }
7 |
8 | return schema
9 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/jsonls.lua:
--------------------------------------------------------------------------------
1 | local ok, schemastore = pcall(require, "schemastore")
2 | local json_schemas = {}
3 |
4 | if ok then json_schemas = schemastore.json.schemas({
5 | select = { ".eslintrc", "package.json" },
6 | }) end
7 |
8 | local schema = {
9 | settings = {
10 | json = {
11 | ---@diagnostic disable-next-line: missing-parameter
12 | schemas = vim.list_extend({
13 | {
14 | description = "json-ls configuration file",
15 | fileMatch = { ".jsonls.json", "jsonls.json" },
16 | url = "https://gist.githubusercontent.com/tamago324/d09875f231ee4f149ed63766af3cc0ca/raw/ee598f1e8348b94bb5d7a12ef111775679242f21/schema-jsonls.json",
17 | },
18 | {
19 | description = "TypeScript compiler configuration file",
20 | fileMatch = { "tsconfig.json", "tsconfig.*.json" },
21 | url = "http://json.schemastore.org/tsconfig",
22 | },
23 | {
24 | description = "Lerna config",
25 | fileMatch = { "lerna.json" },
26 | url = "http://json.schemastore.org/lerna",
27 | },
28 | {
29 | description = "Babel configuration",
30 | fileMatch = {
31 | ".babelrc.json",
32 | ".babelrc",
33 | "babel.config.json",
34 | },
35 | url = "http://json.schemastore.org/lerna",
36 | },
37 | {
38 | description = "ESLint config",
39 | fileMatch = { ".eslintrc.json", ".eslintrc" },
40 | url = "http://json.schemastore.org/eslintrc",
41 | },
42 | {
43 | description = "Bucklescript config",
44 | fileMatch = { "bsconfig.json" },
45 | url = "https://bucklescript.github.io/bucklescript/docson/build-schema.json",
46 | },
47 | {
48 | description = "Prettier config",
49 | fileMatch = {
50 | ".prettierrc",
51 | ".prettierrc.json",
52 | "prettier.config.json",
53 | },
54 | url = "http://json.schemastore.org/prettierrc",
55 | },
56 | {
57 | description = "Vercel Now config",
58 | fileMatch = { "now.json" },
59 | url = "http://json.schemastore.org/now",
60 | },
61 | {
62 | description = "Stylelint config",
63 | fileMatch = {
64 | ".stylelintrc",
65 | ".stylelintrc.json",
66 | "stylelint.config.json",
67 | },
68 | url = "http://json.schemastore.org/stylelintrc",
69 | },
70 | {
71 | description = "SumnekoLua config",
72 | fileMatch = {
73 | ".sumnekorc.json",
74 | "sumnekorc.json",
75 | "sumnekorc",
76 | ".sumnekorc",
77 | ".sumnekorc.lua",
78 | "sumnekorc.lua",
79 | "sumneko_lua.lua",
80 | ".luarc.json",
81 | "luarc.json",
82 | },
83 | url = "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
84 | },
85 | }, json_schemas),
86 | },
87 | },
88 | }
89 |
90 | return schema
91 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/lua_ls.lua:
--------------------------------------------------------------------------------
1 | local schema = {
2 | cmd = { "lua-language-server" },
3 | filetypes = { "lua" },
4 | log_level = 2,
5 | root_dir = require("lspconfig.util").root_pattern({
6 | "stylua.toml",
7 | ".stylua.toml",
8 | ".styluaignore",
9 | ".luarc.json",
10 | ".luarc",
11 | "luarc.json",
12 | ".luacheckrc",
13 | "selene.toml",
14 | ".selene.toml",
15 | ".git",
16 | "neoconf.json",
17 | ".neoconf.json",
18 | }) or vim.loop.cwd(),
19 | single_file_support = true,
20 | settings = {
21 | Lua = {
22 | workspace = {
23 | checkThirdParty = false,
24 | },
25 | },
26 | },
27 | }
28 |
29 | return schema
30 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/phpactor.lua:
--------------------------------------------------------------------------------
1 | local schema = {
2 | init_options = {
3 | ["language_server_phpstan.enabled"] = false,
4 | ["language_server_psalm.enabled"] = false,
5 | },
6 | }
7 |
8 | return schema
9 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/sourcery.lua:
--------------------------------------------------------------------------------
1 | local env = io.open(vim.fn.stdpath("data") .. "/.sourcery")
2 |
3 | local schema = {
4 | settings = {
5 | sourcery = {
6 | metricsEnabled = true,
7 | },
8 | },
9 | }
10 |
11 | if env then
12 | schema.init_options = {}
13 | schema.init_options.token = vim.split(env:read(), "=", { plain = true })[2]
14 | env:close()
15 | end
16 |
17 | return schema
18 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/texlab.lua:
--------------------------------------------------------------------------------
1 | local schema = {
2 | texlab = {
3 | auxDirectory = ".",
4 | bibtexFormatter = "texlab",
5 | build = {
6 | args = { "-f", "-shell-escape", "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
7 | executable = "latexmk",
8 | forwardSearchAfter = false,
9 | onSave = false,
10 | },
11 | chktex = {
12 | onEdit = false,
13 | onOpenAndSave = false,
14 | },
15 | lint = {
16 | onChange = false,
17 | onSave = false,
18 | },
19 | diagnosticsDelay = 300,
20 | formatterLineLength = 80,
21 | forwardSearch = {
22 | args = {},
23 | },
24 | latexFormatter = "latexindent",
25 | latexindent = {
26 | modifyLineBreaks = false,
27 | },
28 | },
29 | }
30 |
31 | return schema
32 |
--------------------------------------------------------------------------------
/lua/plugins/lsp/servers/tsserver.lua:
--------------------------------------------------------------------------------
1 | local schema = {
2 | init_options = {
3 | preferences = {
4 | disableSuggestions = true,
5 | },
6 | },
7 | }
8 |
9 | return schema
10 |
--------------------------------------------------------------------------------
/lua/plugins/syntax/context.lua:
--------------------------------------------------------------------------------
1 | local ok, context = pcall(require, "context")
2 | if not ok then return end
3 |
4 | context.setup({
5 | enable = true,
6 | max_lines = 0,
7 | trim_scope = "outer",
8 | min_window_height = 0,
9 | patterns = {
10 | default = {
11 | "class",
12 | "function",
13 | "method",
14 | "for",
15 | "while",
16 | "if",
17 | "switch",
18 | "case",
19 | "interface",
20 | "struct",
21 | "enum",
22 | },
23 | tex = {
24 | "chapter",
25 | "section",
26 | "subsection",
27 | "subsubsection",
28 | },
29 | haskell = {
30 | "adt",
31 | },
32 | rust = {
33 | "impl_item",
34 | },
35 | terraform = {
36 | "block",
37 | "object_elem",
38 | "attribute",
39 | },
40 | scala = {
41 | "object_definition",
42 | },
43 | vhdl = {
44 | "process_statement",
45 | "architecture_body",
46 | "entity_declaration",
47 | },
48 | markdown = {
49 | "section",
50 | },
51 | elixir = {
52 | "anonymous_function",
53 | "arguments",
54 | "block",
55 | "do_block",
56 | "list",
57 | "map",
58 | "tuple",
59 | "quoted_content",
60 | },
61 | json = {
62 | "pair",
63 | },
64 | typescript = {
65 | "export_statement",
66 | },
67 | yaml = {
68 | "block_mapping_pair",
69 | },
70 | },
71 | exact_patterns = {
72 | rust = true,
73 | },
74 | zindex = 20,
75 | mode = "cursor",
76 | separator = nil,
77 | })
78 |
--------------------------------------------------------------------------------
/lua/plugins/syntax/illuminate.lua:
--------------------------------------------------------------------------------
1 | local ok, illuminate = pcall(require, "illuminate")
2 | if not ok then return end
3 |
4 | illuminate.configure({
5 | providers = {
6 | "lsp",
7 | "treesitter",
8 | "regex",
9 | },
10 | delay = 100,
11 | filetype_overrides = {},
12 | filetypes_denylist = {
13 | "lube",
14 | "TelescopeResults",
15 | "query",
16 | "gitrebase",
17 | "gitcommit",
18 | "tsplayground",
19 | "lazy",
20 | "lsp-installer",
21 | "markdown",
22 | "mason",
23 | "text",
24 | "dashboard",
25 | "alpha",
26 | "NvimTree",
27 | "undotree",
28 | "diff",
29 | "fugitive",
30 | "fugitiveblame",
31 | "Outline",
32 | "SidebarNvim",
33 | "packer",
34 | "lsp-installer",
35 | "TelescopePrompt",
36 | "help",
37 | "telescope",
38 | "lspinfo",
39 | "Trouble",
40 | "null-ls-info",
41 | "quickfix",
42 | "chadtree",
43 | "fzf",
44 | "NeogitStatus",
45 | "terminal",
46 | "console",
47 | "term://*",
48 | "Term://*",
49 | "toggleterm",
50 | "qf",
51 | "prompt",
52 | "noice",
53 | "",
54 | },
55 | filetypes_allowlist = {},
56 | modes_denylist = {},
57 | modes_allowlist = {},
58 | providers_regex_syntax_denylist = {},
59 | providers_regex_syntax_allowlist = {},
60 | under_cursor = true,
61 | large_file_cutoff = nil,
62 | large_file_overrides = nil,
63 | min_count_to_highlight = 1,
64 | })
65 |
--------------------------------------------------------------------------------
/lua/plugins/syntax/init.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "nvim-treesitter/nvim-treesitter",
4 | build = ":TSUpdate",
5 | lazy = false,
6 | config = function()
7 | require("plugins.syntax.treesitter")
8 | end,
9 | },
10 | {
11 | "romgrk/nvim-treesitter-context",
12 | event = { "CursorHold", "CursorMoved", "InsertEnter" },
13 | config = function()
14 | require("plugins.syntax.context")
15 | end,
16 | },
17 | {
18 | "nvim-treesitter/nvim-treesitter-textobjects",
19 | lazy = false,
20 | event = { "CursorHold", "CursorMoved", "InsertEnter" },
21 | },
22 | {
23 | "RRethy/vim-illuminate",
24 | event = { "CursorHold", "CursorMoved", "InsertEnter" },
25 | config = function()
26 | require("plugins.syntax.illuminate")
27 | end,
28 | },
29 | {
30 | "andymass/vim-matchup",
31 | event = { "CursorHold", "CursorMoved", "InsertEnter" },
32 | },
33 | }
34 |
--------------------------------------------------------------------------------
/lua/plugins/syntax/treesitter.lua:
--------------------------------------------------------------------------------
1 | local ok, treesitter = pcall(require, "nvim-treesitter.configs")
2 | if not ok then return end
3 | vim.opt.runtimepath:append(vim.fn.stdpath("data") .. "/parsers")
4 |
5 | treesitter.setup({
6 | ensure_installed = {
7 | "lua",
8 | "regex",
9 | "scheme",
10 | "racket",
11 | "gitignore",
12 | "gitcommit",
13 | "gitattributes",
14 | "sxhkdrc",
15 | "python",
16 | "make",
17 | "json",
18 | "todotxt",
19 | "c",
20 | "vimdoc",
21 | "rust",
22 | "awk",
23 | "jq",
24 | "vim",
25 | "markdown",
26 | "markdown_inline",
27 | "git_rebase",
28 | "css",
29 | "ini",
30 | "rasi",
31 | "html",
32 | "scss",
33 | "toml",
34 | "http",
35 | "diff",
36 | "json",
37 | "yaml",
38 | "java",
39 | "json",
40 | "bash",
41 | "query",
42 | },
43 | auto_install = true,
44 | ignore_install = { "comment" },
45 | parser_install_dir = vim.fn.stdpath("data") .. "/parsers",
46 | highlight = {
47 | enable = true,
48 | disable = { "latex" },
49 | use_languagetree = true,
50 | additional_vim_regex_highlighting = true,
51 | },
52 | indent = {
53 | enable = true,
54 | disable = { "latex" },
55 | },
56 | incremental_selection = { enable = true },
57 | playground = {
58 | enable = true,
59 | updatetime = 25,
60 | persist_queries = true,
61 | keybindings = {
62 | toggle_query_editor = "o",
63 | toggle_hl_groups = "i",
64 | toggle_injected_languages = "t",
65 | toggle_anonymous_nodes = "a",
66 | toggle_language_display = "I",
67 | focus_language = "f",
68 | unfocus_language = "F",
69 | update = "R",
70 | goto_node = "",
71 | show_help = "?",
72 | },
73 | },
74 | autotag = {
75 | enable = true,
76 | },
77 | textobjects = {
78 | select = {
79 | enable = true,
80 | lookahead = true,
81 | keymaps = {
82 | ["af"] = "@function.outer",
83 | ["if"] = "@function.inner",
84 | ["ac"] = "@class.outer",
85 | ["ic"] = "@class.inner",
86 | },
87 | },
88 | swap = {
89 | enable = true,
90 | swap_next = { ["sn"] = "@parameter.inner" },
91 | swap_previous = { ["sp"] = "@parameter.inner" },
92 | },
93 | move = {
94 | enable = true,
95 | set_jumps = true,
96 | goto_next_start = {
97 | ["]m"] = "@function.outer",
98 | ["]]"] = "@class.outer",
99 | },
100 | goto_next_end = {
101 | ["]M"] = "@function.outer",
102 | ["]["] = "@class.outer",
103 | },
104 | goto_previous_start = {
105 | ["[m"] = "@function.outer",
106 | ["[["] = "@class.outer",
107 | },
108 | goto_previous_end = {
109 | ["[M"] = "@function.outer",
110 | ["[]"] = "@class.outer",
111 | },
112 | },
113 | lsp_interop = {
114 | enable = true,
115 | border = "solid",
116 | peek_definition_code = {
117 | [";df"] = "@function.outer",
118 | [";dF"] = "@class.outer",
119 | },
120 | },
121 | },
122 | matchup = {
123 | enable = true,
124 | disable = {
125 | "ruby",
126 | },
127 | },
128 | querylinter = {
129 | enable = true,
130 | use_virtual_text = true,
131 | lint_events = { "BufWrite", "CursorHold" },
132 | },
133 | })
134 |
--------------------------------------------------------------------------------
/lua/plugins/telescope/actions.lua:
--------------------------------------------------------------------------------
1 | local M = {}
2 |
3 | local builtin = require("telescope.builtin")
4 | local actions = require("telescope.actions")
5 | local actions_state = require("telescope.actions.state")
6 |
7 | function M.vertical(prompt_buffer)
8 | local picker = actions_state.get_current_picker(prompt_buffer)
9 | local selections = picker:get_multi_selection()
10 | local entry = actions_state.get_selected_entry()
11 |
12 | actions.close(prompt_buffer)
13 | if #selections < 2 then
14 | vim.cmd.edit(vim.split(entry.value, ":", { plain = true })[1])
15 | else
16 | for _, selection in ipairs(selections) do
17 | vim.cmd.edit(vim.split(selection.value, ":", { plain = true })[1])
18 | end
19 | end
20 | end
21 |
22 | function M.interactive_regex(prompt_buffer)
23 | actions.close(prompt_buffer)
24 | vim.ui.input({ prompt = "glob patterns(comma sep): " }, function(input)
25 | if not input then return end
26 | builtin.find_files({
27 | file_ignore_patterns = vim.split(vim.trim(input), ",", { plain = true }),
28 | })
29 | end)
30 | end
31 |
32 | function M.set_preview_filetype(prompt_buffer)
33 | local current_picker = actions_state.get_current_picker(prompt_buffer)
34 | local previewers = current_picker.all_previewers
35 | local current_previewer_index = current_picker.current_previewer_index
36 | local current_previewer = previewers[current_previewer_index]
37 | local previewer_buffer = current_previewer.state.bufnr
38 | vim.api.nvim_buf_set_option(previewer_buffer, "filetype", "")
39 | end
40 |
41 | -- {
42 | -- bufnr = 1,
43 | -- display = ,
44 | -- filename = "lua/plugins/telescope/config.lua",
45 | -- index = 2,
46 | -- indicator = "#h ",
47 | -- lnum = 220,
48 | -- ordinal = "1 : lua/plugins/telescope/config.lua",
49 | -- value = "lua/plugins/telescope/config.lua",
50 | -- = {
51 | -- __index =
52 | -- }
53 | -- }
54 | function M.delete_buffer(_)
55 | local entry = actions_state.get_selected_entry()
56 | if vim.api.nvim_buf_is_valid(entry.bufnr) then
57 | vim.api.nvim_buf_delete(entry.bufnr, { force = true })
58 | if vim.api.nvim_buf_is_valid(entry.bufnr) then
59 | vim.cmd.bdelete(entry.filename)
60 | end
61 | end
62 | end
63 |
64 | return require("telescope.actions.mt").transform_mod(M)
65 |
--------------------------------------------------------------------------------
/lua/plugins/telescope/config.lua:
--------------------------------------------------------------------------------
1 | local ok, telescope = pcall(require, "telescope")
2 | if not ok then return end
3 |
4 | local actions_custom = require("plugins.telescope.actions")
5 | local actions = require("telescope.actions")
6 | local layout = require("telescope.actions.layout")
7 |
8 | local ignore_files = {
9 | "steam",
10 | ".git",
11 | "node_modules",
12 | "venv",
13 | ".venv",
14 | "dosdevices",
15 | "drive_c",
16 | "compatdata",
17 | "cargo",
18 | ".conan",
19 | "gem",
20 | "Brave",
21 | ".paradox-launcher",
22 | ".cache",
23 | "Trash",
24 | "unity3d",
25 | "Paradox Interactive",
26 | "autostart",
27 | "pulse",
28 | "droidcam",
29 | "swap",
30 | "kdeconnect",
31 | "OpenTabletDriver",
32 | ".icons",
33 | "downloads",
34 | "secret",
35 | ".librewolf",
36 | "kernel",
37 | "dic",
38 | "vivaldi",
39 | "krita",
40 | "mime",
41 | "chromium",
42 | "inkscape",
43 | "syncthing",
44 | "xournalpp",
45 | ".ssh",
46 | "feh",
47 | "discord",
48 | "BetterDiscord",
49 | "lutris",
50 | "secrets",
51 | ".var",
52 | "pictures",
53 | "easyeffects",
54 | ".android",
55 | ".cmake",
56 | ".dotnet",
57 | ".nuget",
58 | ".vnc",
59 | ".themes",
60 | }
61 |
62 | telescope.setup({
63 | dynamic_preview_title = true,
64 | pickers = {
65 | command_history = {
66 | prompt_prefix = " ",
67 | },
68 | symbols = {
69 | prompt_prefix = " ",
70 | },
71 | buffers = {
72 | sort_lastused = true,
73 | prompt_prefix = " ",
74 | previewer = false,
75 | layout_config = {
76 | width = 0.3,
77 | height = 0.4,
78 | },
79 | mappings = {
80 | ["i"] = {
81 | [""] = actions.preview_scrolling_up,
82 | [""] = actions.preview_scrolling_down,
83 | [""] = actions_custom.delete_buffer + actions.move_to_top,
84 | },
85 | ["n"] = {
86 | ["v"] = actions_custom.vertical,
87 | ["dd"] = actions_custom.delete_buffer + actions.move_to_top,
88 | },
89 | },
90 | },
91 | find_files = {
92 | no_ignore = true,
93 | hidden = true,
94 | prompt_prefix = " ",
95 | mappings = {
96 | ["i"] = {
97 | [""] = actions.preview_scrolling_up,
98 | [""] = actions.preview_scrolling_down,
99 | [""] = actions_custom.interactive_regex,
100 | },
101 | ["n"] = {
102 | ["v"] = actions_custom.vertical,
103 | ["p"] = layout.toggle_preview,
104 | },
105 | },
106 | },
107 | oldfiles = {
108 | prompt_prefix = " ",
109 | },
110 | colorscheme = {
111 | prompt_prefix = " ",
112 | },
113 | highlights = {
114 | prompt_prefix = " ",
115 | },
116 | live_grep = {
117 | prompt_prefix = " ",
118 | mappings = {
119 | ["i"] = {
120 | [""] = actions.preview_scrolling_up,
121 | [""] = actions.preview_scrolling_down,
122 | [""] = actions_custom.set_preview_filetype,
123 | },
124 | ["n"] = {
125 | ["v"] = actions_custom.vertical,
126 | ["p"] = layout.toggle_preview,
127 | },
128 | },
129 | },
130 | git_commits = {
131 | prompt_prefix = " ",
132 | },
133 | git_bcommits = {
134 | prompt_prefix = " ",
135 | },
136 | git_branches = {
137 | prompt_prefix = " שׂ ",
138 | },
139 | git_status = {
140 | prompt_prefix = " ",
141 | git_icons = {
142 | added = "+",
143 | changed = "~",
144 | copied = ">",
145 | deleted = "-",
146 | renamed = "➡",
147 | unmerged = "‡",
148 | untracked = "?",
149 | },
150 | },
151 | git_files = {
152 | prompt_prefix = " שׂ ",
153 | },
154 | commands = {
155 | prompt_prefix = " ",
156 | },
157 | registers = {
158 | prompt_prefix = " ",
159 | initial_mode = "normal",
160 | theme = "cursor",
161 | borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
162 | layout_config = {
163 | preview_cutoff = 1,
164 | width = function(_, max_col, _) return math.min(max_col, 70) end,
165 | height = function(_, _, max_line) return math.min(max_line, 15) end,
166 | },
167 | },
168 | spell_suggests = {
169 | prompt_prefix = " ",
170 | },
171 | keymaps = {
172 | prompt_prefix = " ",
173 | },
174 | lsp_code_actions = {
175 | prompt_prefix = " ",
176 | theme = "cursor",
177 | },
178 | lsp_references = {
179 | prompt_prefix = " ",
180 | },
181 | lsp_implementations = {
182 | prompt_prefix = " ",
183 | },
184 | lsp_document_diagnostics = {
185 | prompt_prefix = " ",
186 | },
187 | },
188 | defaults = {
189 | file_ignore_patterns = ignore_files,
190 | prompt_prefix = " ",
191 | selection_caret = " | ",
192 | entry_prefix = " ",
193 | initial_mode = "insert",
194 | layout_config = {
195 | horizontal = {
196 | prompt_position = "bottom",
197 | preview_width = 0.6,
198 | results_width = 0.7,
199 | },
200 | vertical = { mirror = true },
201 | width = 0.9,
202 | height = 0.9,
203 | preview_cutoff = 120,
204 | },
205 | winblend = 0,
206 | border = {},
207 | borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
208 | set_env = { ["COLORTERM"] = "truecolor" },
209 | },
210 | extensions = {
211 | media = {
212 | prompt_prefix = " ",
213 | backend = "ueberzug",
214 | flags = {
215 | chafa = {
216 | move = true,
217 | },
218 | },
219 | },
220 | ["ui-select"] = {
221 | require("telescope.themes").get_dropdown({
222 | layout_strategy = "cursor",
223 | borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
224 | }),
225 | }
226 | },
227 | })
228 |
229 | require("telescope").load_extension("fzf")
230 | require("telescope").load_extension("media")
231 | require("telescope").load_extension("track")
232 | require("telescope").load_extension("ui-select")
233 | require("telescope").load_extension("kao")
234 | require("telescope").load_extension("gradle")
235 |
--------------------------------------------------------------------------------
/lua/plugins/telescope/init.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "nvim-telescope/telescope.nvim",
4 | dependencies = "nvim-telescope/telescope-symbols.nvim",
5 | config = function()
6 | require("plugins.telescope.config")
7 | end,
8 | cmd = "Telescope",
9 | },
10 | {
11 | "dharmx/track.nvim",
12 | opts = {
13 | pad = {
14 | config = { title_pos = "center" },
15 | serial_map = true,
16 | disable_devicons = false,
17 | disable_status = false,
18 | },
19 | pickers = {
20 | bundles = {
21 | disable_devicons = false,
22 | serial_map = true,
23 | },
24 | views = {
25 | disable_devicons = false,
26 | serial_map = true,
27 | },
28 | },
29 | },
30 | cmd = {
31 | "Track",
32 | "Mark",
33 | "Unmark",
34 | "MarkOpened",
35 | },
36 | dev = true,
37 | },
38 | {
39 | "nvim-telescope/telescope-fzf-native.nvim",
40 | build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build"
41 | },
42 | { "dharmx/telescope-media.nvim", dev = true },
43 | "nvim-telescope/telescope-ui-select.nvim",
44 | "nvim-telescope/telescope-symbols.nvim",
45 | "nvim-telescope/telescope-dap.nvim",
46 | }
47 |
--------------------------------------------------------------------------------
/lua/plugins/ui/bufferline.lua:
--------------------------------------------------------------------------------
1 | local ok, bufferline = pcall(require, "bufferline")
2 | if not ok then return end
3 |
4 | bufferline.setup({
5 | options = {
6 | offsets = {
7 | {
8 | filetype = "undotree",
9 | text = "",
10 | padding = 0,
11 | },
12 | },
13 | mode = "buffers",
14 | numbers = "none",
15 | close_command = "bdelete! %d",
16 | right_mouse_command = "bdelete! %d",
17 | left_mouse_command = "buffer %d",
18 | middle_mouse_command = "bdelete! %d",
19 | indicator = { style = "none" },
20 | buffer_close_icon = "",
21 | modified_icon = "",
22 | close_icon = "X",
23 | left_trunc_marker = "",
24 | right_trunc_marker = "",
25 | max_name_length = 14,
26 | max_prefix_length = 15,
27 | truncate_names = true,
28 | tab_size = 15,
29 | diagnostics = false,
30 | show_buffer_icons = false,
31 | show_buffer_close_icons = true,
32 | show_close_icon = true,
33 | show_tab_indicators = true,
34 | show_duplicate_prefix = true,
35 | persist_buffer_sort = true,
36 | separator_style = "none",
37 | enforce_regular_tabs = true,
38 | always_show_bufferline = true,
39 | },
40 | })
41 |
--------------------------------------------------------------------------------
/lua/plugins/ui/feline.lua:
--------------------------------------------------------------------------------
1 | local ok, feline = pcall(require, "feline")
2 | if not ok then return end
3 |
4 | local theme = {
5 | aqua = "#7AB0DF",
6 | bg = "#1C212A",
7 | blue = "#5FB0FC",
8 | cyan = "#70C0BA",
9 | darkred = "#FB7373",
10 | fg = "#C7C7CA",
11 | gray = "#222730",
12 | green = "#79DCAA",
13 | lime = "#54CED6",
14 | orange = "#FFD064",
15 | pink = "#D997C8",
16 | purple = "#C397D8",
17 | red = "#F87070",
18 | yellow = "#FFE59E"
19 | }
20 |
21 | local mode_theme = {
22 | ["NORMAL"] = theme.green,
23 | ["OP"] = theme.cyan,
24 | ["INSERT"] = theme.aqua,
25 | ["VISUAL"] = theme.yellow,
26 | ["LINES"] = theme.darkred,
27 | ["BLOCK"] = theme.orange,
28 | ["REPLACE"] = theme.purple,
29 | ["V-REPLACE"] = theme.pink,
30 | ["ENTER"] = theme.pink,
31 | ["MORE"] = theme.pink,
32 | ["SELECT"] = theme.darkred,
33 | ["SHELL"] = theme.cyan,
34 | ["TERM"] = theme.lime,
35 | ["NONE"] = theme.gray,
36 | ["COMMAND"] = theme.blue,
37 | }
38 |
39 | local modes = setmetatable({
40 | ["n"] = "N",
41 | ["no"] = "N",
42 | ["v"] = "V",
43 | ["V"] = "VL",
44 | [""] = "VB",
45 | ["s"] = "S",
46 | ["S"] = "SL",
47 | [""] = "SB",
48 | ["i"] = "I",
49 | ["ic"] = "I",
50 | ["R"] = "R",
51 | ["Rv"] = "VR",
52 | ["c"] = "C",
53 | ["cv"] = "EX",
54 | ["ce"] = "X",
55 | ["r"] = "P",
56 | ["rm"] = "M",
57 | ["r?"] = "C",
58 | ["!"] = "SH",
59 | ["t"] = "T",
60 | }, { __index = function() return "-" end })
61 |
62 | local component = {}
63 |
64 | component.vim_mode = {
65 | provider = function() return modes[vim.api.nvim_get_mode().mode] end,
66 | hl = function()
67 | return {
68 | fg = "bg",
69 | bg = require("feline.providers.vi_mode").get_mode_color(),
70 | style = "bold",
71 | name = "NeovimModeHLColor",
72 | }
73 | end,
74 | left_sep = "block",
75 | right_sep = "block",
76 | }
77 |
78 | component.git_branch = {
79 | provider = "git_branch",
80 | hl = {
81 | fg = "fg",
82 | bg = "bg",
83 | style = "bold",
84 | },
85 | left_sep = "block",
86 | right_sep = "",
87 | }
88 |
89 | component.git_add = {
90 | provider = "git_diff_added",
91 | hl = {
92 | fg = "green",
93 | bg = "bg",
94 | },
95 | left_sep = "",
96 | right_sep = "",
97 | }
98 |
99 | component.git_delete = {
100 | provider = "git_diff_removed",
101 | hl = {
102 | fg = "red",
103 | bg = "bg",
104 | },
105 | left_sep = "",
106 | right_sep = "",
107 | }
108 |
109 | component.git_change = {
110 | provider = "git_diff_changed",
111 | hl = {
112 | fg = "purple",
113 | bg = "bg",
114 | },
115 | left_sep = "",
116 | right_sep = "",
117 | }
118 |
119 | component.separator = {
120 | provider = "",
121 | hl = {
122 | fg = "bg",
123 | bg = "bg",
124 | },
125 | }
126 |
127 | component.diagnostic_errors = {
128 | provider = "diagnostic_errors",
129 | hl = {
130 | fg = "red",
131 | },
132 | }
133 |
134 | component.diagnostic_warnings = {
135 | provider = "diagnostic_warnings",
136 | hl = {
137 | fg = "yellow",
138 | },
139 | }
140 |
141 | component.diagnostic_hints = {
142 | provider = "diagnostic_hints",
143 | hl = {
144 | fg = "aqua",
145 | },
146 | }
147 |
148 | component.diagnostic_info = {
149 | provider = "diagnostic_info",
150 | }
151 |
152 | component.lsp = {
153 | provider = function()
154 | if not rawget(vim, "lsp") then
155 | return ""
156 | end
157 |
158 | local indexing = vim.lsp.status() ~= ""
159 | if vim.o.columns < 120 then
160 | return ""
161 | end
162 |
163 | local clients = vim.lsp.get_clients({ bufnr = 0 })
164 | if #clients ~= 0 then
165 | if indexing then
166 | local spinners = {
167 | "◜ ",
168 | "◠ ",
169 | "◝ ",
170 | "◞ ",
171 | "◡ ",
172 | "◟ ",
173 | }
174 | local ms = vim.loop.hrtime() / 1000000
175 | local frame = math.floor(ms / 120) % #spinners
176 | local content = string.format("%%<%s", spinners[frame + 1])
177 | return content or ""
178 | else
179 | return "לּ LSP"
180 | end
181 | end
182 | return ""
183 | end,
184 | hl = function()
185 | local indexing = vim.lsp.status() ~= ""
186 | return {
187 | fg = indexing and "yellow" or "green",
188 | bg = "gray",
189 | style = "bold",
190 | }
191 | end,
192 | left_sep = "",
193 | right_sep = "block",
194 | }
195 |
196 | component.file_type = {
197 | provider = {
198 | name = "file_type",
199 | opts = {
200 | filetype_icon = true,
201 | },
202 | },
203 | hl = {
204 | fg = "fg",
205 | bg = "gray",
206 | },
207 | left_sep = "block",
208 | right_sep = "block",
209 | }
210 |
211 | component.scroll_bar = {
212 | provider = function()
213 | local chars = setmetatable({
214 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
215 | " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
216 | }, { __index = function() return " " end })
217 | local line_ratio = vim.api.nvim_win_get_cursor(0)[1] / vim.api.nvim_buf_line_count(0)
218 | local position = math.floor(line_ratio * 100)
219 |
220 | local icon = chars[math.floor(line_ratio * #chars)] .. position
221 | if position <= 5 then
222 | icon = " TOP"
223 | elseif position >= 95 then
224 | icon = " BOT"
225 | end
226 | return icon
227 | end,
228 | hl = function()
229 | local position = math.floor(vim.api.nvim_win_get_cursor(0)[1] / vim.api.nvim_buf_line_count(0) * 100)
230 | local fg
231 | local style
232 |
233 | if position <= 5 then
234 | fg = "aqua"
235 | style = "bold"
236 | elseif position >= 95 then
237 | fg = "red"
238 | style = "bold"
239 | else
240 | fg = "purple"
241 | style = nil
242 | end
243 | return {
244 | fg = fg,
245 | style = style,
246 | bg = "bg",
247 | }
248 | end,
249 | left_sep = "block",
250 | right_sep = "block",
251 | }
252 |
253 | vim.api.nvim_set_hl(0, "StatusLine", { bg = "#101317", fg = "#7AB0DF" })
254 | feline.setup({
255 | components = {
256 | active = {
257 | {}, -- left
258 | {}, -- middle
259 | { -- right
260 | component.vim_mode,
261 | component.file_type,
262 | component.lsp,
263 | component.git_branch,
264 | component.git_add,
265 | component.git_delete,
266 | component.git_change,
267 | component.separator,
268 | component.diagnostic_errors,
269 | component.diagnostic_warnings,
270 | component.diagnostic_info,
271 | component.diagnostic_hints,
272 | component.scroll_bar,
273 | },
274 | },
275 | },
276 | theme = theme,
277 | vi_mode_colors = mode_theme,
278 | })
279 |
--------------------------------------------------------------------------------
/lua/plugins/ui/indents.lua:
--------------------------------------------------------------------------------
1 | local ok, ibl = pcall(require, "ibl")
2 | if not ok then return end
3 |
4 | ibl.setup({
5 | indent = {
6 | char = "│",
7 | },
8 | scope = {
9 | char = "┋",
10 | highlight = "IndentBlanklineContextChar",
11 | },
12 | whitespace = {
13 | remove_blankline_trail = true,
14 | },
15 | exclude = {
16 | buftypes = {
17 | "terminal",
18 | "nofile",
19 | },
20 | filetypes = {
21 | "TelescopeResults",
22 | "query",
23 | "tsplayground",
24 | "lazy",
25 | "lsp-installer",
26 | "markdown",
27 | "mason",
28 | "txt",
29 | "text",
30 | "dashboard",
31 | "alpha",
32 | "NvimTree",
33 | "undotree",
34 | "diff",
35 | "fugitive",
36 | "fugitiveblame",
37 | "Outline",
38 | "SidebarNvim",
39 | "packer",
40 | "lsp-installer",
41 | "TelescopePrompt",
42 | "help",
43 | "telescope",
44 | "lspinfo",
45 | "Trouble",
46 | "null-ls-info",
47 | "quickfix",
48 | "chadtree",
49 | "fzf",
50 | "NeogitStatus",
51 | "terminal",
52 | "console",
53 | "term://*",
54 | "Term://*",
55 | "toggleterm",
56 | "qf",
57 | "prompt",
58 | "noice",
59 | "",
60 | }
61 | },
62 | })
63 |
64 | local hooks = require("ibl.hooks")
65 | hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
66 |
--------------------------------------------------------------------------------
/lua/plugins/ui/init.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "NvChad/nvim-colorizer.lua",
4 | config = true,
5 | event = { "CursorMoved", "CursorHold", "InsertEnter" },
6 | },
7 | {
8 | "lukas-reineke/indent-blankline.nvim",
9 | config = function()
10 | require("plugins.ui.indents")
11 | end,
12 | event = { "CursorMoved", "CursorHold", "InsertEnter" },
13 | },
14 | {
15 | "akinsho/bufferline.nvim",
16 | dependencies = "nvim-tree/nvim-web-devicons",
17 | config = function()
18 | require("plugins.ui.bufferline")
19 | end,
20 | event = { "CursorMoved", "CursorHold", "InsertEnter", "CmdlineEnter" },
21 | },
22 | {
23 | "freddiehaddad/feline.nvim",
24 | event = { "CursorMoved", "CursorHold", "InsertEnter", "CmdlineEnter" },
25 | config = function()
26 | require("plugins.ui.feline")
27 | end,
28 | },
29 | {
30 | "folke/todo-comments.nvim",
31 | config = function()
32 | require("plugins.ui.todo")
33 | end,
34 | event = { "CursorMoved", "CursorHold", "InsertEnter", "CmdlineEnter" },
35 | },
36 | {
37 | "kevinhwang91/nvim-hlslens",
38 | config = true,
39 | event = "CmdlineEnter",
40 | keys = { "n", "N", "/" },
41 | },
42 | {
43 | "petertriho/nvim-scrollbar",
44 | event = { "InsertEnter", "CursorMoved" },
45 | config = function()
46 | require("plugins.ui.scroll")
47 | end,
48 | },
49 | {
50 | "nvim-tree/nvim-web-devicons",
51 | opts = {
52 | override = {
53 | yue = {
54 | icon = "",
55 | color = "#B7AE8F",
56 | cterm_color = "65",
57 | name = "Yue"
58 | },
59 | },
60 | },
61 | },
62 | {
63 | "rcarriga/nvim-notify",
64 | opts = {
65 | stages = "fade_in_slide_out",
66 | on_open = nil,
67 | on_close = nil,
68 | render = "default",
69 | timeout = 3500,
70 | max_width = 150,
71 | max_height = 25,
72 | background_colour = "TabLine",
73 | minimum_width = 50,
74 | icons = {
75 | ERROR = "",
76 | WARN = "",
77 | INFO = "",
78 | DEBUG = "",
79 | TRACE = "",
80 | },
81 | },
82 | config = function(_, opts)
83 | local notify = require("notify")
84 | notify.setup(opts)
85 | vim.notify = notify
86 | vim.notify_once = notify
87 | end,
88 | enabled = false,
89 | event = { "CursorMoved", "CursorHold", "InsertEnter", "CmdlineEnter" },
90 | },
91 | }
92 |
--------------------------------------------------------------------------------
/lua/plugins/ui/scroll.lua:
--------------------------------------------------------------------------------
1 | local ok, scrollbar = pcall(require, "scrollbar")
2 | if not ok then return end
3 |
4 | scrollbar.setup({
5 | show = true,
6 | show_in_active_only = false,
7 | set_highlights = false,
8 | folds = 1000,
9 | max_lines = false,
10 | handle = {
11 | text = " ",
12 | hide_if_all_visible = true,
13 | },
14 | marks = {
15 | Search = {
16 | text = { "-", "=" },
17 | priority = 0,
18 | },
19 | Error = {
20 | text = { "-", "=" },
21 | priority = 1,
22 | },
23 | Warn = {
24 | text = { "-", "=" },
25 | priority = 2,
26 | },
27 | Info = {
28 | text = { "-", "=" },
29 | priority = 3,
30 | },
31 | Hint = {
32 | text = { "-", "=" },
33 | priority = 4,
34 | },
35 | Misc = {
36 | text = { "-", "=" },
37 | priority = 5,
38 | },
39 | GitAdd = {
40 | text = "▁",
41 | priority = 5,
42 | },
43 | GitChange = {
44 | text = "▁",
45 | priority = 5,
46 | },
47 | GitDelete = {
48 | text = "▁",
49 | priority = 5,
50 | },
51 | },
52 | excluded_buftypes = {
53 | "TelescopeResults",
54 | "query",
55 | "tsplayground",
56 | "lazy",
57 | "lsp-installer",
58 | "markdown",
59 | "mason",
60 | "txt",
61 | "dashboard",
62 | "alpha",
63 | "NvimTree",
64 | "undotree",
65 | "diff",
66 | "fugitive",
67 | "fugitiveblame",
68 | "Outline",
69 | "SidebarNvim",
70 | "packer",
71 | "lsp-installer",
72 | "TelescopePrompt",
73 | "help",
74 | "telescope",
75 | "lspinfo",
76 | "Trouble",
77 | "null-ls-info",
78 | "quickfix",
79 | "chadtree",
80 | "fzf",
81 | "NeogitStatus",
82 | "terminal",
83 | "console",
84 | "term://*",
85 | "Term://*",
86 | "toggleterm",
87 | "qf",
88 | "prompt",
89 | "noice",
90 | "",
91 | },
92 | excluded_filetypes = {
93 | "terminal",
94 | "nofile",
95 | },
96 | autocmd = {
97 | render = {
98 | "BufWinEnter",
99 | "TabEnter",
100 | "TermEnter",
101 | "WinEnter",
102 | "CmdwinLeave",
103 | "TextChanged",
104 | "VimResized",
105 | "WinScrolled",
106 | },
107 | clear = {
108 | "BufWinLeave",
109 | "TabLeave",
110 | "TermLeave",
111 | "WinLeave",
112 | },
113 | },
114 | handlers = {
115 | diagnostic = true,
116 | search = true,
117 | gitsigns = true,
118 | },
119 | })
120 |
--------------------------------------------------------------------------------
/lua/plugins/ui/todo.lua:
--------------------------------------------------------------------------------
1 | local ok, todo = pcall(require, "todo-comments")
2 | if not ok then return end
3 |
4 | todo.setup({
5 | signs = true,
6 | sign_priority = 8,
7 | keywords = {
8 | FIX = { icon = " ", alt = { "FIXME", "FIXIT", "ISSUE" } },
9 | BUG = { icon = " " },
10 | TODO = { icon = " " },
11 | WANTS = { icon = " ", alt = { "REQ", "DEPENDS" } },
12 | HACK = { icon = " " },
13 | CHORE = { icon = " " },
14 | CLEAN = { icon = " ", alt = { "ORGANISE", "ORGANIZE", "CLEANED" } },
15 | WARN = { icon = " ", alt = { "WARNING", "XXX" } },
16 | PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
17 | NOTE = { icon = " ", alt = { "INFO", "DEBUG" } },
18 | UPDATE = { icon = " ", alt = { "MIGRATE" } },
19 | DEMO = { icon = " ", alt = { "SHOW" } },
20 | IMPROVE = { icon = " ", alt = { "REFINE", "ENHANCE" } },
21 | TEST = { icon = "ﭧ", alt = { "MOCK", "UNITTEST", "UNIT" } },
22 | },
23 | merge_keywords = true,
24 | highlight = {
25 | before = "",
26 | keyword = "wide",
27 | after = "fg",
28 | pattern = [[.*<(KEYWORDS)\s*:]],
29 | comments_only = true,
30 | max_line_len = 2500,
31 | exclude = {
32 | "TelescopeResults",
33 | "query",
34 | "tsplayground",
35 | "lazy",
36 | "lsp-installer",
37 | "markdown",
38 | "mason",
39 | "txt",
40 | "dashboard",
41 | "alpha",
42 | "NvimTree",
43 | "undotree",
44 | "diff",
45 | "fugitive",
46 | "fugitiveblame",
47 | "Outline",
48 | "SidebarNvim",
49 | "packer",
50 | "lsp-installer",
51 | "TelescopePrompt",
52 | "help",
53 | "telescope",
54 | "lspinfo",
55 | "Trouble",
56 | "null-ls-info",
57 | "quickfix",
58 | "chadtree",
59 | "fzf",
60 | "NeogitStatus",
61 | "terminal",
62 | "console",
63 | "term://*",
64 | "Term://*",
65 | "toggleterm",
66 | "qf",
67 | "prompt",
68 | "noice",
69 | "",
70 | },
71 | },
72 | search = {
73 | command = "rg",
74 | args = {
75 | "--color=never",
76 | "--no-heading",
77 | "--with-filename",
78 | "--line-number",
79 | "--column",
80 | },
81 | pattern = [[\b(KEYWORDS):]],
82 | },
83 | })
84 |
--------------------------------------------------------------------------------
/lua/scratch/close.lua:
--------------------------------------------------------------------------------
1 | local Menu = require("nui.menu")
2 | local NuiText = require("nui.text")
3 |
4 | local popup_options = {
5 | size = { width = 20, height = 4 },
6 | position = {
7 | row = "50%",
8 | col = "50%",
9 | },
10 | border = {
11 | style = {
12 | top_left = NuiText(" ", "NUINormal"),
13 | top = NuiText(" ", "NUINormal"),
14 | top_right = NuiText(" ", "NUINormal"),
15 | left = NuiText(" ", "NUINormal"),
16 | right = NuiText(" ", "NUINormal"),
17 | bottom_left = NuiText(" ", "NUINormal"),
18 | bottom = NuiText(" ", "NUINormal"),
19 | bottom_right = NuiText(" ", "NUINormal"),
20 | },
21 | text = {
22 | top = NuiText("", "NUIHeading"),
23 | top_align = "center",
24 | },
25 | },
26 | win_options = {
27 | winblend = 0,
28 | winhighlight = "NUIText:NUIText",
29 | },
30 | }
31 |
32 | local menu_options = {
33 | lines = {
34 | Menu.separator(NuiText(" Save? ", "NUIHeading"), { char = "─", text_align = "center" }),
35 | Menu.item(NuiText(" Yes ", "NUIYes")),
36 | Menu.item(NuiText(" No ", "NUINo")),
37 | Menu.item(NuiText(" Cancel ", "NUICancel")),
38 | },
39 | keymap = {
40 | focus_next = { "j", "", "" },
41 | focus_prev = { "k", "", "" },
42 | close = { "", "" },
43 | submit = { "", "" },
44 | },
45 | }
46 |
47 | local function force_quit(item)
48 | local result = vim.trim(item.text._content)
49 | if result == "Yes" then
50 | vim.cmd("wqall!")
51 | elseif result == "No" then
52 | vim.cmd("quitall!")
53 | elseif result == "Cancel" then
54 | vim.api.nvim_notify("Cancelled.", vim.log.levels.INFO, {
55 | title = "bufclose.lua",
56 | icon = " ",
57 | })
58 | else
59 | error("Invalid option!", vim.log.levels.ERROR)
60 | end
61 | end
62 |
63 | local function normal_quit(item)
64 | local result = vim.trim(item.text._content)
65 | if result == "Yes" then
66 | vim.cmd.write()
67 | vim.cmd.bdelete()
68 | elseif result == "No" then
69 | vim.cmd("bdelete!")
70 | elseif result == "Cancel" then
71 | vim.api.nvim_notify("Cancelled.", vim.log.levels.INFO, {
72 | title = "bufclose.lua",
73 | icon = " ",
74 | })
75 | else
76 | vim.api.nvim_notify("Invalid option!", vim.log.levels.ERROR, {})
77 | end
78 | end
79 |
80 | return function()
81 | local cur_winnr = vim.fn.winnr()
82 | local cur_bufnr = vim.fn.bufnr()
83 | local buflisted = vim.fn.getbufinfo({ buflisted = 1 })
84 |
85 | if #buflisted < 2 then
86 | if not vim.bo.modified then
87 | vim.cmd("quitall!")
88 | return
89 | end
90 | menu_options.on_submit = force_quit
91 | Menu(popup_options, menu_options):mount()
92 | return
93 | end
94 |
95 | ---@diagnostic disable-next-line: param-type-mismatch
96 | for _, winid in ipairs(vim.fn.getbufinfo(cur_bufnr)[1].windows) do
97 | if vim.bo.modified then
98 | menu_options.on_submit = normal_quit
99 | Menu(popup_options, menu_options):mount()
100 | else
101 | vim.cmd(("%d wincmd w"):format(vim.fn.win_id2win(winid)))
102 | vim.cmd(cur_bufnr == buflisted[#buflisted].bufnr and "bp" or "bn")
103 | vim.cmd(("%d wincmd w"):format(cur_winnr))
104 | local is_terminal = vim.fn.getbufvar(cur_bufnr, "&buftype") == "terminal"
105 | vim.cmd(is_terminal and "bd! #" or "silent! confirm bd #")
106 | end
107 | end
108 | end
109 |
--------------------------------------------------------------------------------
/lua/scratch/ethos.lua:
--------------------------------------------------------------------------------
1 | ---@diagnostic disable: cast-local-type, param-type-mismatch, assign-type-mismatch, need-check-nil, undefined-field
2 |
3 | -- TODO:
4 | -- + Add UI, HL and mapping options.
5 | -- + Cleanup buffers.
6 | -- + Use namespaces and add_highlights.
7 | -- + Calculate floating window width.
8 | -- + Add a telescope extension.
9 | -- + Variable name suggestor.
10 | -- + Write docs.
11 |
12 | local M = {}
13 |
14 | local _PROXY = {}
15 |
16 | local J = require("plenary.job")
17 | local F = vim.fn
18 | local A = vim.api
19 |
20 | -- NOTE:
21 | -- DICTD allows multiple results from different databases but currently
22 | -- I have no idea on how to support that. How do I parse those multiple matches?
23 |
24 | -- Internals {{{
25 | ---The active database.
26 | ---@type string
27 | M._database = nil
28 | ---List of minimal floating buffers. This is used for storing the IDs of
29 | ---opened minimal word-definition buffers.
30 | ---@type number[]
31 | M._buffers = {}
32 | ---List of minimal floating windows. This is used for storing the IDs of
33 | ---opened minimal word-definition windows.
34 | ---@type integer[]
35 | M._windows = {}
36 |
37 | ---@class EthosConfig
38 | ---@field database string Try using `dict -D` for all available values.
39 |
40 | ---The table of all supported settings for ethos.lua. This should be
41 | ---treated as the fallback or, the default config.
42 | ---@type EthosConfig
43 | M._defaults = { database = "wn" }
44 | ---The current config. Values are extended with `M._defaults` and any
45 | ---invalid value will result in an error.
46 | ---@type EthosConfig
47 | M._config = M._defaults
48 | ---Searching algorithms. Consult the manpage for more.
49 | ---@see https://www.mankier.com/8/dictd#Search_Algorithms
50 | ---@enum DictStrats
51 | M._strategy = {
52 | "exact",
53 | "prefix",
54 | "nprefix",
55 | "substring",
56 | "suffix",
57 | "re",
58 | "regexp",
59 | "soundex",
60 | "lev",
61 | "word",
62 | "first",
63 | "last",
64 | }
65 | -- }}}
66 |
67 | -- Validators {{{
68 | ---Validating functions that can be used for checking the validity of a configuration option value.
69 | ---@type function[]
70 | local validators = {}
71 |
72 | ---@param value? {timeout?: number, wait_interval?: number}
73 | ---@return boolean
74 | ---@see Job.sync
75 | function validators.sync(value)
76 | if value == nil then return true end
77 | if type(value) == "boolean" then return true end
78 | if type(value.timeout) == "number" and type(value.wait_interval) == "nil" then return true end
79 | if type(value.timeout) == "nil" and type(value.wait_interval) == "number" then return true end
80 | if type(value.timeout) == "number" and type(value.wait_interval) == "number" then return true end
81 | return false
82 | end
83 |
84 | ---@param value? string
85 | ---@return boolean
86 | function validators.word(value)
87 | if value == nil then return false end
88 | return not not value:match("^[a-zA-Z]+$") -- only qualify string with alpha values as word
89 | end
90 |
91 | ---@param value? string
92 | ---@return boolean
93 | function validators.database(value)
94 | if value == nil then return false end
95 | return vim.tbl_contains(M._database, value)
96 | end
97 |
98 | ---@param value DictStrats
99 | ---@return boolean
100 | function validators.strategy(value)
101 | if value == nil then return true end
102 | return vim.tbl_contains(M._strategy, value)
103 | end
104 | -- }}}
105 |
106 | ---@class DictConfig
107 | ---@field database string
108 | ---@field word string
109 | ---@field formatted boolean
110 | ---@field strategy DictStrats
111 | ---@field on_stdout fun(error: string, data: string, self?: Job)
112 | ---@field on_stderr fun(error: string, data: string, self?: Job)
113 | ---@field on_exit fun(self?: Job, code: number, signal: number)
114 | ---@field sync {timeout?: number, wait_interval?: number}|boolean
115 |
116 | ---@async
117 | ---Get word definition.
118 | ---@param word string The word that needs to be queried from the dictd database(s).
119 | ---@param options? DictConfig Dictionary related configurations.
120 | ---@return table|Job|nil
121 | function M.get(word, options)
122 | options = vim.F.if_nil(options, {})
123 | -- This is just option validation. You may skip this.
124 | vim.validate({
125 | database = { options.database, validators.database, "Valid options are: " .. table.concat(M._database, "|") },
126 | strategy = { options.strategy, validators.strategy, "Valid options are: " .. table.concat(M._strategy, "|") },
127 | formatted = { options.formatted, "boolean", true },
128 | on_stdout = { options.on_stdout, "function", true },
129 | on_exit = { options.on_exit, "function", true },
130 | on_stderr = { options.on_stderr, "function", true },
131 | sync = { options.sync, validators.sync, "Either provide a boolean value / {timeout=number,wait_interval=number}" },
132 | word = { word, validators.word, "Only alphabets are allowed!" },
133 | })
134 |
135 | word = word:lower()
136 | local args = {}
137 | if options.database then
138 | table.insert(args, "--database")
139 | table.insert(args, options.database)
140 | end
141 | if options.strategy then
142 | table.insert(args, "--strategy")
143 | table.insert(args, options.strategy)
144 | end
145 |
146 | if options.formatted then table.insert(args, "--formatted") end
147 | if options.nocorrect then table.insert(args, "--nocorrect") end
148 | table.insert(args, word)
149 |
150 | -- maybe allow a way to configure this? I have not thought that far ahead
151 | local task = J:new({
152 | command = "dict",
153 | enabled_recording = true,
154 | skip_validation = true,
155 | args = args,
156 | on_exit = options.on_exit,
157 | on_stderr = options.on_stderr,
158 | on_stdout = options.on_stdout,
159 | })
160 |
161 | if options.sync then -- this is blocking
162 | if type(options.sync) == "table" then return { task:sync(options.timeout, options.wait_interval) } end
163 | return { task:sync() }
164 | end
165 | if options.on_exit or options.on_stderr or options.on_stdout then -- this is async
166 | task:start()
167 | return
168 | end
169 | return task
170 | end
171 |
172 | ---@class DictSpec
173 | ---@field count number
174 | ---@field source string
175 | ---@field word string
176 | ---@field content string[]
177 |
178 | ---The output format of `dict -d wn ethos` is like the following.
179 | ---```bash
180 | ---1 definition found
181 | ---From WordNet (r) 3.1 (2011) [wn]:
182 | ---
183 | ---ethos
184 | --- n 1: (anthropology) the distinctive spirit of a culture or an
185 | --- era; "the Greek ethos"
186 | ---```
187 | ---Note that, the main problem with this is that it wraps manually.
188 | ---This hinders parsing.
189 | ---@param raw_value string[]
190 | ---@return DictSpec
191 | function M.parse(raw_value)
192 | -- WARN: Needs more guards.
193 | local parsed = {}
194 | parsed.count = tonumber(table.remove(raw_value, 1):sub(1, 1))
195 | parsed.source = vim.split(table.remove(raw_value, 2), " ", { plain = true })[2]
196 | parsed.word = vim.trim(table.remove(raw_value, 3))
197 |
198 | parsed.content = {} -- root of all headaches
199 | for _, item in ipairs(raw_value) do
200 | local trimmed = vim.trim(item)
201 | if trimmed ~= "" then table.insert(parsed.content, item) end
202 | end
203 | return parsed
204 | end
205 |
206 | ---Open a minimal floating window and populate it with the word definition(s).
207 | ---@param word? string The word which needs to searched for in the dictd database(s).
208 | ---@param options? DictConfig Optional customization options.
209 | function M.open(word, options)
210 | word = vim.F.if_nil(word, F.expand("")) -- get word under the cursor
211 | if not validators.word(word) then return end
212 | options = vim.F.if_nil(options, {})
213 | options.database = M._config.database -- maybe allow to change on the fly?
214 |
215 | -- this will be passed onto plenary.job.
216 | options.on_exit = vim.schedule_wrap(function(self, code, _)
217 | if code == 0 then
218 | local parsed = M.parse(self:result())
219 | -- TODO: Format and display. Do I need to write a parser? Is there really no other way?
220 | local replacement = parsed.content
221 |
222 | -- allow customizing these.
223 | local buffer = A.nvim_create_buf(false, true)
224 | local window = A.nvim_open_win(buffer, false, {
225 | border = "solid",
226 | external = false,
227 | focusable = true,
228 | height = #replacement,
229 | relative = "cursor",
230 | width = 80,
231 | row = 3,
232 | col = 3,
233 | style = "minimal",
234 | })
235 |
236 | A.nvim_buf_set_lines(buffer, 0, -1, false, replacement)
237 | vim.keymap.set("n", "q", function() A.nvim_win_close(window, true) end, {
238 | buffer = buffer,
239 | desc = "Close dictd window.",
240 | })
241 |
242 | -- record float buffer and window history.
243 | table.insert(M._buffers, buffer)
244 | table.insert(M._windows, window)
245 | end
246 | end)
247 | -- basically get the word definition and run a callback on exit.
248 | M.get(word, options)
249 | end
250 |
251 | ---I did not need to write this. But anyway.
252 | ---Utility function for closing all floating word-definition windows.
253 | function M.close()
254 | for _, window in ipairs(M._windows) do
255 | A.nvim_win_close(window, true)
256 | end
257 | M._windows = {}
258 | end
259 |
260 | ---Initialize the plugin and customize its behaviour.
261 | ---@param options EthosConfig? Optional customization options.
262 | function M.setup(options)
263 | options = vim.F.if_nil(options, {})
264 | ---@see vim.tbl_deep_extend
265 | M._config = vim.tbl_deep_extend("keep", options, M._defaults)
266 |
267 | -- WARN: High risk of UI blockage. Maybe use Job.sync with a timeout?
268 | local db = F.system({ "dict", "--dbs" })
269 | db = vim.split(db, "\n", { plain = true })
270 | table.remove(db, 1)
271 | table.remove(db, #db)
272 |
273 | for index, item in ipairs(db) do
274 | db[index] = vim.split(vim.trim(item), " ", { plain = true })[1]
275 | if db[index] == "" then table.remove(db, index) end
276 | end
277 | if #db > 0 then
278 | M._database = db
279 | else
280 | error("No databases found. See https://github.com/cheusov/dictd.")
281 | end
282 |
283 | -- TODO: Allow customizations.
284 | vim.keymap.set("n", ";f", function()
285 | if #M._windows > 0 then
286 | M.close()
287 | return
288 | end
289 | M.open()
290 | end)
291 | M._loaded = true -- you are only allowed to call setup once.
292 | end
293 |
294 | ---A shorthand for `vim.api.nvim_notify(message, vim.log.levels.WARN, {...})`.
295 | ---@param message string
296 | function M.warn(message) A.nvim_notify(message, vim.log.levels.WARN, { title = "ethos.lua", icon = " " }) end
297 |
298 | -- NOTE: Forbid calling non-existent members and setup twice.
299 | setmetatable(_PROXY, {
300 | __index = function(_, item)
301 | if not M._loaded then
302 | if item == "setup" then return M.setup end
303 | M.warn("You need to run setup() first!")
304 | return function() return false end
305 | end
306 | if vim.tbl_contains(vim.tbl_keys(M), item) then return M[item] end
307 | M.warn(item .. " item does not exist!")
308 | return function() return false end -- should I just call error() instead?
309 | end,
310 | })
311 |
312 | return _PROXY
313 |
--------------------------------------------------------------------------------
/lua/scratch/github.lua:
--------------------------------------------------------------------------------
1 | local M = {}
2 |
3 | local U = vim.loop
4 | local V = vim.fn
5 | local A = vim.api
6 | local wrap = vim.schedule_wrap
7 |
8 | local function create_ranges(file, starting, ending)
9 | local tokens = {}
10 | table.insert(tokens, file)
11 | if starting and ending then
12 | table.insert(tokens, string.format(":%s-%s", starting, ending))
13 | elseif starting and not ending then
14 | table.insert(tokens, string.format(":%s", starting))
15 | elseif not starting and ending then
16 | table.insert(tokens, string.format(":%s", ending))
17 | end
18 | return table.concat(tokens)
19 | end
20 |
21 | local function print_errors(errors)
22 | local store = {}
23 | table.insert(store, "# An ERROR occured.\n")
24 | for _, line in ipairs(errors) do table.insert(store, "- " .. line) end
25 | A.nvim_notify(table.concat(store, "\n"), vim.log.levels.ERROR, {
26 | icon = " ",
27 | title = "permalink.lua",
28 | })
29 | end
30 |
31 | function M.fetch_permalink(file, starting, ending, options)
32 | local Task = require("plenary.job")
33 | options = vim.F.if_nil(options, {})
34 | options.open_brower = vim.F.if_nil(options.open_brower, false)
35 | options.browser = vim.F.if_nil(options.browser, vim.env.BROWSER)
36 |
37 | if options.open_brower then assert(options.browser) end
38 | if not U.fs_realpath(file) then
39 | print_errors({ file .. " does not exist!" })
40 | return
41 | end
42 |
43 | Task:new({
44 | command = "gh",
45 | args = {
46 | "browse",
47 | "--no-browser",
48 | create_ranges(file, starting, ending),
49 | },
50 | on_start = wrap(function()
51 | A.nvim_notify("Fetching permalink. Please wait... ", vim.log.levels.INFO, {
52 | icon = " ",
53 | title = "permalink.lua",
54 | })
55 | end),
56 | on_exit = wrap(function(self, code, _)
57 | local result = self:result()
58 | if code ~= 0 then
59 | print_errors(result)
60 | return
61 | end
62 |
63 | V.setreg("+", result[1])
64 | A.nvim_notify("Copied fetched link into the +register.", vim.log.levels.INFO, {
65 | icon = " ",
66 | title = "permalink.lua",
67 | })
68 | if options.open_browser then
69 | Task:new({
70 | command = options.browser,
71 | args = { result[1] },
72 | detached = true,
73 | on_start = wrap(function()
74 | A.nvim_notify("Opened fetched link in " .. options.browser .. ".", vim.log.levels.INFO, {
75 | icon = " ",
76 | title = "permalink.lua",
77 | })
78 | end),
79 | }):start()
80 | end
81 | end),
82 | }):start()
83 | end
84 |
85 | return M
86 |
--------------------------------------------------------------------------------
/lua/scratch/node.lua:
--------------------------------------------------------------------------------
1 | ---@diagnostic disable: missing-fields
2 | local M = {}
3 |
4 | local T = vim.treesitter
5 | local V = vim.fn
6 | local A = vim.api
7 |
8 | local J = require("plenary.job")
9 | local util = require("nvim-treesitter.ts_utils")
10 |
11 | local presets = {
12 | stdin_comply = function(node, text, ...)
13 | J:new({
14 | ...,
15 | writer = J:new({ "echo", vim.trim(text) }),
16 | on_exit = vim.schedule_wrap(function(self, code)
17 | if code ~= 0 then return end
18 | local start_row, start_col, end_row, end_col = node:range()
19 | local results = self:result()
20 | table.insert(results, 1, "")
21 | table.insert(results, "")
22 | A.nvim_buf_set_text(0, start_row, start_col, end_row, end_col, results)
23 | end)
24 | }):start()
25 | end,
26 | -- add more (like ones that do not support STDIN)
27 | }
28 |
29 | local handlers = {
30 | sql_formatter = function()
31 | if V.executable("sql-formatter") == 0 then return end
32 | local node = util.get_node_at_cursor(0)
33 | if not node or node:type() ~= "string_content" then return end -- add more cases
34 | presets.stdin_comply(node, T.get_node_text(node, 0), "sql-formatter", "-l", "sqlite")
35 | end,
36 | -- add more
37 | }
38 |
39 | function M._choose(on_complete, ...)
40 | local choices = { ... }
41 | if type(choices[1]) == "table" then choices = choices[1] end
42 | local Text = require("nui.text")
43 | local Menu = require("nui.menu") -- {{{
44 | local options = {
45 | relative = "editor",
46 | position = {
47 | row = "50%",
48 | col = "50%",
49 | },
50 | border = {
51 | style = "solid",
52 | text = {
53 | top = Text(" Handlers ", "TelescopePromptTitle"),
54 | top_align = "center",
55 | },
56 | },
57 | win_options = {
58 | winhighlight = "Normal:NormalFloat",
59 | }
60 | } -- }}}
61 |
62 | Menu(options, {
63 | lines = vim.tbl_map(function(choice) return Menu.item(choice) end, choices),
64 | min_width = 20,
65 | keymap = {
66 | focus_next = { "j", "", "" },
67 | focus_prev = { "k", "", "" },
68 | close = { "", "" },
69 | submit = { "", "" },
70 | },
71 | on_submit = on_complete,
72 | }):mount()
73 | end
74 |
75 | function M.apply()
76 | M._choose(function(item)
77 | if handlers[item.text] then handlers[item.text]() end
78 | end, vim.tbl_keys(handlers))
79 | end
80 |
81 | return M
82 |
--------------------------------------------------------------------------------
/lua/scratch/on.lua:
--------------------------------------------------------------------------------
1 | -- local on = require("on")
2 | -- on.UILeave.CmdlineEnter:desc("test"):group("TEST"):prin("Test!"):only()()
3 |
4 | return setmetatable({}, {
5 | __index = function(_, event)
6 | local params = { { event }, opts = {} }
7 | local methods = {}
8 |
9 | function methods:ex(cmd)
10 | params.opts[type(cmd) == "string" and "command" or "callback"] = cmd
11 | return self
12 | end
13 | function methods:set(...)
14 | return self:ex("set " .. table.concat({...}, " "))
15 | end
16 | function methods:prin(item)
17 | params.opts.command = string.format("echo %q", item)
18 | return self
19 | end
20 | function methods:see()
21 | params.opts.callback = vim.print
22 | return self
23 | end
24 | function methods:group(label, clear)
25 | if type(label) == "string" then
26 | params.opts.group = vim.api.nvim_create_augroup(label, { clear = clear })
27 | else
28 | params.opts.group = label
29 | end
30 | return self
31 | end
32 | function methods:pat(patterns)
33 | params.opts.pattern = patterns
34 | return self
35 | end
36 | function methods:desc(label)
37 | params.opts.desc = label
38 | return self
39 | end
40 | function methods:buf(buffer)
41 | params.opts.buffer = buffer
42 | return self
43 | end
44 | function methods:only()
45 | params.opts.buffer = 0
46 | return self
47 | end
48 | function methods:nest()
49 | params.opts.nested = true
50 | return self
51 | end
52 | function methods:nonest()
53 | params.opts.nested = false
54 | return self
55 | end
56 | function methods:once()
57 | params.opts.once = true
58 | return self
59 | end
60 | function methods:more()
61 | params.opts.once = false
62 | return self
63 | end
64 | function methods:test()
65 | vim.print(params)
66 | return self
67 | end
68 |
69 | return setmetatable(methods, {
70 | __index = function(self, key)
71 | table.insert(params[1], key)
72 | return self
73 | end,
74 | __call = function()
75 | vim.api.nvim_create_autocmd(params[1], params.opts)
76 | end,
77 | })
78 | end,
79 | })
80 |
--------------------------------------------------------------------------------
/lua/scratch/overview.lua:
--------------------------------------------------------------------------------
1 | ---@diagnostic disable: need-check-nil
2 | local M = {}
3 | local A = vim.api
4 | local truncate = require("plenary.strings").truncate
5 |
6 | M._line = -1
7 | M._structure = {}
8 | M._util_names = {
9 | g = "gap",
10 | c = "center",
11 | h = "heading",
12 | e = "entry",
13 | s = "space",
14 | t = "titled",
15 | }
16 |
17 | M.config = {
18 | title = {
19 | "╔═══╗╔╗ ╔╗╔═══╗╔═══╗╔╗ ╔╗╔══╗╔═══╗╔╗╔╗╔╗",
20 | "║╔═╗║║╚╗╔╝║║╔══╝║╔═╗║║╚╗╔╝║╚╣╠╝║╔══╝║║║║║║",
21 | "║║ ║║╚╗║║╔╝║╚══╗║╚═╝║╚╗║║╔╝ ║║ ║╚══╗║║║║║║",
22 | "║║ ║║ ║╚╝║ ║╔══╝║╔╗╔╝ ║╚╝║ ║║ ║╔══╝║╚╝╚╝║",
23 | "║╚═╝║ ╚╗╔╝ ║╚══╗║║║╚╗ ╚╗╔╝ ╔╣╠╗║╚══╗╚╗╔╗╔╝",
24 | "╚═══╝ ╚╝ ╚═══╝╚╝╚═╝ ╚╝ ╚══╝╚═══╝ ╚╝╚╝ ",
25 | },
26 | winhl = "NormalFloat:Normal",
27 | section = {
28 | width = 100,
29 | },
30 | }
31 |
32 | -- Main Utils {{{
33 | function M.setup(options)
34 | if M._loaded then return end
35 | options = vim.F.if_nil(options, {})
36 | M.config = vim.tbl_deep_extend("keep", options, M.config)
37 | M._loaded = true
38 | end
39 |
40 | function M.create()
41 | if not M._loaded then return end
42 | local namespace = A.nvim_create_namespace("Help")
43 | local buffer = A.nvim_create_buf(false, true)
44 | local window = A.nvim_open_win(buffer, true, {
45 | relative = "editor",
46 | row = 0,
47 | col = 0,
48 | width = vim.o.columns,
49 | height = vim.o.lines,
50 | style = "minimal",
51 | noautocmd = true,
52 | })
53 |
54 | A.nvim_win_set_buf(window, buffer)
55 | A.nvim_buf_set_name(buffer, "HELP")
56 | A.nvim_win_set_option(window, "winhl", M.config.winhl)
57 | A.nvim_buf_set_option(buffer, "modifiable", false)
58 | A.nvim_set_current_buf(buffer)
59 |
60 | local info = {
61 | namespace = namespace,
62 | window = window,
63 | buffer = buffer,
64 | lock = function() A.nvim_buf_set_option(buffer, "modifiable", false) end,
65 | unlock = function() A.nvim_buf_set_option(buffer, "modifiable", true) end,
66 | unmodify = function() A.nvim_buf_set_option(buffer, "modified", false) end,
67 | }
68 |
69 | vim.keymap.set("n", "q", function() M.delete(info) end, { buffer = buffer, desc = "quit overview" })
70 | return info
71 | end
72 |
73 | function M.delete(info)
74 | A.nvim_win_close(info.window, true)
75 | A.nvim_buf_delete(info.buffer, { force = true })
76 | M._structure = {}
77 | M._line = -1
78 | M._info = nil
79 | end
80 |
81 | function M.line()
82 | M._line = M._line + 1
83 | return M._line
84 | end
85 | -- }}}
86 |
87 | -- Styling Utils {{{
88 | function M.center(info, line, group)
89 | local width = A.nvim_strwidth(line)
90 | local columns = A.nvim_win_get_width(info.window)
91 | local column_start = (columns - width) / 2
92 | return {
93 | content = string.rep(" ", column_start) .. line,
94 | column = {
95 | start = column_start,
96 | finish = column_start + line:len()
97 | },
98 | type = "center",
99 | group = group,
100 | }
101 | end
102 |
103 | function M.gap()
104 | return {
105 | content = "",
106 | column = {
107 | start = 0,
108 | finish = 0
109 | },
110 | type = "gap",
111 | }
112 | end
113 |
114 | function M.space(info, group)
115 | local line = string.rep(" ", M.config.section.width)
116 | local width = A.nvim_strwidth(line)
117 | local columns = A.nvim_win_get_width(info.window)
118 | local column_start = (columns - width) / 2
119 | return {
120 | content = line .. string.rep(" ", column_start),
121 | column = {
122 | start = column_start,
123 | finish = column_start + line:len()
124 | },
125 | type = "space",
126 | group = group,
127 | }
128 | end
129 |
130 | function M.heading(info, line, groups)
131 | local width = A.nvim_strwidth(line)
132 | local column_start = (M.config.section.width - width) / 2
133 | local section = string.rep(" ", column_start) .. line .. string.rep(" ", column_start)
134 | local underflow = M.config.section.width - A.nvim_strwidth(section)
135 | if underflow > 0 then section = section .. string.rep(" ", underflow) end
136 | local centered = M.center(info, section)
137 | centered.type = "heading"
138 | centered.groups = { centered = groups.centered, titled = groups.titled }
139 | centered.column.titled = {
140 | start = column_start + centered.column.start - (underflow > 0 and underflow or 0),
141 | finish = column_start + centered.column.start + line:len() - (underflow > 0 and underflow or 0),
142 | }
143 | return centered
144 | end
145 |
146 | function M.titled(info, line, padding, groups)
147 | local heading = M.heading(info, M.KEY(line, padding), groups)
148 | heading.type = "titled"
149 | return heading
150 | end
151 |
152 | function M.entry(info, key, value, padding, groups)
153 | key = string.rep(" ", padding.left) .. key
154 | value = value .. string.rep(" ", padding.right)
155 | local key_width = A.nvim_strwidth(key)
156 | local value_width = A.nvim_strwidth(value)
157 | local spacing = M.config.section.width - key_width - value_width
158 | local content = key .. string.rep(" ", spacing) .. value
159 | local centered = M.center(info, content)
160 | return {
161 | content = centered.content,
162 | column = {
163 | start = centered.column.start, finish = centered.column.finish,
164 | key = { start = centered.column.start + padding.left, finish = centered.column.start + key_width },
165 | value = { start = centered.column.finish - value_width + padding.right, finish = centered.column.finish - padding.right },
166 | },
167 | groups = groups,
168 | type = "entry",
169 | }
170 | end
171 | -- }}}
172 |
173 | -- Abstractions/Helpers {{{
174 | function M.KEY(line, padding)
175 | return string.rep(" ", padding.left) .. line .. string.rep(" ", padding.right)
176 | end
177 |
178 | function M.PUT(util_name, ...)
179 | if type(util_name) == "number" then
180 | local index = 0
181 | while index < util_name do
182 | M.PUT()
183 | index = index + 1
184 | end
185 | return
186 | end
187 |
188 | if util_name and not M._util_names[util_name] then return end
189 | if not util_name then
190 | table.insert(M._structure, M.gap())
191 | return
192 | end
193 | table.insert(M._structure, M[M._util_names[util_name]](...))
194 | end
195 | -- }}}
196 |
197 | function M.draw(info)
198 | info.unlock()
199 | local line = nil
200 | for _, item in ipairs(M._structure) do
201 | line = M.line()
202 | A.nvim_buf_set_lines(info.buffer, line, -1, true, { item.content })
203 | if item.type == "entry" then
204 | A.nvim_buf_add_highlight(info.buffer, info.namespace, item.groups.background, line, math.ceil(item.column.start), math.ceil(item.column.finish))
205 | A.nvim_buf_add_highlight(info.buffer, info.namespace, item.groups.key, line, math.ceil(item.column.key.start), math.ceil(item.column.key.finish))
206 | A.nvim_buf_add_highlight(info.buffer, info.namespace, item.groups.value, line, math.ceil(item.column.value.start), math.ceil(item.column.value.finish))
207 | elseif item.type == "heading" or item.type == "titled" then
208 | A.nvim_buf_add_highlight(info.buffer, info.namespace, item.groups.centered, line, math.ceil(item.column.start), math.ceil(item.column.finish))
209 | A.nvim_buf_add_highlight(info.buffer, info.namespace, item.groups.titled, line, math.ceil(item.column.titled.start), math.ceil(item.column.titled.finish))
210 | elseif item.type ~= "gap" then
211 | A.nvim_buf_add_highlight(info.buffer, info.namespace, item.group, line, math.ceil(item.column.start), math.ceil(item.column.finish))
212 | end
213 | end
214 | info.lock()
215 | info.unmodify()
216 | end
217 |
218 | -- Toggle {{{
219 | function M.toggle()
220 | if not M._loaded then return end
221 | if M._info then
222 | M.delete(M._info)
223 | return
224 | end
225 |
226 | local info = M.create()
227 | -- layout/placements
228 | M.PUT(3)
229 | for _, line in ipairs(M.config.title) do M.PUT("c", info, line, "Function") end
230 | M.PUT(3)
231 | local modes = { n = "Normal", i = "Insert", v = "Visual", x = "Ex", c = "Command" }
232 | for mode, label in pairs(modes) do
233 | M.PUT("t", info, label .. "-Mode Defaults", { left = 1, right = 1 }, { centered = "CursorLine", titled = "TodoBgBUG" })
234 | M.PUT("s", info, "CursorLine")
235 | for _, keymap in ipairs(A.nvim_get_keymap(mode)) do
236 | keymap.desc = vim.F.if_nil(keymap.desc, "no description")
237 | M.PUT("e", info, (keymap.lhs:gsub(" ", "")), keymap.desc, { left = 2, right = 2 }, { key = "Directory", value = "MsgArea", background = "CursorLine" })
238 | end
239 | M.PUT("s", info, "CursorLine")
240 | M.PUT()
241 | end
242 |
243 | M.PUT("t", info, "Commands", { left = 1, right = 1 }, { centered = "CursorLine", titled = "TodoBgTEST" })
244 | M.PUT("s", info, "CursorLine")
245 | for _, command in pairs(A.nvim_get_commands({})) do
246 | command.definition = command.definition == "" and "no definition" or truncate(command.definition, 50)
247 | if command.definition:match("^:?lua require") or command.definition:match("^:?call ") then command.definition = "no definition" end
248 | M.PUT("e", info, command.name, vim.trim(command.definition), { left = 2, right = 2 }, { key = "Directory", value = "MsgArea", background = "CursorLine" })
249 | end
250 | M.PUT("s", info, "CursorLine")
251 | M.PUT()
252 |
253 | M.draw(info)
254 | M._info = info
255 | end
256 | -- }}}
257 |
258 | return M
259 |
--------------------------------------------------------------------------------
/lua/scratch/paste.lua:
--------------------------------------------------------------------------------
1 | local M = {}
2 | local Path = require("plenary.path")
3 | local J = require("plenary.job")
4 |
5 | M.config = {
6 | db_path = vim.fn.stdpath("state") .. "/paste.db.json",
7 | tmp_path = "/tmp/paste",
8 | dump_path = "/tmp/dump",
9 | }
10 |
11 | function M.setup(options)
12 | options = vim.F.if_nil(options, {})
13 | M.config = vim.tbl_deep_extend("keep", options, M.config)
14 | M._db = Path:new(M.config.db_path)
15 | M._dump = Path:new(M.config.dump_path)
16 | M._path = Path:new(M.config.tmp_path)
17 | M._responses = {}
18 | if M._db:exists() then M._responses = vim.json.decode(M._db:read()) end
19 | end
20 |
21 | function M.paste(contents)
22 | M._path:write(table.concat(contents, "\n"), "w")
23 | J:new({
24 | command = "0x0",
25 | args = { "--upload", M._path.filename },
26 | on_exit = vim.schedule_wrap(function(self, code, _)
27 | if code ~= 0 then return end
28 | local body = self:result()[1]
29 | local pretty = M.pretty(M._dump:read())
30 | M._responses[body] = { body = body, headers = pretty.headers, code = pretty.code }
31 | M._path:rm()
32 | M._dump:rm()
33 | vim.fn.setreg("+", body)
34 | vim.api.nvim_notify(body, vim.log.levels.INFO, { title = "0x0", icon = " " })
35 | M._db:write(vim.json.encode(M._responses), "w")
36 | end),
37 | }):start()
38 | end
39 |
40 | function M.delete(response)
41 | if not response then return end
42 | if not response.headers["x-token"] then
43 | M._responses[response.body] = nil
44 | M._db:write(vim.json.encode(M._responses), "w")
45 | return
46 | end
47 | J:new({
48 | command = "0x0",
49 | args = { "--delete", response.headers["x-token"], response.body },
50 | on_exit = vim.schedule_wrap(function(self, code, _)
51 | if code ~= 0 then return end
52 | vim.api.nvim_notify(vim.inspect(self:result()), vim.log.levels.INFO, { title = "0x0", icon = " " })
53 | M._responses[response.body] = nil
54 | M._db:write(vim.json.encode(M._responses), "w")
55 | end),
56 | }):start()
57 | end
58 |
59 | function M.pretty(data)
60 | local lines = vim.split(data, "\r\n", { plain = true })
61 | local headers = {}
62 | local heading = vim.split(lines[1], " ", { plain = true })
63 | local code = heading[2]
64 | table.remove(lines, 1)
65 | for _, line in ipairs(lines) do
66 | local _line = vim.split(line, ": ", { plain = true })
67 | if #_line > 1 then
68 | local _colon_items = vim.split(_line[2], "; ", { plain = true })
69 | if #_colon_items == 1 then
70 | headers[_line[1]] = _colon_items[1]
71 | elseif #_colon_items > 1 then
72 | headers[_line[1]] = _colon_items
73 | end
74 | end
75 | end
76 | return { code = code, headers = headers }
77 | end
78 |
79 | function M.command(args)
80 | if args.bang and args.fargs[1] then
81 | M.delete(M._responses[args.fargs[1]])
82 | elseif args.fargs[1] then
83 | M.paste(vim.fn.readfile(args.fargs[1]))
84 | else
85 | args.line1 = (args.range == 2 and args.line1 or 1) - 1
86 | args.line2 = args.range == 2 and args.line2 or -1
87 | M.paste(vim.api.nvim_buf_get_lines(0, args.line1, args.line2, false))
88 | end
89 | end
90 |
91 | return M
92 |
--------------------------------------------------------------------------------
/lua/telescope/_extensions/gradle.lua:
--------------------------------------------------------------------------------
1 | ---@diagnostic disable: undefined-field
2 | local J = require("plenary.job")
3 | local Path = require("plenary.path")
4 |
5 | local finders = require("telescope.finders")
6 | local sorters = require("telescope.sorters")
7 | local actions = require("telescope.actions")
8 | local pickers = require("telescope.pickers")
9 | local state = require("telescope.state")
10 |
11 | local make_entry = require("telescope.make_entry")
12 | local previewer = require("telescope.previewers.buffer_previewer")
13 | local entry_display = require("telescope.pickers.entry_display")
14 |
15 | local actions_layout = require("telescope.actions.layout")
16 | local actions_state = require("telescope.actions.state")
17 |
18 | local dialog = require("telescope.previewers.utils").set_preview_message
19 |
20 | local HEAD = ""
21 | local NORM = ""
22 | local LONE = ""
23 | local MAIN = ""
24 |
25 | -- TODO: Implement recents.
26 | local defaults = {
27 | separator = " ",
28 | gradle_icon = "",
29 | results_title = "",
30 | fill = "=",
31 | prompt_title = "Gradle Tasks",
32 | on_choice = function(entry) vim.cmd.terminal(entry.cmd) end,
33 | cache_filename = ".cached-tasks",
34 | previewer = false,
35 | layout_config = {
36 | preview_cutoff = 120,
37 | width = function(_, maximum_columns, _) return math.min(maximum_columns, 90) end,
38 | height = function(_, _, maximum_lines) return math.min(maximum_lines, 20) end,
39 | },
40 | }
41 |
42 | -- API Implementations {{{
43 | local function gen_from_gradle_cmds(opts)
44 | local displayer = entry_display.create({
45 | separator = opts.separator,
46 | items = {
47 | { width = 1 },
48 | { width = 80 },
49 | { remaining = true },
50 | },
51 | })
52 |
53 | local function make_display(entry)
54 | local entries = {}
55 | if entry.value.type == HEAD then -- make this non-interactive
56 | table.insert(entries, { opts.gradle_icon, "@constant" })
57 | if entry.value.main then
58 | table.insert(entries, { entry.value.label, "@constant" })
59 | else
60 | table.insert(entries, { entry.value.label, "@include" })
61 | end
62 | elseif entry.value.type == NORM then
63 | table.insert(entries, " ")
64 | table.insert(entries, { entry.value.label, "@float" })
65 | elseif entry.value.type == LONE then
66 | table.insert(entries, " ")
67 | table.insert(entries, { entry.value.label, "@debug" })
68 | else
69 | table.insert(entries, " ")
70 | table.insert(entries, { entry.value.label, "@define" })
71 | end
72 | return displayer(entries)
73 | end
74 |
75 | return function(entry)
76 | local head = ""
77 | if entry.head then heading = entry.head .. ":" end
78 | return make_entry.set_default_entry_mt({
79 | value = entry,
80 | display = make_display,
81 | ordinal = head .. entry.type .. ":" .. entry.label,
82 | }, opts)
83 | end
84 | end
85 | -- }}}
86 |
87 | local function parse_lines(lines, ignore_lines)
88 | local items = {}
89 | local will_break = false
90 | local head
91 | for index, line in ipairs(lines) do
92 | line = vim.trim(line)
93 | if not vim.tbl_contains(ignore_lines, index) and not line:match("^-+$") then
94 | local item = {}
95 | if line == "" then
96 | will_break = true
97 | elseif line:match("^%w") then
98 | if will_break then
99 | item.type = HEAD
100 | item.label = line
101 | item.about = line
102 | head = line
103 | will_break = false
104 | else
105 | local tokens = vim.split(line, " - ", { plain = true })
106 | if #tokens ~= 0 and #tokens > 1 then
107 | item.head = head
108 | item.type = tokens[1]:match("^%w+:") and NORM or LONE
109 | item.label = table.remove(tokens, 1)
110 | item.about = table.concat(tokens, " - ")
111 | item.cmd = "./gradlew " .. item.label
112 | else
113 | item.head = head
114 | item.type = tokens[1]:match("^%w+:") and LONE or MAIN
115 | item.label = table.remove(tokens, 1)
116 | item.about = "No description."
117 | item.cmd = "./gradlew " .. item.label
118 | end
119 | end
120 | end
121 | if item.type then table.insert(items, item) end
122 | end
123 | end
124 | items[1].main = true
125 | items[1].type = HEAD
126 | return items
127 | end
128 |
129 | local function get_tasks(on_success, title)
130 | ---@type Path
131 | local tasks_path = Path:new("./" .. title)
132 | if not tasks_path:exists() then
133 | tasks_path:touch({ exists_ok = true })
134 | tasks_path:write("{}", "w")
135 | end
136 |
137 | local cache_raw = tasks_path:read()
138 | local tasks_cache = {}
139 | if type(cache_raw) == "string" then
140 | tasks_cache = vim.json.decode(cache_raw)
141 | if tasks_cache then
142 | on_success(tasks_cache)
143 | else
144 | tasks_cache = {}
145 | end
146 | end
147 |
148 | -- Parser Job {{{
149 | J:new({
150 | command = "./gradlew",
151 | args = { "tasks", "--all" },
152 | on_exit = function(self, code, _)
153 | if code ~= 0 then return end
154 | local tasks = self:result()
155 | tasks = parse_lines(tasks, { 1, 2, 3, #tasks - 2, #tasks - 1, #tasks })
156 |
157 | local equal = #tasks == #tasks_cache
158 | if equal then -- deep array equal
159 | for index, item in ipairs(tasks) do
160 | local cache_item = tasks_cache[index]
161 | if cache_item and item.type == cache_item.type then
162 | if item.about ~= cache_item.about or item.label ~= cache_item.label then equal = true end
163 | end
164 | end
165 | end
166 |
167 | -- WARN: this will cause problems when implementing recents
168 | vim.schedule(function()
169 | if tasks_cache and equal then return end -- only refresh if the cache and new tasks aren't equal
170 | tasks_path:write(vim.json.encode(tasks), "w")
171 | on_success(tasks)
172 | end)
173 | end,
174 | }):start()
175 | -- }}}
176 | end
177 |
178 | return require("telescope").register_extension({
179 | exports = {
180 | gradle = function(opts)
181 | if not vim.loop.fs_realpath("./gradlew") then return end
182 | opts = vim.F.if_nil(opts, {})
183 | opts = vim.tbl_deep_extend("keep", opts, defaults)
184 |
185 | ---@type Picker
186 | local picker
187 | get_tasks(function(tasks)
188 | if picker then -- refreshed with updated values (if any)
189 | picker:refresh(finders.new_table({ results = tasks, entry_maker = gen_from_gradle_cmds(opts) }), opts)
190 | return
191 | end
192 |
193 | picker = pickers.new(opts, { -- currently viewing cached values
194 | finder = finders.new_table({ results = tasks, entry_maker = gen_from_gradle_cmds(opts) }),
195 | sorter = sorters.get_fzy_sorter(opts),
196 | previewer = previewer.new_buffer_previewer({
197 | define_preview = function(self, entry)
198 | local about = vim.F.if_nil(entry.value.about, "NOT APPLICABLE")
199 | dialog(self.state.bufnr, self.state.winid, about, opts.fill)
200 | end,
201 | }),
202 | attach_mappings = function(buffer, map)
203 | map("n", "", actions_layout.toggle_preview)
204 | map("i", "", actions_layout.toggle_preview)
205 |
206 | local function smart_move(move_type)
207 | return function(...)
208 | local entry = actions_state.get_selected_entry().value
209 | if entry.type ~= "" then return end
210 |
211 | -- HACK: having all entries as s will result in a infinite loop
212 | -- so we just get the current sorter state and see what was in the prompt
213 | -- and if the prompt matches a case where only heads are viewed then we
214 | -- do not move the current selection
215 | -- TODO: Is there a better way to do this?
216 | local move = true
217 | local sorter = state.get_status(...).picker.sorter
218 | if
219 | sorter
220 | and sorter._discard_state
221 | and sorter._discard_state.prompt:len() > 3 -- hack case
222 | and sorter._discard_state.prompt:match("^ entries
235 | if entry.type ~= "" then
236 | actions.close(buffer)
237 | opts.on_choice(entry)
238 | end
239 | end)
240 | return true
241 | end,
242 | })
243 | picker:find()
244 | end, opts.cache_filename)
245 | end,
246 | },
247 | })
248 |
--------------------------------------------------------------------------------
/lua/telescope/_extensions/kao.lua:
--------------------------------------------------------------------------------
1 | local actions = require("telescope.actions")
2 | local pickers = require("telescope.pickers")
3 | local finders = require("telescope.finders")
4 | local config = require("telescope.config")
5 |
6 | local entry_display = require("telescope.pickers.entry_display")
7 | local make_entry = require("telescope.make_entry")
8 | local actions_state = require("telescope.actions.state")
9 |
10 | local curl = require("plenary.curl")
11 | local P = require("plenary.path")
12 | local db = P:new(vim.fn.stdpath("state") .. "/kao.db.json")
13 | local results = nil
14 |
15 | if not db:exists() then-- {{{
16 | curl.get("https://raw.githubusercontent.com/towzeur/Japanese-Emoticons-json/master/Japanese_Emoticons.json", {
17 | accept = "application/json",
18 | callback = function(response)
19 | local parsed = vim.json.decode(response.body)
20 | results = {}
21 | ---@diagnostic disable-next-line: param-type-mismatch
22 | for annotation, emojis in pairs(parsed) do
23 | for _, emoji in ipairs(emojis) do
24 | table.insert(results, { annotation = annotation, emoji = emoji })
25 | end
26 | end
27 | db:write(vim.json.encode(results), "w")
28 | end,
29 | })
30 | end-- }}}
31 |
32 | local function gen_from_kao(options)
33 | local displayer = entry_display.create({
34 | separator = " ",
35 | items = {
36 | { width = 20 },
37 | { remaining = true },
38 | },
39 | })
40 |
41 | return function(value)
42 | return make_entry.set_default_entry_mt({
43 | value = value,
44 | ordinal = value.annotation .. ":" .. value.emoji,
45 | display = function(entry)
46 | return displayer({
47 | { entry.value.annotation, "Question" },
48 | { entry.value.emoji, "@text" },
49 | })
50 | end,
51 | }, options)
52 | end
53 | end
54 |
55 | return require("telescope").register_extension({
56 | exports = {
57 | kao = function(options)
58 | options = vim.F.if_nil(options, {})
59 | options.previewer = false
60 | options.layout_strategy = vim.F.if_nil(options.layout_strategy, "cursor")
61 | options.layout_config = vim.F.if_nil(options.layout_config, {
62 | width = 0.3,
63 | height = 0.5,
64 | prompt_position = "top",
65 | })
66 |
67 | -- inspo: discord
68 | results = vim.F.if_nil(vim.json.decode(db:read()), results)
69 | if not results then return end
70 | options.prompt_prefix = vim.F.if_nil(options.prompt_prefix, (function()
71 | return results[math.random(1, #results)].emoji .. " "
72 | end)())
73 |
74 | pickers.new(options, {
75 | finder = finders.new_table({ results = results, entry_maker = gen_from_kao(options) }),
76 | sorter = config.values.generic_sorter(options),
77 | attach_mappings = function(buffer)
78 | actions.select_default:replace(function()
79 | local current = actions_state.get_selected_entry()
80 | vim.schedule(function()
81 | vim.api.nvim_put({ current.value.emoji }, "c", false, true)
82 | end)
83 | actions.close(buffer)
84 | end)
85 | return true
86 | end,
87 | }):find()
88 | end,
89 | },
90 | })
91 |
--------------------------------------------------------------------------------
/spell/words.add:
--------------------------------------------------------------------------------
1 | noplainbuffer
2 | config
3 | cjk
4 | utf
5 | menuone
6 | noselect
7 | eol
8 | tmp
9 | nore
10 | n/!
11 | marklist
12 | join/!
13 | application
14 | Subhash
15 | Ravi
16 | paise
17 | neovim
18 | Laterite
19 | Sabha
20 | Rajya
21 | Chola
22 | Karikala
23 | Puhar
24 | Kaveri
25 | Poompattinam
26 | Jawaharlal
27 | Nehru
28 | Ambedkar
29 | Aligarh
30 | Syed
31 | Lok Sabha
32 | Rajya Sabha
33 | IAS
34 | Rann of Kutch
35 | Lasit
36 | Malinga
37 | Zener
38 | Esaki
39 | Tsushin
40 | Kogyo
41 | Polimyelitis
42 | Bordetella
43 | Pertussis
44 | dermatophytes
45 | OMR
46 | Mukul
47 | Mudgal
48 | Coolis
49 | Verma
50 | Thakkar
51 | Manharlal
52 | Pranlal
53 | Yann
54 | IPL
55 | Shrimati
56 | aircrafts
57 | aircrafts
58 |
--------------------------------------------------------------------------------