Init Commit

This commit is contained in:
riomoo 2025-01-17 19:21:40 -05:00
commit b04f979811
Signed by: riomoo
SSH key fingerprint: SHA256:IidVcrEqw4r/6zlIASTgxRmFBmyRiZ/31wjlNkFzVG0
225 changed files with 31653 additions and 0 deletions

View file

@ -0,0 +1,12 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =7
let g:netrw_dirhist_7='/home/moo/.pki/nssdb'
let g:netrw_dirhist_6='/home/moo/.pki'
let g:netrw_dirhist_5='/home/moo/.wallpapers'
let g:netrw_dirhist_4='/home/moo/.zenmap'
let g:netrw_dirhist_3='/home/moo/.cargo'
let g:netrw_dirhist_2='/run/media/moo/unlocked-universe/website/rioluroom.com/sass/artists'
let g:netrw_dirhist_1='/home/moo/vim-visualHtml/autoload/visualHtml'
let g:netrw_dirhist_0='/home/moo/.config/qutebrowser'
let g:netrw_dirhist_9='/run/media/moo/unlocked-universe/website/rioluroom.com/js/Zoom/SlipperyT'
let g:netrw_dirhist_8='/run/media/moo/unlocked-universe/website/rioluroom.com/sass'

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,76 @@
hi clear
syntax reset
let g:colors_name = "mycolorscheme"
set background=dark
set t_Co=256
hi Normal guifg=#bfbcb7 ctermbg=NONE guibg=#1b1e2c gui=NONE
hi DiffText guifg=#a34346 guibg=NONE
hi ErrorMsg guifg=#a34346 guibg=NONE
hi WarningMsg guifg=#a34346 guibg=NONE
hi PreProc guifg=#a34346 guibg=NONE
hi Exception guifg=#a34346 guibg=NONE
hi Error guifg=#a34346 guibg=NONE
hi DiffDelete guifg=#a34346 guibg=NONE
hi GitGutterDelete guifg=#a34346 guibg=NONE
hi GitGutterChangeDelete guifg=#a34346 guibg=NONE
hi cssIdentifier guifg=#a34346 guibg=NONE
hi cssImportant guifg=#a34346 guibg=NONE
hi Type guifg=#a34346 guibg=NONE
hi Identifier guifg=#a34346 guibg=NONE
hi PMenuSel guifg=#395e62 guibg=NONE
hi Constant guifg=#395e62 guibg=NONE
hi Repeat guifg=#395e62 guibg=NONE
hi DiffAdd guifg=#395e62 guibg=NONE
hi GitGutterAdd guifg=#395e62 guibg=NONE
hi cssIncludeKeyword guifg=#395e62 guibg=NONE
hi Keyword guifg=#395e62 guibg=NONE
hi IncSearch guifg=#314c52 guibg=NONE
hi Title guifg=#314c52 guibg=NONE
hi PreCondit guifg=#314c52 guibg=NONE
hi Debug guifg=#314c52 guibg=NONE
hi SpecialChar guifg=#314c52 guibg=NONE
hi Conditional guifg=#314c52 guibg=NONE
hi Todo guifg=#314c52 guibg=NONE
hi Special guifg=#314c52 guibg=NONE
hi Label guifg=#314c52 guibg=NONE
hi Delimiter guifg=#314c52 guibg=NONE
hi Number guifg=#314c52 guibg=NONE
hi CursorLineNR guifg=#314c52 guibg=NONE
hi Define guifg=#314c52 guibg=NONE
hi MoreMsg guifg=#314c52 guibg=NONE
hi Tag guifg=#314c52 guibg=NONE
hi String guifg=#314c52 guibg=NONE
hi MatchParen guifg=#314c52 guibg=NONE
hi Macro guifg=#314c52 guibg=NONE
hi DiffChange guifg=#314c52 guibg=NONE
hi GitGutterChange guifg=#314c52 guibg=NONE
hi cssColor guifg=#314c52 guibg=NONE
hi Function guifg=#a55354 guibg=NONE
hi Directory guifg=#858380 guibg=NONE
hi markdownLinkText guifg=#858380 guibg=NONE
hi javaScriptBoolean guifg=#858380 guibg=NONE
hi Include guifg=#858380 guibg=NONE
hi Storage guifg=#858380 guibg=NONE
hi cssClassName guifg=#858380 guibg=NONE
hi cssClassNameDot guifg=#858380 guibg=NONE
hi Statement guifg=#bfbcb7 guibg=NONE
hi Operator guifg=#bfbcb7 guibg=NONE
hi cssAttr guifg=#bfbcb7 guibg=NONE
hi Pmenu guifg=#bfbcb7 guibg=#454545
hi SignColumn guibg=#1b1e2c
hi Title guifg=#bfbcb7
hi LineNr guifg=#5a5650 guibg=#1b1e2c
hi NonText guifg=#314c52 guibg=#1b1e2c
hi Comment guifg=#314c52 gui=italic
hi SpecialComment guifg=#314c52 gui=italic guibg=NONE
hi CursorLine guibg=#454545
hi TabLineFill gui=NONE guibg=#454545
hi TabLine guifg=#5a5650 guibg=#454545 gui=NONE
hi StatusLine gui=bold guibg=#454545 guifg=#bfbcb7
hi StatusLineNC gui=NONE guibg=#1b1e2c guifg=#bfbcb7
hi Search guibg=#314c52 guifg=#bfbcb7
hi VertSplit gui=NONE guifg=#454545 guibg=NONE
hi Visual gui=NONE guibg=#454545

@ -0,0 +1 @@
Subproject commit e027db9d94f94947153cd7b5ac9abd04371ab2b0000000000000000000000000

View file

@ -0,0 +1,54 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/

View file

@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -0,0 +1,72 @@
# YCM-Generator
This is a script which generates a list of compiler flags from a project with an arbitrary build system. It can be used to:
* generate a ```.ycm_extra_conf.py``` file for use with [YouCompleteMe](https://github.com/Valloric/YouCompleteMe)
* generate a ```.color_coded``` file for use with [color_coded](https://github.com/jeaye/color_coded)
It works by building the project with a fake toolchain, which simply and filters compiler flags to be stored in the resulting file.
It is reasonably fast, taking ~10 seconds to generate a configuration file for the Linux kernel.
## Status
This plugin is in maintenance mode. I am happy to merge PRs and triage bug reports, but am not actively working on it.
## Installation
Add ```NeoBundle 'rdnetto/YCM-Generator'``` to your vimrc (or the equivalent for your plugin manager).
For [vim-plug](https://github.com/junegunn/vim-plug) users, add ```Plug 'rdnetto/YCM-Generator', { 'branch': 'stable'}``` to your vimrc.
Alternatively, Arch Linux users can install YCM-Generator using the (unofficial) [AUR package](https://aur4.archlinux.org/packages/ycm-generator-git/).
## Usage
Run ```./config_gen.py PROJECT_DIRECTORY```, where ```PROJECT_DIRECTORY``` is the root directory of your project's build system (i.e. the one containing the root Makefile, etc.)
You can also invoke it from within Vim using the ```:YcmGenerateConfig``` or ```:CCGenerateConfig``` commands to generate a config file for the current directory. These commands accept the same arguments as ```./config_gen.py```, but do not require the project directory to be specified (it defaults to the current working directory).
## Requirements and Limitations
* Requirements:
+ Python 2
+ Clang
* Supported build systems:
+ make
+ cmake
+ qmake
+ autotools
Your build system should support specifying the compiler through the ```CC```/```CXX``` environment variables, or not use an absolute path to the compiler.
Some flags present in the resulting configuration file may be mutually exclusive with each other - reading the generated file prior to use is recommended.
The script assumes that executables with the names `clang` and `clang++` exist in your `PATH`. This has been known to cause issues under Ubuntu, where the C++ compiler may be called `clang++-3.6` (see #50).
## Documentation & Support
* run ```./config_gen.py --help``` to see the complete list of supported options.
* if you receive the error message ```ERROR: No commands were logged to the build logs```, try using the ```--verbose``` flag to see any error messages
+ some build systems require certain environment variables to be set. Note that these will *not* be used by YCM-Generator by default, unless `--preserve-environment` is used
+ if you open an issue regarding this error message, please include the output when running with ```--verbose``` and a link to the project repo (if possible)
## Development
Patches are welcome. Please submit pull requests against the ```develop``` branch.
### Windows support
The script is currently supported under Unices (Linux, NixOS<sup>[1]</sup>, BSD, OS X) only.
Implementing Windows support consists of porting the contents of ```fake-toolchain/Unix```.
If you are interested in implementing/testing this, please open a pull request.
<sup>[1]</sup> May require `--preserve-environment` - see [#19](https://github.com/rdnetto/YCM-Generator/issues/19)
### Test Cases
The following projects are used for testing:
| Project | Build system | Notes |
| ------------------------------------------------------------------------- | ----------------- | ------ |
| [Linux kernel](https://git.kernel.org) | Kbuild (Make) | |
| [Vim-qt](https://bitbucket.org/equalsraf/vim-qt.git) | Autotools | |
| [Clementine](https://github.com/clementine-player/Clementine.git) | Cmake | |
| [ExtPlane](https://github.com/vranki/ExtPlane.git) | Qmake | Should be tested with both versions of Qt. |
| [OpenFOAM](https://github.com/OpenFOAM/OpenFOAM-3.0.x.git) | wmake | |
## License
YCM-Generator is published under the GNU GPLv3.

View file

@ -0,0 +1,502 @@
#!/usr/bin/env python2
import sys
import os
import os.path
import re
import argparse
import datetime
import multiprocessing
import shlex
import shutil
import tempfile
import time
import subprocess
import glob
# Default flags for make
default_make_flags = ["-i", "-j" + str(multiprocessing.cpu_count())]
# Set YCM-Generator directory
# Always obtain the real path to the directory where 'config_gen.py' lives as,
# in some cases, it will be a symlink placed in '/usr/bin' (as is the case
# with the Arch Linux AUR package) and it won't
# be able to find the plugin directory.
ycm_generator_dir = os.path.dirname(os.path.realpath(__file__))
def main():
# parse command-line args
parser = argparse.ArgumentParser(description="Automatically generates config files for YouCompleteMe")
parser.add_argument("-v", "--verbose", action="store_true", help="Show output from build process")
parser.add_argument("-f", "--force", action="store_true", help="Overwrite the file if it exists.")
parser.add_argument("-m", "--make", default="make", help="Use the specified executable for make.")
parser.add_argument("-b", "--build-system", choices=["cmake", "autotools", "qmake", "make"], help="Force use of the specified build system rather than trying to autodetect.")
parser.add_argument("-c", "--compiler", help="Use the specified executable for clang. It should be the same version as the libclang used by YCM. The executable for clang++ will be inferred from this.")
parser.add_argument("-C", "--configure_opts", default="", help="Additional flags to pass to configure/cmake/etc. e.g. --configure_opts=\"--enable-FEATURE\"")
parser.add_argument("-F", "--format", choices=["ycm", "cc"], default="ycm", help="Format of output file (YouCompleteMe or color_coded). Default: ycm")
parser.add_argument("-M", "--make-flags", help="Flags to pass to make when fake-building. Default: -M=\"{}\"".format(" ".join(default_make_flags)))
parser.add_argument("-o", "--output", help="Save the config file as OUTPUT. Default: .ycm_extra_conf.py, or .color_coded if --format=cc.")
parser.add_argument("-x", "--language", choices=["c", "c++"], help="Only output flags for the given language. This defaults to whichever language has its compiler invoked the most.")
parser.add_argument("--out-of-tree", action="store_true", help="Build autotools projects out-of-tree. This is a no-op for other project types.")
parser.add_argument("--qt-version", choices=["4", "5"], default="5", help="Use the given Qt version for qmake. (Default: 5)")
parser.add_argument("-e", "--preserve-environment", action="store_true", help="Pass environment variables to build processes.")
parser.add_argument("PROJECT_DIR", help="The root directory of the project.")
args = vars(parser.parse_args())
project_dir = os.path.abspath(args["PROJECT_DIR"])
# verify that project_dir exists
if(not os.path.exists(project_dir)):
print("ERROR: '{}' does not exist".format(project_dir))
return 1
# verify the clang is installed, and infer the correct name for both the C and C++ compilers
try:
cc = args["compiler"] or "clang"
args["cc"] = subprocess.check_output(["which", cc]).strip()
except subprocess.CalledProcessError:
print("ERROR: Could not find clang at '{}'. Please make sure it is installed and is either in your path, or specified with --compiler.".format(cc))
return 1
try:
h, t = os.path.split(args["compiler"] or "clang")
cxx = os.path.join(h, t.replace("clang", "clang++"))
args["cxx"] = subprocess.check_output(["which", cxx]).strip()
except subprocess.CalledProcessError:
print("ERROR: Could not find clang++ at '{}'. Please make sure it is installed and specified appropriately.".format(cxx))
return 1
# sanity check - remove this after we add Windows support
if(sys.platform.startswith("win32")):
print("ERROR: Windows is not supported")
# prompt user to overwrite existing file (if necessary)
config_file = {
None: args["output"],
"cc": os.path.join(project_dir, ".color_coded"),
"ycm": os.path.join(project_dir, ".ycm_extra_conf.py"),
}[args["format"] if args["output"] is None else None]
if(os.path.exists(config_file) and not args["force"]):
print("'{}' already exists. Overwrite? [y/N] ".format(config_file)),
response = sys.stdin.readline().strip().lower()
if(response != "y" and response != "yes"):
return 1
# command-line args to pass to fake_build() using kwargs
args["make_cmd"] = args.pop("make")
args["configure_opts"] = shlex.split(args["configure_opts"])
args["make_flags"] = default_make_flags if args["make_flags"] is None else shlex.split(args["make_flags"])
force_lang = args.pop("language")
output_format = args.pop("format")
del args["compiler"]
del args["force"]
del args["output"]
del args["PROJECT_DIR"]
generate_conf = {
"ycm": generate_ycm_conf,
"cc": generate_cc_conf,
}[output_format]
# temporary files to hold build logs
with tempfile.NamedTemporaryFile(mode="rw") as c_build_log:
with tempfile.NamedTemporaryFile(mode="rw") as cxx_build_log:
# perform the actual compilation of flags
fake_build(project_dir, c_build_log.name, cxx_build_log.name, **args)
(c_count, c_skip, c_flags) = parse_flags(c_build_log)
(cxx_count, cxx_skip, cxx_flags) = parse_flags(cxx_build_log)
print("Collected {} relevant entries for C compilation ({} discarded).".format(c_count, c_skip))
print("Collected {} relevant entries for C++ compilation ({} discarded).".format(cxx_count, cxx_skip))
# select the language to compile for. If -x was used, zero all other options (so we don't need to repeat the error code)
if(force_lang == "c"):
cxx_count = 0
elif(force_lang == "c++"):
c_count = 0
if(c_count == 0 and cxx_count == 0):
print("")
print("ERROR: No commands were logged to the build logs (C: {}, C++: {}).".format(c_build_log.name, cxx_build_log.name))
print("Your build system may not be compatible.")
if(not args["verbose"]):
print("")
print("Try running with the --verbose flag to see build system output - the most common cause of this is a hardcoded compiler path.")
c_build_log.delete = False
cxx_build_log.delete = False
return 3
elif(c_count > cxx_count):
lang, flags = ("c", c_flags)
else:
lang, flags = ("c++", cxx_flags)
generate_conf(["-x", lang] + flags, config_file)
print("Created {} config file with {} {} flags".format(output_format.upper(), len(flags), lang.upper()))
def fake_build(project_dir, c_build_log_path, cxx_build_log_path, verbose, make_cmd, build_system, cc, cxx, out_of_tree, configure_opts, make_flags, preserve_environment, qt_version):
'''Builds the project using the fake toolchain, to collect the compiler flags.
project_dir: the directory containing the source files
build_log_path: the file to log commands to
verbose: show the build process output
make_cmd: the path of the make executable
cc: the path of the clang executable
cxx: the path of the clang++ executable
out_of_tree: perform an out-of-tree build (autotools only)
configure_opts: additional flags for configure stage
make_flags: additional flags for make
preserve_environment: pass environment variables to build processes
qt_version: The Qt version to use when building with qmake.
'''
# TODO: add Windows support
assert(not sys.platform.startswith("win32"))
fake_path = os.path.join(ycm_generator_dir, "fake-toolchain", "Unix")
# environment variables and arguments for build process
started = time.time()
FNULL = open(os.devnull, "w")
proc_opts = {} if verbose else {
"stdin": FNULL,
"stdout": FNULL,
"stderr": FNULL
}
proc_opts["cwd"] = project_dir
if(preserve_environment):
env = os.environ
else:
# Preserve HOME, since Cmake needs it to find some packages and it's
# normally there anyway. See #26.
env = dict(map(lambda x: (x, os.environ[x]), ["HOME"]))
env["PATH"] = "{}:{}".format(fake_path, os.environ["PATH"])
env["CC"] = "clang"
env["CXX"] = "clang++"
env["YCM_CONFIG_GEN_CC_LOG"] = c_build_log_path
env["YCM_CONFIG_GEN_CXX_LOG"] = cxx_build_log_path
# used during configuration stage, so that cmake, etc. can verify what the compiler supports
env_config = env.copy()
env_config["YCM_CONFIG_GEN_CC_PASSTHROUGH"] = cc
env_config["YCM_CONFIG_GEN_CXX_PASSTHROUGH"] = cxx
# use -i (ignore errors), since the makefile may include scripts which
# depend upon the existence of various output files
make_args = [make_cmd] + make_flags
# Used for the qmake build system below
pro_files = glob.glob(os.path.join(project_dir, "*.pro"))
# sanity check - make sure the toolchain is available
assert os.path.exists(fake_path), "Could not find toolchain at '{}'".format(fake_path)
# helper function to display exact commands used
def run(cmd, *args, **kwargs):
print("$ " + " ".join(cmd))
subprocess.call(cmd, *args, **kwargs)
if build_system is None:
if os.path.exists(os.path.join(project_dir, "CMakeLists.txt")):
build_system = "cmake"
elif os.path.exists(os.path.join(project_dir, "configure")):
build_system = "autotools"
elif pro_files:
build_system = "qmake"
elif any([os.path.exists(os.path.join(project_dir, x)) for x in ["GNUmakefile", "makefile", "Makefile"]]):
build_system = "make"
# execute the build system
if build_system == "cmake":
# cmake
# run cmake in a temporary directory, then compile the project as usual
build_dir = tempfile.mkdtemp()
proc_opts["cwd"] = build_dir
# if the project was built in-tree, we need to hide the cache file so that cmake
# populates the build dir instead of just re-generating the existing files
cache_path = os.path.join(project_dir, "CMakeCache.txt")
if(os.path.exists(cache_path)):
fd, cache_tmp = tempfile.mkstemp()
os.close(fd)
shutil.move(cache_path, cache_tmp)
else:
cache_tmp = None
print("Running cmake in '{}'...".format(build_dir))
sys.stdout.flush()
run(["cmake", project_dir] + configure_opts, env=env_config, **proc_opts)
print("\nRunning make...")
sys.stdout.flush()
run(make_args, env=env, **proc_opts)
print("\nCleaning up...")
print("")
sys.stdout.flush()
shutil.rmtree(build_dir)
if(cache_tmp):
shutil.move(cache_tmp, cache_path)
elif build_system == "autotools":
# autotools
# perform build in-tree, since not all projects handle out-of-tree builds correctly
if(out_of_tree):
build_dir = tempfile.mkdtemp()
proc_opts["cwd"] = build_dir
print("Configuring autotools in '{}'...".format(build_dir))
else:
print("Configuring autotools...")
run([os.path.join(project_dir, "configure")] + configure_opts, env=env_config, **proc_opts)
print("\nRunning make...")
run(make_args, env=env, **proc_opts)
print("\nCleaning up...")
if(out_of_tree):
print("")
shutil.rmtree(build_dir)
else:
run([make_cmd, "maintainer-clean"], env=env, **proc_opts)
elif build_system == "qmake":
# qmake
# make sure there is only one .pro file
if len(pro_files) != 1:
print("ERROR: Found {} .pro files (expected one): {}.".format(
len(pro_files), ', '.join(pro_files)))
sys.exit(1)
# run qmake in a temporary directory, then compile the project as usual
build_dir = tempfile.mkdtemp()
proc_opts["cwd"] = build_dir
env_config["QT_SELECT"] = qt_version
# QMAKESPEC is platform dependent - valid mkspecs are in
# /usr/share/qt4/mkspecs, /usr/lib64/qt5/mkspecs
env_config["QMAKESPEC"] = {
("Linux", True): "unsupported/linux-clang",
("Linux", False): "linux-clang",
("Darwin", True): "unsupported/macx-clang",
("Darwin", False): "macx-clang",
("FreeBSD", False): "unsupported/freebsd-clang",
}[(os.uname()[0], qt_version == "4")]
print("Running qmake in '{}' with Qt {}...".format(build_dir, qt_version))
run(["qmake"] + configure_opts + [pro_files[0]], env=env_config,
**proc_opts)
print("\nRunning make...")
run(make_args, env=env, **proc_opts)
print("\nCleaning up...")
print("")
shutil.rmtree(build_dir)
elif build_system == "make":
# make
# needs to be handled last, since other build systems can generate Makefiles
print("Preparing build directory...")
run([make_cmd, "clean"], env=env, **proc_opts)
print("\nRunning make...")
run(make_args, env=env, **proc_opts)
elif(os.path.exists(os.path.join(project_dir, "Make/options"))):
print("Found OpenFOAM Make/options")
# OpenFOAM build system
make_args = ["wmake"]
# Since icpc could not find directory in which g++ resides,
# set environmental variables to gcc to make fake_build operate normally.
env['WM_COMPILER']='Gcc'
env['WM_CC']='gcc'
env['WM_CXX']='g++'
print("\nRunning wmake...")
run(make_args, env=env, **proc_opts)
else:
print("ERROR: Unknown build system")
sys.exit(2)
print("Build completed in {} sec".format(round(time.time() - started, 2)))
print("")
def parse_flags(build_log):
'''Creates a list of compiler flags from the build log.
build_log: an iterator of lines
Returns: (line_count, skip_count, flags)
flags is a list, and the counts are integers
'''
# Used to ignore entries which result in temporary files, or don't fully
# compile the file
temp_output = re.compile("(-x assembler)|(-o ([a-zA-Z0-9._].tmp))|(/dev/null)")
skip_count = 0
# Flags we want:
# -includes (-i, -I)
# -defines (-D)
# -warnings (-Werror), but no assembler, etc. flags (-Wa,-option)
# -language (-std=gnu99) and standard library (-nostdlib)
# -word size (-m64)
flags_whitelist = ["-[iIDF].*", "-W[^,]*", "-std=[a-z0-9+]+", "-(no)?std(lib|inc)", "-m[0-9]+"]
flags_whitelist = re.compile("|".join(map("^{}$".format, flags_whitelist)))
flags = set()
line_count = 0
# macro definitions should be handled separately, so we can resolve duplicates
define_flags = dict()
define_regex = re.compile("-D([a-zA-Z0-9_]+)=(.*)")
# Used to only bundle filenames with applicable arguments
filename_flags = ["-o", "-I", "-isystem", "-iquote", "-include", "-imacros", "-isysroot"]
# Process build log
for line in build_log:
if(temp_output.search(line)):
skip_count += 1
continue
line_count += 1
words = split_flags(line)
for (i, word) in enumerate(words):
if(word[0] != '-' or not flags_whitelist.match(word)):
continue
# handle macro definitions
m = define_regex.match(word)
if(m):
if(m.group(1) not in define_flags):
define_flags[m.group(1)] = [m.group(2)]
elif(m.group(2) not in define_flags[m.group(1)]):
define_flags[m.group(1)].append(m.group(2))
continue
# include arguments for this option, if there are any, as a tuple
if(i != len(words) - 1 and word in filename_flags and words[i + 1][0] != '-'):
flags.add((word, words[i + 1]))
else:
flags.add(word)
# Only specify one word size (the largest)
# (Different sizes are used for different files in the linux kernel.)
mRegex = re.compile("^-m[0-9]+$")
word_flags = list([f for f in flags if isinstance(f, basestring) and mRegex.match(f)])
if(len(word_flags) > 1):
for flag in word_flags:
flags.remove(flag)
flags.add(max(word_flags))
# Resolve duplicate macro definitions (always choose the last value for consistency)
for name, values in define_flags.iteritems():
if(len(values) > 1):
print("WARNING: {} distinct definitions of macro {} found".format(len(values), name))
values.sort()
flags.add("-D{}={}".format(name, values[0]))
return (line_count, skip_count, sorted(flags))
def generate_cc_conf(flags, config_file):
'''Generates the .color_coded file
flags: the list of flags
config_file: the path to save the configuration file at'''
with open(config_file, "w") as output:
for flag in flags:
if(isinstance(flag, basestring)):
output.write(flag + "\n")
else: # is tuple
for f in flag:
output.write(f + "\n")
def generate_ycm_conf(flags, config_file):
'''Generates the .ycm_extra_conf.py.
flags: the list of flags
config_file: the path to save the configuration file at'''
template_file = os.path.join(ycm_generator_dir, "template.py")
with open(template_file, "r") as template:
with open(config_file, "w") as output:
output.write("# Generated by YCM Generator at {}\n\n".format(str(datetime.datetime.today())))
for line in template:
if(line == " # INSERT FLAGS HERE\n"):
# insert generated code
for flag in flags:
if(isinstance(flag, basestring)):
output.write(" '{}',\n".format(flag))
else: # is tuple
output.write(" '{}', '{}',\n".format(*flag))
else:
# copy template
output.write(line)
def split_flags(line):
'''Helper method that splits a string into flags.
Flags are space-seperated, except for spaces enclosed in quotes.
Returns a list of flags'''
# Pass 1: split line using whitespace
words = line.strip().split()
# Pass 2: merge words so that the no. of quotes is balanced
res = []
for w in words:
if(len(res) > 0 and unbalanced_quotes(res[-1])):
res[-1] += " " + w
else:
res.append(w)
return res
def unbalanced_quotes(s):
'''Helper method that returns True if the no. of single or double quotes in s is odd.'''
single = 0
double = 0
for c in s:
if(c == "'"):
single += 1
elif(c == '"'):
double += 1
return (single % 2 == 1 or double % 2 == 1)
if(__name__ == "__main__"):
# Note that sys.exit() lets us use None and 0 interchangably
sys.exit(main())

View file

@ -0,0 +1,4 @@
#!/bin/sh
# This script is needed because /bin/true does not exist on non-FHS-compliant distros. e.g. NixOS
exit 0

View file

@ -0,0 +1,4 @@
#!/bin/sh
# This script is needed because /bin/true does not exist on non-FHS-compliant distros. e.g. NixOS
exit 0

View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ ! -z "$YCM_CONFIG_GEN_CC_PASSTHROUGH" ]; then
# Cmake determines compiler properties by compiling a test file, so call clang for this case
$YCM_CONFIG_GEN_CC_PASSTHROUGH $@
elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
# Needed to enable clang-specific options for certain build systems (e.g. linux)
$YCM_CONFIG_GEN_CC_PASSTHROUGH $@
else
echo "$@" >> $YCM_CONFIG_GEN_CC_LOG
fi

View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ ! -z "$YCM_CONFIG_GEN_CC_PASSTHROUGH" ]; then
# Cmake determines compiler properties by compiling a test file, so call clang for this case
$YCM_CONFIG_GEN_CC_PASSTHROUGH $@
elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
# Needed to enable clang-specific options for certain build systems (e.g. linux)
$YCM_CONFIG_GEN_CC_PASSTHROUGH $@
else
echo "$@" >> $YCM_CONFIG_GEN_CC_LOG
fi

View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ ! -z "$YCM_CONFIG_GEN_CC_PASSTHROUGH" ]; then
# Cmake determines compiler properties by compiling a test file, so call clang for this case
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
# Needed to enable clang-specific options for certain build systems (e.g. linux)
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
else
echo "$@" >> $YCM_CONFIG_GEN_CXX_LOG
fi

View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ ! -z "$YCM_CONFIG_GEN_CC_PASSTHROUGH" ]; then
# Cmake determines compiler properties by compiling a test file, so call clang for this case
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
# Needed to enable clang-specific options for certain build systems (e.g. linux)
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
else
echo "$@" >> $YCM_CONFIG_GEN_CXX_LOG
fi

View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ ! -z "$YCM_CONFIG_GEN_CC_PASSTHROUGH" ]; then
# Cmake determines compiler properties by compiling a test file, so call clang for this case
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
# Needed to enable clang-specific options for certain build systems (e.g. linux)
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
else
echo "$@" >> $YCM_CONFIG_GEN_CXX_LOG
fi

View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ ! -z "$YCM_CONFIG_GEN_CC_PASSTHROUGH" ]; then
# Cmake determines compiler properties by compiling a test file, so call clang for this case
$YCM_CONFIG_GEN_CC_PASSTHROUGH $@
elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
# Needed to enable clang-specific options for certain build systems (e.g. linux)
$YCM_CONFIG_GEN_CC_PASSTHROUGH $@
else
echo "$@" >> $YCM_CONFIG_GEN_CC_LOG
fi

View file

@ -0,0 +1,14 @@
#!/bin/sh
if [ ! -z "$YCM_CONFIG_GEN_CC_PASSTHROUGH" ]; then
# Cmake determines compiler properties by compiling a test file, so call clang for this case
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
# Needed to enable clang-specific options for certain build systems (e.g. linux)
$YCM_CONFIG_GEN_CXX_PASSTHROUGH $@
else
echo "$@" >> $YCM_CONFIG_GEN_CXX_LOG
fi

View file

@ -0,0 +1,4 @@
#!/bin/sh
# This script is needed because /bin/true does not exist on non-FHS-compliant distros. e.g. NixOS
exit 0

View file

@ -0,0 +1,4 @@
#!/bin/sh
# This script is needed because /bin/true does not exist on non-FHS-compliant distros. e.g. NixOS
exit 0

View file

@ -0,0 +1,4 @@
#!/bin/sh
# This script is needed because /bin/true does not exist on non-FHS-compliant distros. e.g. NixOS
exit 0

View file

@ -0,0 +1,23 @@
let s:config_gen = expand("<sfile>:p:h:h") . "/config_gen.py"
command! -nargs=? -complete=file_in_path -bang CCGenerateConfig call s:GenerateConfig("cc", <bang>0, "<args>")
command! -nargs=? -complete=file_in_path -bang YcmGenerateConfig call s:GenerateConfig("ycm", <bang>0, "<args>")
function! s:GenerateConfig(fmt, overwrite, flags)
let l:cmd = "! " . s:config_gen . " -F " . a:fmt . " " . a:flags
if a:overwrite
let l:cmd = l:cmd . " -f"
endif
" Only append the working directory if the last option is a flag
let l:split_flags = split(a:flags)
if len(l:split_flags) == 0 || l:split_flags[-1] =~ "^-"
let l:cmd = l:cmd . " " . shellescape(getcwd())
endif
" Disable interactive prompts for consistency with Neovim
execute l:cmd . " </dev/null"
endfunction

View file

@ -0,0 +1,142 @@
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# For more information, please refer to <http://unlicense.org/>
import os
import ycm_core
flags = [
# INSERT FLAGS HERE
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# You can get CMake to generate this file for you by adding:
# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
# to your CMakeLists.txt file.
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
SOURCE_EXTENSIONS = [ '.C', '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.H', '.h', '.hxx', '.hpp', '.hh' ]
def GetCompilationInfoForFile( filename ):
# The compilation_commands.json file generated by CMake does not have entries
# for header files. So we do our best by asking the db for flags for a
# corresponding source file, if any. If one exists, the flags for that file
# should be good enough.
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
compilation_info = database.GetCompilationInfoForFile(
replacement_file )
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile( filename )
def FlagsForFile( filename, **kwargs ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = GetCompilationInfoForFile( filename )
if not compilation_info:
return None
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}
def Settings( **kwargs ):
language = kwargs[ 'language' ]
if language == 'cfamily':
return {
'flags': flags
}
return {}

@ -0,0 +1 @@
Subproject commit fa0263d456dd43f5926484d1c4c7022dfcb21ba9000000000000000000000000

View file

@ -0,0 +1,27 @@
# Copyright (c) 2016-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the license file.
# Configurations for EditorConfig.
# See https://editorconfig.org/#file-format-details for more details.
# +--------------------+
# + Base Configuration +
# +--------------------+
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 160
trim_trailing_whitespace = true
# +-----------+
# + Languages +
# +-----------+
# +--- Markdown ---+
[*.{md}]
max_line_length = off
trim_trailing_whitespace = false

View file

@ -0,0 +1,12 @@
# Copyright (c) 2016-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the license file.
# Configuration to define attributes per path.
#
# References:
# 1. https://git-scm.com/docs/gitattributes
# 2. https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion
# Automatically perform line feed (LF) normalization for files detected as text and
# leave all files detected as binary untouched.
* text=auto eol=lf

View file

@ -0,0 +1,14 @@
# Copyright (c) 2016-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the license file.
# Configuration for the GitHub feature to automatically request reviews from the code owners
# when a pull request changes any owned files.
#
# References:
# 1. https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location
# 2. https://github.com/blog/2392-introducing-code-owners
# +----------------------+
# + Core Team Code Owner +
# +----------------------+
* @svengreb

View file

@ -0,0 +1,10 @@
# Copyright (c) 2016-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the license file.
# Path match pattern to intentionally ignore untracked files and directories.
# See https://git-scm.com/docs/gitignore for more details.
# +---------+
# + Node.js +
# +---------+
**/node_modules/

View file

@ -0,0 +1,8 @@
# Copyright (c) 2016-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the license file.
# Configuration for the Git mail mapping feature to coalesce together commits by the same person in the shortlog,
# where their name and/or email address was spelled differently or has been changed.
# See https://git-scm.com/docs/git-shortlog#_mapping_authors for more details.
Sven Greb <development@svengreb.de>
Sven Greb <development@svengreb.de> <development@arcticicestudio.com>

View file

@ -0,0 +1,18 @@
# Copyright (c) 2016-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the license file.
# Configurations for npm.
# See https://docs.npmjs.com/cli/v7/configuring-npm/npmrc for more details.
# Only use a lockfile for single-consumer projects, like applications, but not for multi-consumer projects like
# libraries.
# It helps to pin dependency versions, improves the security through integrity checksums, prevents possible errors
# caused by updated transitive dependencies and allows to get deterministic build results, but it can hide problems in
# multi-consumer projects when any later versions of a used dependency, or its transitive dependencies, is not
# compatible with the own project anymore.
package-lock=true
# Do not resolve to the latest minor and patch updates.
# Automatically pin dependencies to exact versions instead of resolving to latest minor and patch updates.
# This prevents possible errors caused by updated transitive dependencies.
save-exact=true

View file

@ -0,0 +1,94 @@
" Copyright (c) 2016-present Sven Greb <development@svengreb.de>
" This source code is licensed under the MIT license found in the license file.
let s:nord_vim_version="0.19.0"
let g:airline#themes#nord#palette = {}
let s:nord0_gui = "#2E3440"
let s:nord1_gui = "#3B4252"
let s:nord2_gui = "#434C5E"
let s:nord3_gui = "#4C566A"
let s:nord4_gui = "#D8DEE9"
let s:nord5_gui = "#E5E9F0"
let s:nord6_gui = "#ECEFF4"
let s:nord7_gui = "#8FBCBB"
let s:nord8_gui = "#88C0D0"
let s:nord9_gui = "#81A1C1"
let s:nord10_gui = "#5E81AC"
let s:nord11_gui = "#BF616A"
let s:nord12_gui = "#D08770"
let s:nord13_gui = "#EBCB8B"
let s:nord14_gui = "#A3BE8C"
let s:nord15_gui = "#B48EAD"
let s:nord0_term = "NONE"
let s:nord1_term = "0"
let s:nord2_term = "NONE"
let s:nord4_term = "NONE"
let s:nord11_term = "1"
let s:nord14_term = "2"
let s:nord13_term = "3"
let s:nord9_term = "4"
let s:nord15_term = "5"
let s:nord8_term = "6"
let s:nord5_term = "7"
let s:nord3_term = "8"
let s:nord12_term = "11"
let s:nord10_term = "12"
let s:nord7_term = "14"
let s:nord6_term = "15"
let s:NMain = [s:nord1_gui, s:nord8_gui, s:nord1_term, s:nord8_term]
let s:NRight = [s:nord1_gui, s:nord9_gui, s:nord1_term, s:nord9_term]
let s:NMiddle = [s:nord5_gui, s:nord3_gui, s:nord5_term, s:nord3_term]
let s:NWarn = [s:nord1_gui, s:nord13_gui, s:nord3_term, s:nord13_term]
let s:NError = [s:nord0_gui, s:nord11_gui, s:nord1_term, s:nord11_term]
let g:airline#themes#nord#palette.normal = airline#themes#generate_color_map(s:NMain, s:NRight, s:NMiddle)
let g:airline#themes#nord#palette.normal.airline_warning = s:NWarn
let g:airline#themes#nord#palette.normal.airline_error = s:NError
let s:IMain = [s:nord1_gui, s:nord14_gui, s:nord1_term, s:nord6_term]
let s:IRight = [s:nord1_gui, s:nord9_gui, s:nord1_term, s:nord9_term]
let s:IMiddle = [s:nord5_gui, s:nord3_gui, s:nord5_term, s:nord3_term]
let s:IWarn = [s:nord1_gui, s:nord13_gui, s:nord3_term, s:nord13_term]
let s:IError = [s:nord0_gui, s:nord11_gui, s:nord1_term, s:nord11_term]
let g:airline#themes#nord#palette.insert = airline#themes#generate_color_map(s:IMain, s:IRight, s:IMiddle)
let g:airline#themes#nord#palette.insert.airline_warning = s:IWarn
let g:airline#themes#nord#palette.insert.airline_error = s:IError
let s:RMain = [s:nord1_gui, s:nord14_gui, s:nord1_term, s:nord14_term]
let s:RRight = [s:nord1_gui, s:nord9_gui, s:nord1_term, s:nord9_term]
let s:RMiddle = [s:nord5_gui, s:nord3_gui, s:nord5_term, s:nord3_term]
let s:RWarn = [s:nord1_gui, s:nord13_gui, s:nord3_term, s:nord13_term]
let s:RError = [s:nord0_gui, s:nord11_gui, s:nord1_term, s:nord11_term]
let g:airline#themes#nord#palette.replace = airline#themes#generate_color_map(s:RMain, s:RRight, s:RMiddle)
let g:airline#themes#nord#palette.replace.airline_warning = s:RWarn
let g:airline#themes#nord#palette.replace.airline_error = s:RError
let s:VMain = [s:nord1_gui, s:nord7_gui, s:nord1_term, s:nord7_term]
let s:VRight = [s:nord1_gui, s:nord9_gui, s:nord1_term, s:nord9_term]
let s:VMiddle = [s:nord5_gui, s:nord3_gui, s:nord5_term, s:nord3_term]
let s:VWarn = [s:nord1_gui, s:nord13_gui, s:nord3_term, s:nord13_term]
let s:VError = [s:nord0_gui, s:nord11_gui, s:nord1_term, s:nord11_term]
let g:airline#themes#nord#palette.visual = airline#themes#generate_color_map(s:VMain, s:VRight, s:VMiddle)
let g:airline#themes#nord#palette.visual.airline_warning = s:VWarn
let g:airline#themes#nord#palette.visual.airline_error = s:VError
let s:IAMain = [s:nord5_gui, s:nord3_gui, s:nord5_term, s:nord3_term]
let s:IARight = [s:nord5_gui, s:nord3_gui, s:nord5_term, s:nord3_term]
if g:nord_uniform_status_lines == 0
let s:IAMiddle = [s:nord5_gui, s:nord1_gui, s:nord5_term, s:nord1_term]
else
let s:IAMiddle = [s:nord5_gui, s:nord3_gui, s:nord5_term, s:nord3_term]
endif
let s:IAWarn = [s:nord1_gui, s:nord13_gui, s:nord3_term, s:nord13_term]
let s:IAError = [s:nord0_gui, s:nord11_gui, s:nord1_term, s:nord11_term]
let g:airline#themes#nord#palette.inactive = airline#themes#generate_color_map(s:IAMain, s:IARight, s:IAMiddle)
let g:airline#themes#nord#palette.inactive.airline_warning = s:IAWarn
let g:airline#themes#nord#palette.inactive.airline_error = s:IAError
let g:airline#themes#nord#palette.normal.airline_term = s:NMiddle
let g:airline#themes#nord#palette.insert.airline_term = s:IMiddle
let g:airline#themes#nord#palette.replace.airline_term = s:RMiddle
let g:airline#themes#nord#palette.visual.airline_term = s:VMiddle
let g:airline#themes#nord#palette.inactive.airline_term = s:IAMiddle

View file

@ -0,0 +1,43 @@
" Copyright (c) 2016-present Sven Greb <development@svengreb.de>
" This source code is licensed under the MIT license found in the license file.
let s:nord_vim_version="0.19.0"
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:nord0 = ["#2E3440", "NONE"]
let s:nord1 = ["#3B4252", 0]
let s:nord2 = ["#434C5E", "NONE"]
let s:nord3 = ["#4C566A", 8]
let s:nord4 = ["#D8DEE9", "NONE"]
let s:nord5 = ["#E5E9F0", 7]
let s:nord6 = ["#ECEFF4", 15]
let s:nord7 = ["#8FBCBB", 14]
let s:nord8 = ["#88C0D0", 6]
let s:nord9 = ["#81A1C1", 4]
let s:nord10 = ["#5E81AC", 12]
let s:nord11 = ["#BF616A", 1]
let s:nord12 = ["#D08770", 11]
let s:nord13 = ["#EBCB8B", 3]
let s:nord14 = ["#A3BE8C", 2]
let s:nord15 = ["#B48EAD", 5]
let s:p.normal.left = [ [ s:nord1, s:nord8 ], [ s:nord5, s:nord1 ] ]
let s:p.normal.middle = [ [ s:nord5, s:nord3 ] ]
let s:p.normal.right = [ [ s:nord5, s:nord1 ], [ s:nord5, s:nord1 ] ]
let s:p.normal.warning = [ [ s:nord1, s:nord13 ] ]
let s:p.normal.error = [ [ s:nord1, s:nord11 ] ]
let s:p.inactive.left = [ [ s:nord1, s:nord8 ], [ s:nord5, s:nord1 ] ]
let s:p.inactive.middle = g:nord_uniform_status_lines == 0 ? [ [ s:nord5, s:nord1 ] ] : [ [ s:nord5, s:nord3 ] ]
let s:p.inactive.right = [ [ s:nord5, s:nord1 ], [ s:nord5, s:nord1 ] ]
let s:p.insert.left = [ [ s:nord1, s:nord6 ], [ s:nord5, s:nord1 ] ]
let s:p.replace.left = [ [ s:nord1, s:nord13 ], [ s:nord5, s:nord1 ] ]
let s:p.visual.left = [ [ s:nord1, s:nord7 ], [ s:nord5, s:nord1 ] ]
let s:p.tabline.left = [ [ s:nord5, s:nord3 ] ]
let s:p.tabline.middle = [ [ s:nord5, s:nord3 ] ]
let s:p.tabline.right = [ [ s:nord5, s:nord3 ] ]
let s:p.tabline.tabsel = [ [ s:nord1, s:nord8 ] ]
let g:lightline#colorscheme#nord#palette = lightline#colorscheme#flatten(s:p)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,838 @@
" Copyright (c) 2016-present Sven Greb <development@svengreb.de>
" This source code is licensed under the MIT license found in the license file.
if version > 580
hi clear
if exists("syntax_on")
syntax reset
endif
endif
let g:colors_name = "nord"
let s:nord_vim_version="0.19.0"
set background=dark
let s:nord0_gui = "#2E3440"
let s:nord1_gui = "#3B4252"
let s:nord2_gui = "#434C5E"
let s:nord3_gui = "#4C566A"
let s:nord3_gui_bright = "#616E88"
let s:nord4_gui = "#D8DEE9"
let s:nord5_gui = "#E5E9F0"
let s:nord6_gui = "#ECEFF4"
let s:nord7_gui = "#8FBCBB"
let s:nord8_gui = "#88C0D0"
let s:nord9_gui = "#81A1C1"
let s:nord10_gui = "#5E81AC"
let s:nord11_gui = "#BF616A"
let s:nord12_gui = "#D08770"
let s:nord13_gui = "#EBCB8B"
let s:nord14_gui = "#A3BE8C"
let s:nord15_gui = "#B48EAD"
let s:nord1_term = "0"
let s:nord3_term = "8"
let s:nord5_term = "7"
let s:nord6_term = "15"
let s:nord7_term = "14"
let s:nord8_term = "6"
let s:nord9_term = "4"
let s:nord10_term = "12"
let s:nord11_term = "1"
let s:nord12_term = "11"
let s:nord13_term = "3"
let s:nord14_term = "2"
let s:nord15_term = "5"
let s:nord3_gui_brightened = [
\ s:nord3_gui,
\ "#4e586d",
\ "#505b70",
\ "#525d73",
\ "#556076",
\ "#576279",
\ "#59647c",
\ "#5b677f",
\ "#5d6982",
\ "#5f6c85",
\ "#616e88",
\ "#63718b",
\ "#66738e",
\ "#687591",
\ "#6a7894",
\ "#6d7a96",
\ "#6f7d98",
\ "#72809a",
\ "#75829c",
\ "#78859e",
\ "#7b88a1",
\ ]
let g:nord_bold = get(g:, "nord_bold", 1)
let s:bold = (g:nord_bold == 0) ? "" : "bold,"
let g:nord_underline = get(g:, "nord_underline", 1)
let s:underline = (g:nord_underline == 0) ? "NONE," : "underline,"
let g:nord_italic = get(g:, "nord_italic", (has("gui_running") || $TERM_ITALICS == "true"))
let s:italic = (g:nord_italic == 0) ? "" : "italic,"
let g:nord_italic_comments = get(g:, "nord_italic_comments", 0)
let s:italicize_comments = (g:nord_italic_comments == 0) ? "" : get(s:, "italic")
let g:nord_uniform_status_lines = get(g:, "nord_uniform_status_lines", 0)
let g:nord_bold_vertical_split_line = get(g:, "nord_bold_vertical_split_line", 0)
if exists("g:nord_comment_brightness")
echohl WarningMsg
echomsg 'nord: warning: Variable g:nord_comment_brightness has been deprecated and will be removed in version 1.0.0!' .
\' The comment color brightness has been increased by 10% by default.' .
\' Please see https://github.com/nordtheme/vim/issues/145 for more details.'
echohl None
let g:nord_comment_brightness = 10
endif
let g:nord_cursor_line_number_background = get(g:, "nord_cursor_line_number_background", 0)
let g:nord_uniform_diff_background = get(g:, "nord_uniform_diff_background", 0)
function! s:hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
let cmd = ""
if a:guifg != ""
let cmd = cmd . " guifg=" . a:guifg
endif
if a:guibg != ""
let cmd = cmd . " guibg=" . a:guibg
endif
if a:ctermfg != ""
let cmd = cmd . " ctermfg=" . a:ctermfg
endif
if a:ctermbg != ""
let cmd = cmd . " ctermbg=" . a:ctermbg
endif
if a:attr != ""
let cmd = cmd . " gui=" . a:attr . " cterm=" . substitute(a:attr, "undercurl", s:underline, "")
endif
if a:guisp != ""
let cmd = cmd . " guisp=" . a:guisp
endif
if cmd != ""
exec "hi " . a:group . cmd
endif
endfunction
"+---------------+
"+ UI Components +
"+---------------+
"+--- Attributes ---+
call s:hi("Bold", "", "", "", "", s:bold, "")
call s:hi("Italic", "", "", "", "", s:italic, "")
call s:hi("Underline", "", "", "", "", s:underline, "")
"+--- Editor ---+
call s:hi("ColorColumn", "", s:nord1_gui, "NONE", s:nord1_term, "", "")
call s:hi("Cursor", s:nord0_gui, s:nord4_gui, "", "NONE", "", "")
call s:hi("CursorLine", "", s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
call s:hi("Error", s:nord4_gui, s:nord11_gui, "", s:nord11_term, "", "")
call s:hi("iCursor", s:nord0_gui, s:nord4_gui, "", "NONE", "", "")
call s:hi("LineNr", s:nord3_gui, "NONE", s:nord3_term, "NONE", "", "")
call s:hi("MatchParen", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "", "")
call s:hi("NonText", s:nord2_gui, "", s:nord3_term, "", "", "")
call s:hi("Normal", s:nord4_gui, s:nord0_gui, "NONE", "NONE", "", "")
call s:hi("Pmenu", s:nord4_gui, s:nord2_gui, "NONE", s:nord1_term, "NONE", "")
call s:hi("PmenuSbar", s:nord4_gui, s:nord2_gui, "NONE", s:nord1_term, "", "")
call s:hi("PmenuSel", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "", "")
call s:hi("PmenuThumb", s:nord8_gui, s:nord3_gui, "NONE", s:nord3_term, "", "")
call s:hi("SpecialKey", s:nord3_gui, "", s:nord3_term, "", "", "")
call s:hi("SpellBad", s:nord11_gui, s:nord0_gui, s:nord11_term, "NONE", "undercurl", s:nord11_gui)
call s:hi("SpellCap", s:nord13_gui, s:nord0_gui, s:nord13_term, "NONE", "undercurl", s:nord13_gui)
call s:hi("SpellLocal", s:nord5_gui, s:nord0_gui, s:nord5_term, "NONE", "undercurl", s:nord5_gui)
call s:hi("SpellRare", s:nord6_gui, s:nord0_gui, s:nord6_term, "NONE", "undercurl", s:nord6_gui)
call s:hi("Visual", "", s:nord2_gui, "", s:nord1_term, "", "")
call s:hi("VisualNOS", "", s:nord2_gui, "", s:nord1_term, "", "")
"+- Vim 8 Terminal Colors -+
if has('terminal')
let g:terminal_ansi_colors = [s:nord1_gui, s:nord11_gui, s:nord14_gui, s:nord13_gui, s:nord9_gui, s:nord15_gui, s:nord8_gui, s:nord5_gui, s:nord3_gui, s:nord11_gui, s:nord14_gui, s:nord13_gui, s:nord9_gui, s:nord15_gui, s:nord7_gui, s:nord6_gui]
endif
if has('nvim')
"+- Neovim Terminal Colors -+
let g:terminal_color_0 = s:nord1_gui
let g:terminal_color_1 = s:nord11_gui
let g:terminal_color_2 = s:nord14_gui
let g:terminal_color_3 = s:nord13_gui
let g:terminal_color_4 = s:nord9_gui
let g:terminal_color_5 = s:nord15_gui
let g:terminal_color_6 = s:nord8_gui
let g:terminal_color_7 = s:nord5_gui
let g:terminal_color_8 = s:nord3_gui
let g:terminal_color_9 = s:nord11_gui
let g:terminal_color_10 = s:nord14_gui
let g:terminal_color_11 = s:nord13_gui
let g:terminal_color_12 = s:nord9_gui
let g:terminal_color_13 = s:nord15_gui
let g:terminal_color_14 = s:nord7_gui
let g:terminal_color_15 = s:nord6_gui
"+- Neovim Support -+
call s:hi("healthError", s:nord11_gui, s:nord1_gui, s:nord11_term, s:nord1_term, "", "")
call s:hi("healthSuccess", s:nord14_gui, s:nord1_gui, s:nord14_term, s:nord1_term, "", "")
call s:hi("healthWarning", s:nord13_gui, s:nord1_gui, s:nord13_term, s:nord1_term, "", "")
call s:hi("TermCursorNC", "", s:nord1_gui, "", s:nord1_term, "", "")
"+- Neovim Diagnostics API -+
call s:hi("DiagnosticWarn", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("DiagnosticError" , s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("DiagnosticInfo" , s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("DiagnosticHint" , s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("DiagnosticUnderlineWarn" , s:nord13_gui, "", s:nord13_term, "", "undercurl", "")
call s:hi("DiagnosticUnderlineError" , s:nord11_gui, "", s:nord11_term, "", "undercurl", "")
call s:hi("DiagnosticUnderlineInfo" , s:nord8_gui, "", s:nord8_term, "", "undercurl", "")
call s:hi("DiagnosticUnderlineHint" , s:nord10_gui, "", s:nord10_term, "", "undercurl", "")
"+- Neovim DocumentHighlight -+
call s:hi("LspReferenceText", "", s:nord3_gui, "", s:nord3_term, "", "")
call s:hi("LspReferenceRead", "", s:nord3_gui, "", s:nord3_term, "", "")
call s:hi("LspReferenceWrite", "", s:nord3_gui, "", s:nord3_term, "", "")
"+- Neovim LspSignatureHelp -+
call s:hi("LspSignatureActiveParameter", s:nord8_gui, "", s:nord8_term, "", s:underline, "")
endif
"+--- Gutter ---+
call s:hi("CursorColumn", "", s:nord1_gui, "NONE", s:nord1_term, "", "")
if g:nord_cursor_line_number_background == 0
call s:hi("CursorLineNr", s:nord4_gui, "", "NONE", "", "NONE", "")
else
call s:hi("CursorLineNr", s:nord4_gui, s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
endif
call s:hi("Folded", s:nord3_gui, s:nord1_gui, s:nord3_term, s:nord1_term, s:bold, "")
call s:hi("FoldColumn", s:nord3_gui, s:nord0_gui, s:nord3_term, "NONE", "", "")
call s:hi("SignColumn", s:nord1_gui, s:nord0_gui, s:nord1_term, "NONE", "", "")
"+--- Navigation ---+
call s:hi("Directory", s:nord8_gui, "", s:nord8_term, "NONE", "", "")
"+--- Prompt/Status ---+
call s:hi("EndOfBuffer", s:nord1_gui, "", s:nord1_term, "NONE", "", "")
call s:hi("ErrorMsg", s:nord4_gui, s:nord11_gui, "NONE", s:nord11_term, "", "")
call s:hi("ModeMsg", s:nord4_gui, "", "", "", "", "")
call s:hi("MoreMsg", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("Question", s:nord4_gui, "", "NONE", "", "", "")
if g:nord_uniform_status_lines == 0
call s:hi("StatusLine", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "NONE", "")
call s:hi("StatusLineNC", s:nord4_gui, s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
call s:hi("StatusLineTerm", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "NONE", "")
call s:hi("StatusLineTermNC", s:nord4_gui, s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
else
call s:hi("StatusLine", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "NONE", "")
call s:hi("StatusLineNC", s:nord4_gui, s:nord3_gui, "NONE", s:nord3_term, "NONE", "")
call s:hi("StatusLineTerm", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "NONE", "")
call s:hi("StatusLineTermNC", s:nord4_gui, s:nord3_gui, "NONE", s:nord3_term, "NONE", "")
endif
call s:hi("WarningMsg", s:nord0_gui, s:nord13_gui, s:nord1_term, s:nord13_term, "", "")
call s:hi("WildMenu", s:nord8_gui, s:nord1_gui, s:nord8_term, s:nord1_term, "", "")
"+--- Search ---+
call s:hi("IncSearch", s:nord6_gui, s:nord10_gui, s:nord6_term, s:nord10_term, s:underline, "")
call s:hi("Search", s:nord1_gui, s:nord8_gui, s:nord1_term, s:nord8_term, "NONE", "")
"+--- Tabs ---+
call s:hi("TabLine", s:nord4_gui, s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
call s:hi("TabLineFill", s:nord4_gui, s:nord1_gui, "NONE", s:nord1_term, "NONE", "")
call s:hi("TabLineSel", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, "NONE", "")
"+--- Window ---+
call s:hi("Title", s:nord4_gui, "", "NONE", "", "NONE", "")
if g:nord_bold_vertical_split_line == 0
call s:hi("VertSplit", s:nord2_gui, s:nord0_gui, s:nord3_term, "NONE", "NONE", "")
else
call s:hi("VertSplit", s:nord2_gui, s:nord1_gui, s:nord3_term, s:nord1_term, "NONE", "")
endif
"+----------------------+
"+ Language Base Groups +
"+----------------------+
call s:hi("Boolean", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Character", s:nord14_gui, "", s:nord14_term, "", "", "")
call s:hi("Comment", s:nord3_gui_bright, "", s:nord3_term, "", s:italicize_comments, "")
call s:hi("Conceal", "", "NONE", "", "NONE", "", "")
call s:hi("Conditional", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Constant", s:nord4_gui, "", "NONE", "", "", "")
call s:hi("Decorator", s:nord12_gui, "", s:nord12_term, "", "", "")
call s:hi("Define", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Delimiter", s:nord6_gui, "", s:nord6_term, "", "", "")
call s:hi("Exception", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Float", s:nord15_gui, "", s:nord15_term, "", "", "")
call s:hi("Function", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("Identifier", s:nord4_gui, "", "NONE", "", "NONE", "")
call s:hi("Include", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Keyword", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Label", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Number", s:nord15_gui, "", s:nord15_term, "", "", "")
call s:hi("Operator", s:nord9_gui, "", s:nord9_term, "", "NONE", "")
call s:hi("PreProc", s:nord9_gui, "", s:nord9_term, "", "NONE", "")
call s:hi("Repeat", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Special", s:nord4_gui, "", "NONE", "", "", "")
call s:hi("SpecialChar", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("SpecialComment", s:nord8_gui, "", s:nord8_term, "", s:italicize_comments, "")
call s:hi("Statement", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("StorageClass", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("String", s:nord14_gui, "", s:nord14_term, "", "", "")
call s:hi("Structure", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("Tag", s:nord4_gui, "", "", "", "", "")
call s:hi("Todo", s:nord13_gui, "NONE", s:nord13_term, "NONE", "", "")
call s:hi("Type", s:nord9_gui, "", s:nord9_term, "", "NONE", "")
call s:hi("Typedef", s:nord9_gui, "", s:nord9_term, "", "", "")
hi! link Annotation Decorator
hi! link Macro Define
hi! link PreCondit PreProc
hi! link Variable Identifier
"+-----------+
"+ Languages +
"+-----------+
call s:hi("asciidocAttributeEntry", s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("asciidocAttributeList", s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("asciidocAttributeRef", s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("asciidocHLabel", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("asciidocListingBlock", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("asciidocMacroAttributes", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("asciidocOneLineTitle", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("asciidocPassthroughBlock", s:nord9_gui, "", s:nord9_term, "", "", "")
call s:hi("asciidocQuotedMonospaced", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("asciidocTriplePlusPassthrough", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link asciidocAdmonition Keyword
hi! link asciidocAttributeRef markdownH1
hi! link asciidocBackslash Keyword
hi! link asciidocMacro Keyword
hi! link asciidocQuotedBold Bold
hi! link asciidocQuotedEmphasized Italic
hi! link asciidocQuotedMonospaced2 asciidocQuotedMonospaced
hi! link asciidocQuotedUnconstrainedBold asciidocQuotedBold
hi! link asciidocQuotedUnconstrainedEmphasized asciidocQuotedEmphasized
hi! link asciidocURL markdownLinkText
call s:hi("awkCharClass", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("awkPatterns", s:nord9_gui, "", s:nord9_term, "", s:bold, "")
hi! link awkArrayElement Identifier
hi! link awkBoolLogic Keyword
hi! link awkBrktRegExp SpecialChar
hi! link awkComma Delimiter
hi! link awkExpression Keyword
hi! link awkFieldVars Identifier
hi! link awkLineSkip Keyword
hi! link awkOperator Operator
hi! link awkRegExp SpecialChar
hi! link awkSearch Keyword
hi! link awkSemicolon Delimiter
hi! link awkSpecialCharacter SpecialChar
hi! link awkSpecialPrintf SpecialChar
hi! link awkVariables Identifier
call s:hi("cIncluded", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link cOperator Operator
hi! link cPreCondit PreCondit
hi! link cConstant Type
call s:hi("cmakeGeneratorExpression", s:nord10_gui, "", s:nord10_term, "", "", "")
hi! link csPreCondit PreCondit
hi! link csType Type
hi! link csXmlTag SpecialComment
call s:hi("cssAttributeSelector", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("cssDefinition", s:nord7_gui, "", s:nord7_term, "", "NONE", "")
call s:hi("cssIdentifier", s:nord7_gui, "", s:nord7_term, "", s:underline, "")
call s:hi("cssStringQ", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link cssAttr Keyword
hi! link cssBraces Delimiter
hi! link cssClassName cssDefinition
hi! link cssColor Number
hi! link cssProp cssDefinition
hi! link cssPseudoClass cssDefinition
hi! link cssPseudoClassId cssPseudoClass
hi! link cssVendor Keyword
call s:hi("dosiniHeader", s:nord8_gui, "", s:nord8_term, "", "", "")
hi! link dosiniLabel Type
call s:hi("dtBooleanKey", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("dtExecKey", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("dtLocaleKey", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("dtNumericKey", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("dtTypeKey", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link dtDelim Delimiter
hi! link dtLocaleValue Keyword
hi! link dtTypeValue Keyword
if g:nord_uniform_diff_background == 0
call s:hi("DiffAdd", s:nord14_gui, s:nord0_gui, s:nord14_term, "NONE", "inverse", "")
call s:hi("DiffChange", s:nord13_gui, s:nord0_gui, s:nord13_term, "NONE", "inverse", "")
call s:hi("DiffDelete", s:nord11_gui, s:nord0_gui, s:nord11_term, "NONE", "inverse", "")
call s:hi("DiffText", s:nord9_gui, s:nord0_gui, s:nord9_term, "NONE", "inverse", "")
else
call s:hi("DiffAdd", s:nord14_gui, s:nord1_gui, s:nord14_term, s:nord1_term, "", "")
call s:hi("DiffChange", s:nord13_gui, s:nord1_gui, s:nord13_term, s:nord1_term, "", "")
call s:hi("DiffDelete", s:nord11_gui, s:nord1_gui, s:nord11_term, s:nord1_term, "", "")
call s:hi("DiffText", s:nord9_gui, s:nord1_gui, s:nord9_term, s:nord1_term, "", "")
endif
" Legacy groups for official git.vim and diff.vim syntax
hi! link diffAdded DiffAdd
hi! link diffChanged DiffChange
hi! link diffRemoved DiffDelete
call s:hi("gitconfigVariable", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("goBuiltins", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link goConstants Keyword
call s:hi("helpBar", s:nord3_gui, "", s:nord3_term, "", "", "")
call s:hi("helpHyperTextJump", s:nord8_gui, "", s:nord8_term, "", s:underline, "")
call s:hi("htmlArg", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("htmlLink", s:nord4_gui, "", "", "", "NONE", "NONE")
hi! link htmlBold Bold
hi! link htmlEndTag htmlTag
hi! link htmlItalic Italic
hi! link htmlH1 markdownH1
hi! link htmlH2 markdownH1
hi! link htmlH3 markdownH1
hi! link htmlH4 markdownH1
hi! link htmlH5 markdownH1
hi! link htmlH6 markdownH1
hi! link htmlSpecialChar SpecialChar
hi! link htmlTag Keyword
hi! link htmlTagN htmlTag
call s:hi("javaDocTags", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link javaCommentTitle Comment
hi! link javaScriptBraces Delimiter
hi! link javaScriptIdentifier Keyword
hi! link javaScriptNumber Number
call s:hi("jsonKeyword", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("lessClass", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link lessAmpersand Keyword
hi! link lessCssAttribute Delimiter
hi! link lessFunction Function
hi! link cssSelectorOp Keyword
hi! link lispAtomBarSymbol SpecialChar
hi! link lispAtomList SpecialChar
hi! link lispAtomMark Keyword
hi! link lispBarSymbol SpecialChar
hi! link lispFunc Function
hi! link luaFunc Function
call s:hi("markdownBlockquote", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("markdownCode", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("markdownCodeDelimiter", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("markdownFootnote", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("markdownId", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("markdownIdDeclaration", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("markdownH1", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("markdownLinkText", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("markdownUrl", s:nord4_gui, "", "NONE", "", "NONE", "")
hi! link markdownBold Bold
hi! link markdownBoldDelimiter Keyword
hi! link markdownFootnoteDefinition markdownFootnote
hi! link markdownH2 markdownH1
hi! link markdownH3 markdownH1
hi! link markdownH4 markdownH1
hi! link markdownH5 markdownH1
hi! link markdownH6 markdownH1
hi! link markdownIdDelimiter Keyword
hi! link markdownItalic Italic
hi! link markdownItalicDelimiter Keyword
hi! link markdownLinkDelimiter Keyword
hi! link markdownLinkTextDelimiter Keyword
hi! link markdownListMarker Keyword
hi! link markdownRule Keyword
hi! link markdownHeadingDelimiter Keyword
call s:hi("perlPackageDecl", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("phpClasses", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("phpDocTags", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link phpDocCustomTags phpDocTags
hi! link phpMemberSelector Keyword
call s:hi("podCmdText", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("podVerbatimLine", s:nord4_gui, "", "NONE", "", "", "")
hi! link podFormat Keyword
hi! link pythonBuiltin Type
hi! link pythonEscape SpecialChar
call s:hi("rubyConstant", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("rubySymbol", s:nord6_gui, "", s:nord6_term, "", s:bold, "")
hi! link rubyAttribute Identifier
hi! link rubyBlockParameterList Operator
hi! link rubyInterpolationDelimiter Keyword
hi! link rubyKeywordAsMethod Function
hi! link rubyLocalVariableOrMethod Function
hi! link rubyPseudoVariable Keyword
hi! link rubyRegexp SpecialChar
call s:hi("rustAttribute", s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("rustEnum", s:nord7_gui, "", s:nord7_term, "", s:bold, "")
call s:hi("rustMacro", s:nord8_gui, "", s:nord8_term, "", s:bold, "")
call s:hi("rustModPath", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("rustPanic", s:nord9_gui, "", s:nord9_term, "", s:bold, "")
call s:hi("rustTrait", s:nord7_gui, "", s:nord7_term, "", s:italic, "")
hi! link rustCommentLineDoc Comment
hi! link rustDerive rustAttribute
hi! link rustEnumVariant rustEnum
hi! link rustEscape SpecialChar
hi! link rustQuestionMark Keyword
call s:hi("sassClass", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("sassId", s:nord7_gui, "", s:nord7_term, "", s:underline, "")
hi! link sassAmpersand Keyword
hi! link sassClassChar Delimiter
hi! link sassControl Keyword
hi! link sassControlLine Keyword
hi! link sassExtend Keyword
hi! link sassFor Keyword
hi! link sassFunctionDecl Keyword
hi! link sassFunctionName Function
hi! link sassidChar sassId
hi! link sassInclude SpecialChar
hi! link sassMixinName Function
hi! link sassMixing SpecialChar
hi! link sassReturn Keyword
hi! link shCmdParenRegion Delimiter
hi! link shCmdSubRegion Delimiter
hi! link shDerefSimple Identifier
hi! link shDerefVar Identifier
hi! link sqlKeyword Keyword
hi! link sqlSpecial Keyword
call s:hi("vimAugroup", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("vimMapRhs", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("vimNotation", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link vimFunc Function
hi! link vimFunction Function
hi! link vimUserFunc Function
call s:hi("xmlAttrib", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("xmlCdataStart", s:nord3_gui_bright, "", s:nord3_term, "", s:bold, "")
call s:hi("xmlNamespace", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link xmlAttribPunct Delimiter
hi! link xmlCdata Comment
hi! link xmlCdataCdata xmlCdataStart
hi! link xmlCdataEnd xmlCdataStart
hi! link xmlEndTag xmlTagName
hi! link xmlProcessingDelim Keyword
hi! link xmlTagName Keyword
call s:hi("yamlBlockMappingKey", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link yamlBool Keyword
hi! link yamlDocumentStart Keyword
"+----------------+
"+ Plugin Support +
"+----------------+
"+--- UI ---+
" ALE
" > w0rp/ale
call s:hi("ALEWarningSign", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("ALEErrorSign" , s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("ALEWarning" , s:nord13_gui, "", s:nord13_term, "", "undercurl", "")
call s:hi("ALEError" , s:nord11_gui, "", s:nord11_term, "", "undercurl", "")
" Coc
" > neoclide/coc.vim
call s:hi("CocWarningHighlight" , s:nord13_gui, "", s:nord13_term, "", "undercurl", "")
call s:hi("CocErrorHighlight" , s:nord11_gui, "", s:nord11_term, "", "undercurl", "")
call s:hi("CocWarningSign", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("CocErrorSign" , s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("CocInfoSign" , s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("CocHintSign" , s:nord10_gui, "", s:nord10_term, "", "", "")
if has('nvim')
" Neovim LSP
" > neovim/nvim-lspconfig
call s:hi("LspCodeLens", s:nord3_gui_bright, "", s:nord3_term, "", "", "")
if has("nvim-0.5")
call s:hi("LspDiagnosticsDefaultWarning", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("LspDiagnosticsDefaultError" , s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("LspDiagnosticsDefaultInformation" , s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("LspDiagnosticsDefaultHint" , s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("LspDiagnosticsUnderlineWarning" , s:nord13_gui, "", s:nord13_term, "", "undercurl", "")
call s:hi("LspDiagnosticsUnderlineError" , s:nord11_gui, "", s:nord11_term, "", "undercurl", "")
call s:hi("LspDiagnosticsUnderlineInformation" , s:nord8_gui, "", s:nord8_term, "", "undercurl", "")
call s:hi("LspDiagnosticsUnderlineHint" , s:nord10_gui, "", s:nord10_term, "", "undercurl", "")
endif
" Gitsigns
" > lewis6991/gitsigns.nvim
hi! link GitSignsCurrentLineBlame Comment
endif
" GitGutter
" > airblade/vim-gitgutter
call s:hi("GitGutterAdd", s:nord14_gui, "", s:nord14_term, "", "", "")
call s:hi("GitGutterChange", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("GitGutterChangeDelete", s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("GitGutterDelete", s:nord11_gui, "", s:nord11_term, "", "", "")
" Signify
" > mhinz/vim-signify
call s:hi("SignifySignAdd", s:nord14_gui, "", s:nord14_term, "", "", "")
call s:hi("SignifySignChange", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("SignifySignChangeDelete", s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("SignifySignDelete", s:nord11_gui, "", s:nord11_term, "", "", "")
" Sneak
" > justinmk/vim-sneak
hi! link Sneak Search
" fugitive.vim
" > tpope/vim-fugitive
call s:hi("gitcommitDiscardedFile", s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("gitcommitUntrackedFile", s:nord11_gui, "", s:nord11_term, "", "", "")
call s:hi("gitcommitSelectedFile", s:nord14_gui, "", s:nord14_term, "", "", "")
" davidhalter/jedi-vim
call s:hi("jediFunction", s:nord4_gui, s:nord3_gui, "", s:nord3_term, "", "")
call s:hi("jediFat", s:nord8_gui, s:nord3_gui, s:nord8_term, s:nord3_term, s:underline.s:bold, "")
" NERDTree
" > scrooloose/nerdtree
call s:hi("NERDTreeExecFile", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link NERDTreeDirSlash Keyword
hi! link NERDTreeHelp Comment
" CtrlP
" > ctrlpvim/ctrlp.vim
hi! link CtrlPMatch Keyword
hi! link CtrlPBufferHid Normal
" vim-clap
" > liuchengxu/vim-clap
call s:hi("ClapDir", s:nord4_gui, "", "", "", "", "")
call s:hi("ClapDisplay", s:nord4_gui, s:nord1_gui, "", s:nord1_term, "", "")
call s:hi("ClapFile", s:nord4_gui, "", "", "NONE", "", "")
call s:hi("ClapMatches", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("ClapNoMatchesFound", s:nord13_gui, "", s:nord13_term, "", "", "")
call s:hi("ClapSelected", s:nord7_gui, "", s:nord7_term, "", s:bold, "")
call s:hi("ClapSelectedSign", s:nord9_gui, "", s:nord9_term, "", "", "")
let s:clap_matches = [
\ [s:nord8_gui, s:nord8_term] ,
\ [s:nord9_gui, s:nord9_term] ,
\ [s:nord10_gui, s:nord10_term] ,
\ ]
for s:nord_clap_match_i in range(1,12)
let clap_match_color = s:clap_matches[s:nord_clap_match_i % len(s:clap_matches) - 1]
call s:hi("ClapMatches" . s:nord_clap_match_i, clap_match_color[0], "", clap_match_color[1], "", "", "")
call s:hi("ClapFuzzyMatches" . s:nord_clap_match_i, clap_match_color[0], "", clap_match_color[1], "", "", "")
endfor
unlet s:nord_clap_match_i
hi! link ClapCurrentSelection PmenuSel
hi! link ClapCurrentSelectionSign ClapSelectedSign
hi! link ClapInput Pmenu
hi! link ClapPreview Pmenu
hi! link ClapProviderAbout ClapDisplay
hi! link ClapProviderColon Type
hi! link ClapProviderId Type
" vim-indent-guides
" > nathanaelkane/vim-indent-guides
call s:hi("IndentGuidesEven", "", s:nord1_gui, "", s:nord1_term, "", "")
call s:hi("IndentGuidesOdd", "", s:nord2_gui, "", s:nord3_term, "", "")
" vim-plug
" > junegunn/vim-plug
call s:hi("plugDeleted", s:nord11_gui, "", "", s:nord11_term, "", "")
" vim-signature
" > kshenoy/vim-signature
call s:hi("SignatureMarkText", s:nord8_gui, "", s:nord8_term, "", "", "")
" vim-startify
" > mhinz/vim-startify
call s:hi("StartifyFile", s:nord6_gui, "", s:nord6_term, "", "", "")
call s:hi("StartifyFooter", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("StartifyHeader", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("StartifyNumber", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("StartifyPath", s:nord8_gui, "", s:nord8_term, "", "", "")
hi! link StartifyBracket Delimiter
hi! link StartifySlash Normal
hi! link StartifySpecial Comment
"+--- Languages ---+
" Haskell
" > neovimhaskell/haskell-vim
call s:hi("haskellPreProc", s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("haskellType", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link haskellPragma haskellPreProc
" JavaScript
" > pangloss/vim-javascript
call s:hi("jsGlobalNodeObjects", s:nord8_gui, "", s:nord8_term, "", s:italic, "")
hi! link jsBrackets Delimiter
hi! link jsFuncCall Function
hi! link jsFuncParens Delimiter
hi! link jsThis Keyword
hi! link jsNoise Delimiter
hi! link jsPrototype Keyword
hi! link jsRegexpString SpecialChar
" Pandoc
" > vim-pandoc/vim-pandoc-syntax
call s:hi("pandocDefinitionBlockTerm", s:nord7_gui, "", s:nord7_term, "", s:italic, "")
call s:hi("pandocTableDelims", s:nord3_gui, "", s:nord3_term, "", "", "")
hi! link pandocAtxHeader markdownH1
hi! link pandocBlockQuote markdownBlockquote
hi! link pandocCiteAnchor Operator
hi! link pandocCiteKey pandocReferenceLabel
hi! link pandocDefinitionBlockMark Operator
hi! link pandocEmphasis markdownItalic
hi! link pandocFootnoteID pandocReferenceLabel
hi! link pandocFootnoteIDHead markdownLinkDelimiter
hi! link pandocFootnoteIDTail pandocFootnoteIDHead
hi! link pandocGridTableDelims pandocTableDelims
hi! link pandocGridTableHeader pandocTableDelims
hi! link pandocOperator Operator
hi! link pandocPipeTableDelims pandocTableDelims
hi! link pandocReferenceDefinition pandocReferenceLabel
hi! link pandocReferenceLabel markdownLinkText
hi! link pandocReferenceURL markdownUrl
hi! link pandocSimpleTableHeader pandocAtxHeader
hi! link pandocStrong markdownBold
hi! link pandocTableHeaderWord pandocAtxHeader
hi! link pandocUListItemBullet Operator
if has('nvim')
" tree-sitter
" > nvim-treesitter/nvim-treesitter
hi! link TSAnnotation Annotation
hi! link TSConstBuiltin Constant
hi! link TSConstructor Function
hi! link TSEmphasis Italic
hi! link TSFuncBuiltin Function
hi! link TSFuncMacro Function
hi! link TSStringRegex SpecialChar
hi! link TSStrong Bold
hi! link TSStructure Structure
hi! link TSTagDelimiter TSTag
hi! link TSUnderline Underline
hi! link TSVariable Variable
hi! link TSVariableBuiltin Keyword
endif
" TypeScript
" > HerringtonDarkholme/yats.vim
call s:hi("typescriptBOMWindowMethod", s:nord8_gui, "", s:nord8_term, "", s:italic, "")
call s:hi("typescriptClassName", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("typescriptDecorator", s:nord12_gui, "", s:nord12_term, "", "", "")
call s:hi("typescriptInterfaceName", s:nord7_gui, "", s:nord7_term, "", s:bold, "")
call s:hi("typescriptRegexpString", s:nord13_gui, "", s:nord13_term, "", "", "")
" TypeScript JSX
call s:hi("tsxAttrib", s:nord7_gui, "", s:nord7_term, "", "", "")
hi! link typescriptOperator Operator
hi! link typescriptBinaryOp Operator
hi! link typescriptAssign Operator
hi! link typescriptMember Identifier
hi! link typescriptDOMStorageMethod Identifier
hi! link typescriptArrowFuncArg Identifier
hi! link typescriptGlobal typescriptClassName
hi! link typescriptBOMWindowProp Function
hi! link typescriptArrowFuncDef Function
hi! link typescriptAliasDeclaration Function
hi! link typescriptPredefinedType Type
hi! link typescriptTypeReference typescriptClassName
hi! link typescriptTypeAnnotation Structure
hi! link typescriptDocNamedParamType SpecialComment
hi! link typescriptDocNotation Keyword
hi! link typescriptDocTags Keyword
hi! link typescriptImport Keyword
hi! link typescriptExport Keyword
hi! link typescriptTry Keyword
hi! link typescriptVariable Keyword
hi! link typescriptBraces Normal
hi! link typescriptObjectLabel Normal
hi! link typescriptCall Normal
hi! link typescriptClassHeritage typescriptClassName
hi! link typescriptFuncTypeArrow Structure
hi! link typescriptMemberOptionality Structure
hi! link typescriptNodeGlobal typescriptGlobal
hi! link typescriptTypeBrackets Structure
hi! link tsxEqual Operator
hi! link tsxIntrinsicTagName htmlTag
hi! link tsxTagName tsxIntrinsicTagName
" Markdown
" > plasticboy/vim-markdown
call s:hi("mkdCode", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("mkdFootnote", s:nord8_gui, "", s:nord8_term, "", "", "")
call s:hi("mkdRule", s:nord10_gui, "", s:nord10_term, "", "", "")
call s:hi("mkdLineBreak", s:nord9_gui, "", s:nord9_term, "", "", "")
hi! link mkdBold Bold
hi! link mkdItalic Italic
hi! link mkdString Keyword
hi! link mkdCodeStart mkdCode
hi! link mkdCodeEnd mkdCode
hi! link mkdBlockquote Comment
hi! link mkdListItem Keyword
hi! link mkdListItemLine Normal
hi! link mkdFootnotes mkdFootnote
hi! link mkdLink markdownLinkText
hi! link mkdURL markdownUrl
hi! link mkdInlineURL mkdURL
hi! link mkdID Identifier
hi! link mkdLinkDef mkdLink
hi! link mkdLinkDefTarget mkdURL
hi! link mkdLinkTitle mkdInlineURL
hi! link mkdDelimiter Keyword
" PHP
" > StanAngeloff/php.vim
call s:hi("phpClass", s:nord7_gui, "", s:nord7_term, "", "", "")
call s:hi("phpClassImplements", s:nord7_gui, "", s:nord7_term, "", s:bold, "")
hi! link phpClassExtends phpClass
hi! link phpFunction Function
hi! link phpMethod Function
hi! link phpUseClass phpClass
" Vimwiki
" > vimwiki/vimwiki
if !exists("g:vimwiki_hl_headers") || g:vimwiki_hl_headers == 0
for s:i in range(1,6)
call s:hi("VimwikiHeader".s:i, s:nord8_gui, "", s:nord8_term, "", s:bold, "")
endfor
else
let s:vimwiki_hcolor_guifg = [s:nord7_gui, s:nord8_gui, s:nord9_gui, s:nord10_gui, s:nord14_gui, s:nord15_gui]
let s:vimwiki_hcolor_ctermfg = [s:nord7_term, s:nord8_term, s:nord9_term, s:nord10_term, s:nord14_term, s:nord15_term]
for s:i in range(1,6)
call s:hi("VimwikiHeader".s:i, s:vimwiki_hcolor_guifg[s:i-1] , "", s:vimwiki_hcolor_ctermfg[s:i-1], "", s:bold, "")
endfor
endif
call s:hi("VimwikiLink", s:nord8_gui, "", s:nord8_term, "", s:underline, "")
hi! link VimwikiHeaderChar markdownHeadingDelimiter
hi! link VimwikiHR Keyword
hi! link VimwikiList markdownListMarker
" YAML
" > stephpy/vim-yaml
call s:hi("yamlKey", s:nord7_gui, "", s:nord7_term, "", "", "")
"+------------+
"+ Public API +
"+------------+
"+--- Functions ---+
function! NordPalette() abort
let ret = {}
for color in range(16)
execute 'let ret["nord'.color.'"] = s:nord'.color.'_gui'
endfor
let ret["nord3_bright"] = s:nord3_gui_bright
return ret
endfunction

View file

@ -0,0 +1,21 @@
MIT License (MIT)
Copyright (c) 2016-present Sven Greb <development@svengreb.de> (https://www.svengreb.de)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,39 @@
{
"name": "@nordtheme/vim",
"version": "0.19.0",
"description": "An arctic, north-bluish clean and elegant Vim theme",
"author": "Sven Greb <development@svengreb.de> (https://www.svengreb.de)",
"homepage": "https://www.nordtheme.com/ports/vim",
"repository": {
"type": "git",
"url": "git+https://github.com/nordtheme/vim.git"
},
"bugs": {
"url": "https://github.com/nordtheme/vim/issues"
},
"license": "MIT",
"private": true,
"engines": {
"node": ">=15.13",
"npm": ">=7.7"
},
"scripts": {
"format": "run-s format:pretty",
"format:pretty": "prettier --write .",
"lint": "run-s lint:md lint:pretty",
"lint:ci": "run-s lint:md lint:ci:*",
"lint:ci:pretty": "prettier --loglevel silent --check .",
"lint:md": "remark --no-stdout .",
"lint:pretty": "prettier --check .",
"prepare:husky": "husky install",
"prepare": "run-s prepare:*"
},
"devDependencies": {
"@arcticicestudio/remark-preset-lint": ">=0.4.0 <1.0.0",
"husky": "8.0.3",
"lint-staged": "13.1.2",
"npm-run-all": "4.1.5",
"prettier": "^2.8.4",
"remark-cli": "11.0.0"
}
}

View file

@ -0,0 +1,150 @@
<p align="center">
<a href="https://www.nordtheme.com/ports/vim" target="_blank">
<picture>
<source srcset="https://raw.githubusercontent.com/arcticicestudio/nord-docs/main/assets/images/ports/vim/repository-hero.svg?sanitize=true" width="100%" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" />
<img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/main/assets/images/ports/vim/repository-hero.svg?sanitize=true" width="100%" />
</picture>
</a>
</p>
<p align="center">
<a href="https://github.com/nordtheme/vim/releases/latest" target="_blank">
<img src="https://img.shields.io/github/release/nordtheme/vim.svg?style=flat-square&label=Release&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/>
</a>
<a href="https://www.nordtheme.com/docs/ports/vim" target="_blank">
<img src="https://img.shields.io/github/release/nordtheme/vim.svg?style=flat-square&label=Docs&colorA=4c566a&colorB=88c0d0&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI%2BCiAgICA8cGF0aCBmaWxsPSIjZDhkZWU5IiBkPSJNMTMuNzQ2IDIuODEzYS42Ny42NyAwIDAgMC0uNTU5LS4xMzNMOCAzLjg0OGwtNS4xODgtMS4xOGEuNjY5LjY2OSAwIDAgMC0uNTcuMTMzLjY3Ny42NzcgMCAwIDAtLjI0Mi41MzF2OC4xMzNjLS4wMDguMzIuMjEuNTk4LjUyLjY2OGw1LjMzMiAxLjE5OWguMjk2bDUuMzMyLTEuMmEuNjY4LjY2OCAwIDAgMCAuNTItLjY2N1YzLjMzMmEuNjU5LjY1OSAwIDAgMC0uMjU0LS41MnpNMy4zMzIgNC4xNjhsNCAuODk4djYuNzY2bC00LS44OTh6bTkuMzM2IDYuNzY2bC00IC44OThWNS4wNjZsNC0uODk4em0wIDAiLz4KPC9zdmc%2BCg%3D%3D"/>
</a>
<a href="https://github.com/nordtheme/vim/blob/main/changelog.md#050" target="_blank">
<img src="https://img.shields.io/github/release/nordtheme/vim.svg?style=flat-square&label=Changelog&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/>
</a>
</p>
<p align="center">
<a href="https://github.com/arcticicestudio/styleguide-markdown/releases/latest" target="_blank">
<img src="https://img.shields.io/github/release/arcticicestudio/styleguide-markdown.svg?style=flat-square&label=Markdown%20Style%20Guide&colorA=4c566a&colorB=88c0d0&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzOSIgaGVpZ2h0PSIzOSIgdmlld0JveD0iMCAwIDM5IDM5Ij48cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNEOERFRTkiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBkPSJNMS41IDEuNWgzNnYzNmgtMzZ6Ii8%2BPHBhdGggZmlsbD0iI0Q4REVFOSIgZD0iTTIwLjY4MyAyNS42NTVsNS44NzItMTMuNDhoLjU2Nmw1Ljg3MyAxMy40OGgtMS45OTZsLTQuMTU5LTEwLjA1Ni00LjE2MSAxMC4wNTZoLTEuOTk1em0tMi42OTYgMGwtMTMuNDgtNS44NzJ2LS41NjZsMTMuNDgtNS44NzJ2MS45OTVMNy45MzEgMTkuNWwxMC4wNTYgNC4xNnoiLz48L3N2Zz4%3D"/>
</a>
<a href="https://github.com/arcticicestudio/styleguide-git/releases/latest" target="_blank">
<img src="https://img.shields.io/github/release/arcticicestudio/styleguide-git.svg?style=flat-square&label=Git%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=git"/>
</a>
</p>
<p align="center">An arctic, north-bluish clean and elegant <a href="https://www.vim.org">Vim</a> color theme.</p>
<p align="center">Designed for a fluent and clear workflow based on the <a href="https://www.nordtheme.com">Nord</a> color palette.</p>
<p align="center">
<a href="https://www.nordtheme.com/ports/vim" target="_blank">
<picture>
<img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/main/assets/images/ports/vim/overview-go.png"/>
</picture>
</a>
</p>
Build for Vim's terminal- and GUI mode with _true colors_ with support for many third-party syntax and UI plugins including bundled themes for [lightline.vim][1] and [vim-airline][4].
## Getting Started
Visit the [official website][23] to learn all about the [syntax highlighting][27] features, details and elements of [UI and editor elements][25], the [various theme configurations][24] and the [support for many plugins][26].
Learn about the [installation and activation][20], how to [configure][18] and [customize][19] the theme from the [official documentations][22].
### Quick Start
Thanks to existing plugin/_runtimepath_ managers for Vim, Nord Vim can be installed for all platforms and the various variants/forks of Vim in a uniform way within a few lines of codes. The recommended manager is [vim-plug][2], but any other manager like [pathogen][3] or [Vundle][5] can also be used.
To automatically download and activate Nord Vim, follow the install instructions for [vim-plug][2] and
1. add `Plug 'nordtheme/vim'` to your [`vimrc`][28] within _vim-plug_'s plugin loading function
2. run the `:PlugInstall` command in Vim
3. activate the theme by adding `colorscheme nord` to the [vimrc][28] or change it on-the-fly by running `:colorscheme nord`
<p align="center">
<picture>
<img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/main/assets/images/ports/vim/installation-vim-plug.png"/>
</picture>
</p>
See the Nord Vim's documentation for [more installation options][20] and how to [set it up manually][21].
## Features
<p align="center">
<strong>A unified UI and editor syntax element design provides a clutter-free and fluidly merging appearance.</strong><br />
<picture>
<img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/main/assets/images/ports/vim/overview-go-nerdtree.png"/>
</picture>
</p>
<p align="center">
<strong>Small details with unobtrusive styles for popular and common code editor features like search result marker and brace matching — designed to get out of your way with a visually attractive appearance.</strong><br />
<picture>
<img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/main/assets/images/ports/vim/editor-search-highlighting.png"/>
</picture>
</p>
<p align="center">
<strong>Support for a wide range of programming languages — from bundled plugins up to many popular syntax and UI third-party plugins.</strong><br />
<picture>
<img src="https://raw.githubusercontent.com/arcticicestudio/nord-docs/main/assets/images/ports/vim/syntax-javascript-react-hook.png"/>
</picture>
</p>
## Contributing
Nord is an open source project and we love to receive contributions from the [community][6]!
There are many ways to contribute, from [writing- and improving documentation and tutorials][9], [reporting bugs][8], [submitting enhancement suggestions][10] that can be added to Nord by [submitting pull requests][14].
Please take a moment to read Nord's full [contributing guide][17] to learn about the development process, the project's used [styleguides][15], [branch organization][7] and [versioning][16] model.
The guide also includes information about [minimal, complete, and verifiable examples][13] and other ways to contribute to the project like [improving existing issues][12] and [giving feedback on issues and pull requests][11].
<p align="center">
<picture>
<source srcset="https://raw.githubusercontent.com/nordtheme/assets/main/static/images/elements/separators/iceberg/footer/dark/spaced.svg?sanitize=true" width="100%" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" />
<source srcset="https://raw.githubusercontent.com/nordtheme/assets/main/static/images/elements/separators/iceberg/footer/light/spaced.svg?sanitize=true" width="100%" media="(prefers-color-scheme: dark)" />
<img src="https://raw.githubusercontent.com/nordtheme/assets/main/static/images/elements/separators/iceberg/footer/dark/spaced.svg?sanitize=true" width="100%" />
</picture>
</p>
<p align="center">
Copyright &copy; 2016-present <a href="https://www.svengreb.de" target="_blank">Sven Greb</a>
</p>
<p align="center">
<a href="https://github.com/nordtheme/vim/blob/main/license" target="_blank">
<img src="https://img.shields.io/static/v1.svg?style=flat-square&label=License&message=MIT&logoColor=eceff4&colorA=4c566a&colorB=88c0d0"/>
</a>
<a href="https://www.svengreb.de">
<img src="https://img.shields.io/static/v1.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAABMklEQVQ4jcWQvUoDQRRGz52s5IfVIiDWPkGKFFaCIVaGdIagjcFAwICFb7DvIK6QQlNpY2UQLMQVBbEQ0SewFkGbKCQmOzaTJay7/lR+zTAf9xwuF/47Mv45rdezqWEq72v/RWZnHgqOMwDwHMfSj085JSqb6Pu38we7r18E3nqzhmYbsE11rxKsAvhDfQiSM30XYbOw57YDwfnaRl6U3ABWaMNn806H+oGPzBX3d+4UgChZiYBHYBgGsBLoKoAyhR0x9G20Zmpc4P1ZoMQDcwMNclFrdhBKv6M5WWi7ZQGtjEUn35IV4OwnVjSX/WGmKqCDDUa5rmyle3bvGFiMg3WGUsF1u0EXHoqTRMGRgkAy2eugKZrqijRLYThWANBpNDL2h3UE0J0YLJdbrfe42f/NJ0wqY7/KcXKPAAAAAElFTkSuQmCC&label=lovely%20crafted%20in&message=Germany&colorA=4c566a&colorB=88c0d0"/>
</a>
</p>
[1]: https://github.com/itchyny/lightline.vim
[2]: https://github.com/junegunn/vim-plug
[3]: https://github.com/tpope/vim-pathogen
[4]: https://github.com/vim-airline/vim-airline
[5]: https://github.com/tpope/vim-pathogen
[6]: https://www.nordtheme.com/community
[7]: https://github.com/nordtheme/.github/blob/main/contributing.md#branch-organization
[8]: https://github.com/nordtheme/.github/blob/main/contributing.md#bug-reports
[9]: https://github.com/nordtheme/.github/blob/main/contributing.md#documentations
[10]: https://github.com/nordtheme/.github/blob/main/contributing.md#enhancement-suggestions
[11]: https://github.com/nordtheme/.github/blob/main/contributing.md#feedback
[12]: https://github.com/nordtheme/.github/blob/main/contributing.md#improve-issues
[13]: https://github.com/nordtheme/.github/blob/main/contributing.md#mcve
[14]: https://github.com/nordtheme/.github/blob/main/contributing.md#pull-requests
[15]: https://github.com/nordtheme/.github/blob/main/contributing.md#style-guides
[16]: https://github.com/nordtheme/.github/blob/main/contributing.md#versioning
[17]: https://github.com/nordtheme/.github/blob/main/contributing.md
[18]: https://www.nordtheme.com/docs/ports/vim/configuration
[19]: https://www.nordtheme.com/docs/ports/vim/customization
[20]: https://www.nordtheme.com/docs/ports/vim/installation
[21]: https://www.nordtheme.com/docs/ports/vim/installation#manual
[22]: https://www.nordtheme.com/docs/ports/vim
[23]: https://www.nordtheme.com/ports/vim
[24]: https://www.nordtheme.com/ports/vim#configurations
[25]: https://www.nordtheme.com/ports/vim#editor-details
[26]: https://www.nordtheme.com/ports/vim#plugin-support
[27]: https://www.nordtheme.com/ports/vim#syntax
[28]: https://vimhelp.org/starting.txt.html#vimrc

@ -0,0 +1 @@
Subproject commit 64456adf09b406734f00fe1dd7f9d0f9424d7aa7000000000000000000000000

@ -0,0 +1 @@
Subproject commit 3a7fd9ff50fabafe61df12522ed2f275c8e2f45e000000000000000000000000

@ -0,0 +1 @@
Subproject commit ff7352e4bff02eb600a136b6fd741404f3195371000000000000000000000000

@ -0,0 +1 @@
Subproject commit a9aa25ce323b2dd04a52706f4d1b044f4feb7617000000000000000000000000

View file

@ -0,0 +1,5 @@
/autoload/css_color.vim export-subst
/.gitattributes export-ignore
/README.md export-ignore
/LICENSE export-ignore
/tests export-ignore

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Aristotle Pagaltzis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,16 @@
<h1 align="center">CSS Color</h1>
<div align="center">
A very fast, multi-syntax context-sensitive color name highlighter<br>
<img src="https://raw.githubusercontent.com/ap/vim-css-color/5377c65022ee6d660b898bad954aeea73fa613b8/screenshot.png" width="763">
<sub>
<pre><code># <b>Install</b>: If you use a plugin manager then follow its instructions. Otherwise:
git clone https://github.com/ap/vim-css-color.git ~/.vim/pack/css-color/start/css-color</code></pre>
</sub><br>
</div>
<sub>Inspired
by [Niklas Hofer](http://www.vim.org/scripts/script.php?script_id=2150)
and [Max Vasiliev](https://github.com/skammer/vim-css-color).</sub>

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'cComment,cCommentL,cString,cCppString')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'CfgComment,CfgString')

View file

@ -0,0 +1,2 @@
let [type, keywords] = expand('%:e') ==? 'cljs' ? ['css', 'extended'] : ['hex', 'none']
call css_color#init(type, keywords, 'clojureComment,clojureString')

View file

@ -0,0 +1,4 @@
syn match cshCommentColor contained '\(#[^#]*\)\@<=\zs#\x\{3}\%(\x\{3}\)\?\>' containedin=cshComment
call css_color#init( 'hex', 'none'
\, 'cshDblQuote,cshSnglQuote,cshHereDoc,'
\. 'cshCommentColor' )

View file

@ -0,0 +1 @@
call css_color#init('css', 'extended', 'cssMediaBlock,cssFunction,cssDefinition,cssAttrRegion,cssComment')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'dosiniValue')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'elmLineComment,elmString')

View file

@ -0,0 +1,3 @@
" https://github.com/dag/vim-fish (and presumably its various forks)
syn match fishCommentColor contained '\(#[^#]*\)\@<=\zs#\x\{3}\%(\x\{3}\)\?\>' containedin=fishComment
call css_color#init( 'hex', 'none', 'fishString,fishCommentColor' )

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'goComment,goString,goRawString')

View file

@ -0,0 +1,2 @@
" default html syntax should already be including the css syntax
call css_color#init('none', 'none', 'htmlString,htmlCommentPart')

View file

@ -0,0 +1,4 @@
" see also: i3config.vim for the stock Vim 8.2+ syntax
" Colour => https://github.com/moon-musick/vim-i3-config-syntax
" i3* => https://github.com/PotatoesMaster/i3-vim-syntax
call css_color#init('hex', 'none', 'Colour,i3SimpleString,i3Color1st,i3Color2nd,i3ColorLast')

View file

@ -0,0 +1,3 @@
" i3ConfigColor => stock Vim syntax and recent https://github.com/mboughaba/i3config.vim
" Color => https://github.com/mboughaba/i3config.vim prior to dff3b177ebaf6aae35591cd4c9c734fff9ed7145
call css_color#init('hex', 'none', 'i3ConfigColor,Color')

View file

@ -0,0 +1,14 @@
" ft=coffee includes javascript, but mostly sets up own syntax groups
" so until it has specific support there's no point in loading anyway
" and for some reason the W3C syntax color keywords break its highlighting
" (this refers to the https://github.com/kchmck/vim-coffee-script plugin)
if &syntax =~# '\(^\|\.\)coffee\($\|\.\)' | finish | endif
" javaScriptX = default Vim syntax
" jsX = https://github.com/pangloss/vim-javascript
" javascriptX = https://github.com/othree/yajs.vim
call css_color#init('hex', 'extended'
\, 'javaScriptComment,javaScriptLineComment,javaScriptStringS,javaScriptStringD,javaScriptStringT'
\. ',jsComment,jsString,jsTemplateString,jsObjectKeyString,jsObjectStringKey,jsClassStringKey'
\. ',javascriptComment,javascriptLineComment,javascriptLineComment,javascriptString,javascriptTemplate'
\)

View file

@ -0,0 +1 @@
call css_color#init('css', 'none', 'jsonString')

View file

@ -0,0 +1,3 @@
" jsx syntax should already be including the javascript and xml syntaxes
" but those only use `hex` parsing; JSX needs `css` for inline CSS styles
call css_color#init('css', 'none', '')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'kittyColor,kittyComment')

View file

@ -0,0 +1,8 @@
" variable | property | multiline | end-of-line | plugin
" -----------------------+----------------+----------------+-------------+---------
" lessCssAttribute | lessCssComment | lessComment | https://github.com/genoma/vim-less
" lessAttribute | lessCssComment | lessComment | https://github.com/KohPoll/vim-less
" lessVariableValue | lessDefinition | cssComment | lessComment | https://github.com/groenewege/vim-less
" lessVariableDefinition | cssDefinition | cssComment | lessComment | https://github.com/lunaru/vim-less
call css_color#init('css', 'extended', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'extended', 'moonComment,moonString')

View file

@ -0,0 +1,2 @@
" https://github.com/LnL7/vim-nix
call css_color#init('hex', 'none', 'nixComment,nixString,nixSimpleString')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'perlComment,perlDATA,perlString,perlStringUnexpanded,perlQQ,perlHereDoc')

View file

@ -0,0 +1 @@
call css_color#init('css', 'basic', 'phpComment,phpStringSingle,phpStringDouble')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'pythonComment,pythonString')

View file

@ -0,0 +1 @@
call css_color#init('css', 'extended', 'qmlStringD')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'extended', 'rComment,rString')

View file

@ -0,0 +1,4 @@
" https://github.com/Fymyte/rasi.vim
call css_color#init('css', 'extended'
\, 'rasiHexColor,rasiRGBColor,rasiRGBAColor,rasiHSLColor,rasiHSLAColor,rasiNamedColor'
\. ',rasiPropertyVal,rasiComment,rasiCommentL,rasiEnvVar,rasiVarReference')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'rubyComment,rubyData,rubyString')

View file

@ -0,0 +1 @@
call css_color#init('css', 'extended', 'sassCssAttribute,sassComment,sassCssComment')

View file

@ -0,0 +1 @@
call css_color#init('css', 'extended', 'scssAttribute,scssComment,scssVariableValue,scssMap,scssMapValue,sassCssAttribute,cssComment')

View file

@ -0,0 +1,6 @@
syn match shCommentColor contained '\(#[^#]*\)\@<=\zs#\x\{3}\%(\x\{3}\)\?\>' containedin=shQuickComment,shBQComment,shComment
call css_color#init( 'hex', 'none'
\, 'shSingleQuote,shDoubleQuote,shHereDoc,'
\. 'shTestSingleQuote,shTestDoubleQuote,'
\. 'shEchoQuote,shEmbeddedEcho,shEcho,'
\. 'shCommentColor' )

View file

@ -0,0 +1 @@
call css_color#init('css', 'extended', 'stylusCssAttribute,stylusComment,cssComment')

View file

@ -0,0 +1,4 @@
syn match tcshCommentColor contained '\(#[^#]*\)\@<=\zs#\x\{3}\%(\x\{3}\)\?\>' containedin=tcshComment
call css_color#init( 'hex', 'none'
\, 'tcshSQuote,tcshDQuote,tcshHereDoc,'
\. 'tcshCommentColor' )

View file

@ -0,0 +1 @@
call css_color#init('css', 'none', 'tmuxString,tmuxComment')

View file

@ -0,0 +1,6 @@
" https://github.com/HerringtonDarkholme/yats.vim (stock Vim syntax)
" https://github.com/leafgarland/typescript-vim
call css_color#init('css', 'extended'
\, 'typescriptString,typescriptStringProperty,typescriptStringS,typescriptStringD,typescriptStringB,'
\. 'typescriptComment,typescriptLineComment,typescriptCommentSkip,typescriptDocComment'
\)

View file

@ -0,0 +1 @@
runtime after/syntax/typescript.vim

View file

@ -0,0 +1 @@
call css_color#init('hex', 'extended', 'valaString')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'vimHiGuiRgb,vimString,vimComment,vimLineComment')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'extended', 'xdefaultsValue')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'none', 'xmlComment,xmlCommentPart,xmlString')

View file

@ -0,0 +1 @@
call css_color#init('hex', 'extended', 'yamlComment,yamlFlowString,yamlPlainScalar')

View file

@ -0,0 +1,4 @@
syn match zshCommentColor contained '\(#[^#]*\)\@<=\zs#\x\{3}\%(\x\{3}\)\?\>' containedin=zshComment
call css_color#init( 'hex', 'none'
\, 'zshString,zshPOSIXString,zshHereDoc,'
\. 'zshCommentColor' )

View file

@ -0,0 +1,320 @@
" Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
" Commit: $Format:%H$
" Licence: The MIT License (MIT)
if ! ( v:version >= 700 && has('syntax') && ( has('gui_running') || has('nvim') || &t_Co == 256 ) )
function! css_color#init(type, keywords, groups)
endfunction
function! css_color#extend(groups)
endfunction
finish
endif
function! s:rgb2color(r,g,b)
" Convert 80% -> 204, 100% -> 255, etc.
let rgb = map( [a:r,a:g,a:b], 'v:val =~ "%$" ? ( 255 * v:val ) / 100 : v:val' )
return printf( '%02x%02x%02x', rgb[0], rgb[1], rgb[2] )
endfunction
function! s:hsl2color(h,s,l)
" Convert 80% -> 0.8, 100% -> 1.0, etc.
let [s,l] = map( [a:s, a:l], 'v:val =~ "%$" ? v:val / 100.0 : v:val + 0.0' )
" algorithm transcoded to vim from http://www.w3.org/TR/css3-color/#hsl-color
let hh = ( a:h % 360 ) / 360.0
let m2 = l <= 0.5 ? l * ( s + 1 ) : l + s - l * s
let m1 = l * 2 - m2
let rgb = []
for h in [ hh + (1/3.0), hh, hh - (1/3.0) ]
let h = h < 0 ? h + 1 : h > 1 ? h - 1 : h
let v =
\ h * 6 < 1 ? m1 + ( m2 - m1 ) * h * 6 :
\ h * 2 < 1 ? m2 :
\ h * 3 < 2 ? m1 + ( m2 - m1 ) * ( 2/3.0 - h ) * 6 :
\ m1
if v > 1.0 | return '' | endif
let rgb += [ float2nr( 255 * v ) ]
endfor
return printf( '%02x%02x%02x', rgb[0], rgb[1], rgb[2] )
endfunction
let s:_1_3 = 1.0/3
let s:_16_116 = 16.0/116.0
let s:cos16 = cos(16*(180/atan2(0,-1)))
let s:sin16 = sin(16*(180/atan2(0,-1)))
function s:rgb2din99(rgb)
let [r,g,b] = map( copy(a:rgb), 'v:val > 0.04045 ? pow((v:val + 0.055) / 1.055, 2.4) : v:val / 12.92' )
let x = r * 0.4124 + g * 0.3576 + b * 0.1805
let y = r * 0.2126 + g * 0.7152 + b * 0.0722
let z = r * 0.0193 + g * 0.1192 + b * 0.9505
" Observer 2°, Illuminant D65
let x = ( x * 100 ) / 95.0489
let z = ( z * 100 ) / 108.8840
let [x,y,z] = map( [x,y,z], 'v:val > 0.008856 ? pow(v:val, s:_1_3) : 7.787 * v:val + s:_16_116' )
let [L,a,b] = [ (116 * y) - 16, 500 * (x - y), 200 * (y - z) ]
let L99 = 105.51 * log(1 + 0.0158 * L)
let e = a * s:cos16 + b * s:sin16
let f = 0.7 * (b * s:cos16 - a * s:sin16)
let g = 0.045 * sqrt(e*e + f*f)
if g == 0
let [a99, b99] = [0.0, 0.0]
else
let k = log(1 + g) / g
let a99 = k * e
let b99 = k * f
endif
return [L99, a99, b99]
endfunction
let s:hex={}
for i in range(0, 255)
let s:hex[ printf( '%02x', i ) ] = i
endfor
let s:exe=[]
function! s:flush_exe()
if len(s:exe) | exe join( remove( s:exe, 0, -1 ), ' | ' ) | endif
endfunction
if has('gui_running')
function! s:create_highlight(color, is_bright)
call add( s:exe, 'hi BG'.a:color.' guibg=#'.a:color.' guifg=#'.( a:is_bright ? '000000' : 'ffffff' ) )
endfunction
else
" the 16 vt100 colors are not defined consistently
let s:xtermcolor = repeat( [''], 16 )
" the 6 values used in the xterm color cube
" 0 95 135 175 215 255
let s:cubergb = [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ]
for s:rrr in s:cubergb
for s:ggg in s:cubergb
for s:bbb in s:cubergb
call add( s:xtermcolor, [ s:rrr, s:ggg, s:bbb ] )
endfor
endfor
endfor
" grayscale ramp
let s:xtermcolor += map( range(24), 'repeat( [10 * v:val + 8], 3 )' )
for idx in range( 16, len(s:xtermcolor) - 1 )
let s:xtermcolor[idx] = s:rgb2din99( map(s:xtermcolor[idx], 'v:val / 255.0') )
endfor
" selects the nearest xterm color for a rgb value like #FF0000
function! s:rgb2xterm(color)
let best_match=0
let smallest_distance = 10000000000
let color = tolower(a:color)
let r = s:hex[color[0:1]]
let g = s:hex[color[2:3]]
let b = s:hex[color[4:5]]
let [L1,a1,b1] = s:rgb2din99([ r/255.0, g/255.0, b/255.0 ])
for idx in range( 16, len(s:xtermcolor) - 1 )
let [L2,a2,b2] = s:xtermcolor[idx]
let dL = L1 - L2
let da = a1 - a2
let db = b1 - b2
let distance = dL*dL + da*da + db*db
if distance == 0 | return idx | endif
if distance > smallest_distance | continue | endif
let smallest_distance = distance
let best_match = idx
endfor
return best_match
endfunction
let s:color_idx = {}
function! s:create_highlight(color, is_bright)
let color_idx = get( s:color_idx, a:color, -1 )
if color_idx == -1
let color_idx = s:rgb2xterm(a:color)
let s:color_idx[a:color] = color_idx
endif
call add( s:exe,
\ 'hi BG'.a:color
\ . ' guibg=#' .a:color .' guifg=#' .( a:is_bright ? '000000' : 'ffffff' )
\ . ' ctermbg='.color_idx.' ctermfg='.( a:is_bright ? 0 : 15 )
\ )
endfunction
endif
function! s:recreate_highlights()
call filter( copy( b:css_color_hi ), 's:create_highlight( v:key, v:val )' )
endfunction
let s:pattern_color = {}
let s:color_bright = {}
function! s:create_syn_match()
let pattern = submatch(0)
if has_key( b:css_color_syn, pattern ) | return | endif
let b:css_color_syn[pattern] = 1
let rgb_color = get( s:pattern_color, pattern, '' )
if ! strlen( rgb_color )
let hex = submatch(1)
let funcname = submatch(2)
let rgb_color
\ = funcname == 'rgb' ? s:rgb2color(submatch(3),submatch(4),submatch(5))
\ : funcname == 'hsl' ? s:hsl2color(submatch(3),submatch(4),submatch(5))
\ : strlen(hex) >= 6 ? tolower(hex[0:5])
\ : strlen(hex) >= 3 ? tolower(hex[0].hex[0].hex[1].hex[1].hex[2].hex[2])
\ : ''
if rgb_color == '' | throw 'css_color: create_syn_match invoked on bad match data' | endif
let s:pattern_color[pattern] = rgb_color
endif
if ! has_key( b:css_color_hi, rgb_color )
let is_bright = get( s:color_bright, rgb_color, -1 )
if is_bright == -1
let r = s:hex[rgb_color[0:1]]
let g = s:hex[rgb_color[2:3]]
let b = s:hex[rgb_color[4:5]]
let is_bright = r*30 + g*59 + b*11 > 12000
let s:color_bright[rgb_color] = is_bright
endif
call s:create_highlight( rgb_color, is_bright )
let b:css_color_hi[rgb_color] = is_bright
endif
" iff pattern ends on word character, require word break to match
if pattern =~ '\>$' | let pattern .= '\>' | endif
call add( s:exe, 'syn match BG'.rgb_color.' /'.escape(pattern, '/').'/ contained containedin=@colorableGroup' )
return ''
endfunction
function! s:clear_matches()
call map(get(w:, 'css_color_match_id', []), 'matchdelete(v:val)')
let w:css_color_match_id = []
endfunction
function! s:create_matches()
call s:clear_matches()
if ! &l:cursorline | return | endif
" adds matches based that duplicate the highlighted colors on the current line
let lnr = line('.')
let group = ''
let groupstart = 0
let endcol = &l:synmaxcol ? &l:synmaxcol : col('$')
for col in range( 1, endcol )
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
if group == nextgroup | continue | endif
if group =~ '^BG\x\{6}$'
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
let w:css_color_match_id += [ matchadd( group, regex, -1 ) ]
endif
let group = nextgroup
let groupstart = col
endfor
endfunction
let s:_hexcolor = '#\(\x\{3}\%(\>\|\x\{3}\>\)\)' " submatch 1
let s:_rgbacolor = '#\(\x\{3}\%(\>\|\x\%(\>\|\x\{2}\%(\>\|\x\{2}\>\)\)\)\)' " submatch 1
let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2
let s:_ws_ = '\s*'
let s:_numval = s:_ws_ . '\(\d\{1,3}%\?\)' " submatch 3,4,5
let s:_listsep = s:_ws_ . ','
let s:_otherargs_ = '\%(,[^)]*\)\?'
let s:_funcexpr = s:_funcname . '[(]' . s:_numval . s:_listsep . s:_numval . s:_listsep . s:_numval . s:_ws_ . s:_otherargs_ . '[)]'
let s:_csscolor = s:_rgbacolor . '\|' . s:_funcexpr
" N.B. sloppy heuristic constants for performance reasons:
" a) start somewhere left of screen in case of partially visible colorref
" b) take some multiple of &columns to handle multibyte chars etc
" N.B. these substitute() calls are here just for the side effect
" of invoking s:create_syn_match during substitution -- because
" match() and friends do not allow finding all matches in a single
" scan without examining the start of the string over and over
function! s:parse_screen()
let leftcol = winsaveview().leftcol
let left = max([ leftcol - 15, 0 ])
let width = &columns * 4
call filter( range( line('w0'), line('w$') ), 'substitute( strpart( getline(v:val), col([v:val, left]), width ), b:css_color_pat, ''\=s:create_syn_match()'', ''g'' )' )
call s:flush_exe()
endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! css_color#reinit()
call s:recreate_highlights()
call s:flush_exe()
endfunction
function! css_color#enable()
if ! b:css_color_off | return | endif
if len( b:css_color_grp ) | exe 'syn cluster colorableGroup add=' . join( b:css_color_grp, ',' ) | endif
augroup CSSColor
autocmd! * <buffer>
if has('nvim-0.3.1')
autocmd CursorMoved,CursorMovedI <buffer> call s:parse_screen()
else
autocmd CursorMoved,CursorMovedI <buffer> call s:parse_screen() | call s:create_matches()
autocmd BufWinEnter <buffer> call s:create_matches()
autocmd BufWinLeave <buffer> call s:clear_matches()
endif
autocmd ColorScheme <buffer> call css_color#reinit()
augroup END
let b:css_color_off = 0
doautocmd CSSColor CursorMoved
endfunction
function! css_color#disable()
if b:css_color_off | return | endif
if len( b:css_color_grp ) | exe 'syn cluster colorableGroup remove=' . join( b:css_color_grp, ',' ) | endif
autocmd! CSSColor * <buffer>
let b:css_color_off = 1
endfunction
function! css_color#toggle()
if b:css_color_off | call css_color#enable()
else | call css_color#disable()
endif
endfunction
let s:type = [ 'none', 'hex', 'rgba', 'css', 'none' ] " with wraparound for index() == -1
let s:pat_for_type = [ '^$', s:_hexcolor, s:_rgbacolor, s:_csscolor, '^$' ]
function! css_color#init(type, keywords, groups)
let new_type = index( s:type, a:type )
let old_type = index( s:pat_for_type, get( b:, 'css_color_pat', '$^' ) )
let b:css_color_pat = s:pat_for_type[ max( [ old_type, new_type ] ) ]
let b:css_color_grp = extend( get( b:, 'css_color_grp', [] ), split( a:groups, ',' ), 0 )
let b:css_color_hi = {}
let b:css_color_syn = {}
let b:css_color_off = 1
call css_color#enable()
if a:keywords != 'none'
exe 'syntax include syntax/colornames/'.a:keywords.'.vim'
call extend( s:color_bright, b:css_color_hi )
endif
endfunction
" utility function for development use
function! css_color#dump_highlights()
call s:recreate_highlights()
let cmd = join( sort( remove( s:exe, 0, -1 ) ), "\n" )
let cmd = substitute( cmd, '#......', '\U&', 'g' )
let cmd = substitute( cmd, 'ctermbg=\zs\d\+', '\=printf("%-3d",submatch(0))', 'g' )
return cmd
endfunction

View file

@ -0,0 +1,47 @@
" Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
" Commit: $Format:%H$
" Licence: The MIT License (MIT)
" W3C basic colors
hi BG000000 guibg=#000000 guifg=#FFFFFF ctermbg=16 ctermfg=15
hi BGc0c0c0 guibg=#C0C0C0 guifg=#000000 ctermbg=250 ctermfg=0
hi BG808080 guibg=#808080 guifg=#000000 ctermbg=244 ctermfg=0
hi BGffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=0
hi BG800000 guibg=#800000 guifg=#FFFFFF ctermbg=88 ctermfg=15
hi BGff0000 guibg=#FF0000 guifg=#FFFFFF ctermbg=196 ctermfg=15
hi BG800080 guibg=#800080 guifg=#FFFFFF ctermbg=90 ctermfg=15
hi BGff00ff guibg=#FF00FF guifg=#FFFFFF ctermbg=201 ctermfg=15
hi BG008000 guibg=#008000 guifg=#FFFFFF ctermbg=28 ctermfg=15
hi BG00ff00 guibg=#00FF00 guifg=#000000 ctermbg=46 ctermfg=0
hi BG808000 guibg=#808000 guifg=#FFFFFF ctermbg=100 ctermfg=15
hi BGffff00 guibg=#FFFF00 guifg=#000000 ctermbg=226 ctermfg=0
hi BG000080 guibg=#000080 guifg=#FFFFFF ctermbg=18 ctermfg=15
hi BG0000ff guibg=#0000FF guifg=#FFFFFF ctermbg=21 ctermfg=15
hi BG008080 guibg=#008080 guifg=#FFFFFF ctermbg=30 ctermfg=15
hi BG00ffff guibg=#00FFFF guifg=#000000 ctermbg=51 ctermfg=0
call extend( b:css_color_hi,
\{'000000':0,'c0c0c0':1,'808080':1,'ffffff':1,'800000':0,'ff0000':0
\,'800080':0,'ff00ff':0,'008000':0,'00ff00':1,'808000':0,'ffff00':1
\,'000080':0,'0000ff':0,'008080':0,'00ffff':1} )
syn case ignore
syn keyword BG000000 black contained containedin=@colorableGroup
syn keyword BGc0c0c0 silver contained containedin=@colorableGroup
syn keyword BG808080 gray contained containedin=@colorableGroup
syn match BGffffff "\c\<white\(-\)\@!\>" contained containedin=@colorableGroup
syn keyword BG800000 maroon contained containedin=@colorableGroup
syn keyword BGff0000 red contained containedin=@colorableGroup
syn keyword BG800080 purple contained containedin=@colorableGroup
syn keyword BGff00ff fuchsia contained containedin=@colorableGroup
syn keyword BG008000 green contained containedin=@colorableGroup
syn keyword BG00ff00 lime contained containedin=@colorableGroup
syn keyword BG808000 olive contained containedin=@colorableGroup
syn keyword BGffff00 yellow contained containedin=@colorableGroup
syn keyword BG000080 navy contained containedin=@colorableGroup
syn keyword BG0000ff blue contained containedin=@colorableGroup
syn keyword BG008080 teal contained containedin=@colorableGroup
syn keyword BG00ffff aqua contained containedin=@colorableGroup

View file

@ -0,0 +1,290 @@
" Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
" Commit: $Format:%H$
" Licence: The MIT License (MIT)
" W3C extended colors
syntax include syntax/colornames/basic.vim
hi BG00008b guibg=#00008B guifg=#FFFFFF ctermbg=18 ctermfg=15
hi BG0000cd guibg=#0000CD guifg=#FFFFFF ctermbg=20 ctermfg=15
hi BG006400 guibg=#006400 guifg=#FFFFFF ctermbg=22 ctermfg=15
hi BG008b8b guibg=#008B8B guifg=#FFFFFF ctermbg=30 ctermfg=15
hi BG00bfff guibg=#00BFFF guifg=#000000 ctermbg=74 ctermfg=0
hi BG00ced1 guibg=#00CED1 guifg=#000000 ctermbg=6 ctermfg=0
hi BG00fa9a guibg=#00FA9A guifg=#000000 ctermbg=49 ctermfg=0
hi BG00ff7f guibg=#00FF7F guifg=#000000 ctermbg=48 ctermfg=0
hi BG191970 guibg=#191970 guifg=#FFFFFF ctermbg=18 ctermfg=15
hi BG1e90ff guibg=#1E90FF guifg=#000000 ctermbg=33 ctermfg=0
hi BG20b2aa guibg=#20B2AA guifg=#000000 ctermbg=37 ctermfg=0
hi BG228b22 guibg=#228B22 guifg=#FFFFFF ctermbg=28 ctermfg=15
hi BG2e8b57 guibg=#2E8B57 guifg=#FFFFFF ctermbg=29 ctermfg=15
hi BG2f4f4f guibg=#2F4F4F guifg=#FFFFFF ctermbg=23 ctermfg=15
hi BG32cd32 guibg=#32CD32 guifg=#000000 ctermbg=2 ctermfg=0
hi BG3cb371 guibg=#3CB371 guifg=#000000 ctermbg=35 ctermfg=0
hi BG40e0d0 guibg=#40E0D0 guifg=#000000 ctermbg=44 ctermfg=0
hi BG4169e1 guibg=#4169E1 guifg=#FFFFFF ctermbg=62 ctermfg=15
hi BG4682b4 guibg=#4682B4 guifg=#FFFFFF ctermbg=67 ctermfg=15
hi BG483d8b guibg=#483D8B guifg=#FFFFFF ctermbg=90 ctermfg=15
hi BG48d1cc guibg=#48D1CC guifg=#000000 ctermbg=44 ctermfg=0
hi BG4b0082 guibg=#4B0082 guifg=#FFFFFF ctermbg=54 ctermfg=15
hi BG556b2f guibg=#556B2F guifg=#FFFFFF ctermbg=58 ctermfg=15
hi BG5f9ea0 guibg=#5F9EA0 guifg=#000000 ctermbg=73 ctermfg=0
hi BG6495ed guibg=#6495ED guifg=#000000 ctermbg=68 ctermfg=0
hi BG663399 guibg=#663399 guifg=#FFFFFF ctermbg=91 ctermfg=15
hi BG66cdaa guibg=#66CDAA guifg=#000000 ctermbg=79 ctermfg=0
hi BG696969 guibg=#696969 guifg=#FFFFFF ctermbg=242 ctermfg=15
hi BG6a5acd guibg=#6A5ACD guifg=#FFFFFF ctermbg=62 ctermfg=15
hi BG6b8e23 guibg=#6B8E23 guifg=#FFFFFF ctermbg=64 ctermfg=15
hi BG708090 guibg=#708090 guifg=#000000 ctermbg=8 ctermfg=0
hi BG778899 guibg=#778899 guifg=#000000 ctermbg=67 ctermfg=0
hi BG7b68ee guibg=#7B68EE guifg=#000000 ctermbg=98 ctermfg=0
hi BG7cfc00 guibg=#7CFC00 guifg=#000000 ctermbg=118 ctermfg=0
hi BG7fff00 guibg=#7FFF00 guifg=#000000 ctermbg=118 ctermfg=0
hi BG7fffd4 guibg=#7FFFD4 guifg=#000000 ctermbg=122 ctermfg=0
hi BG87ceeb guibg=#87CEEB guifg=#000000 ctermbg=117 ctermfg=0
hi BG87cefa guibg=#87CEFA guifg=#000000 ctermbg=117 ctermfg=0
hi BG8a2be2 guibg=#8A2BE2 guifg=#FFFFFF ctermbg=93 ctermfg=15
hi BG8b0000 guibg=#8B0000 guifg=#FFFFFF ctermbg=88 ctermfg=15
hi BG8b008b guibg=#8B008B guifg=#FFFFFF ctermbg=90 ctermfg=15
hi BG8b4513 guibg=#8B4513 guifg=#FFFFFF ctermbg=130 ctermfg=15
hi BG8fbc8f guibg=#8FBC8F guifg=#000000 ctermbg=108 ctermfg=0
hi BG90ee90 guibg=#90EE90 guifg=#000000 ctermbg=120 ctermfg=0
hi BG9370d8 guibg=#9370D8 guifg=#000000 ctermbg=134 ctermfg=0
hi BG9400d3 guibg=#9400D3 guifg=#FFFFFF ctermbg=92 ctermfg=15
hi BG98fb98 guibg=#98FB98 guifg=#000000 ctermbg=120 ctermfg=0
hi BG9932cc guibg=#9932CC guifg=#FFFFFF ctermbg=128 ctermfg=15
hi BG9acd32 guibg=#9ACD32 guifg=#000000 ctermbg=112 ctermfg=0
hi BGa0522d guibg=#A0522D guifg=#FFFFFF ctermbg=130 ctermfg=15
hi BGa52a2a guibg=#A52A2A guifg=#FFFFFF ctermbg=124 ctermfg=15
hi BGa9a9a9 guibg=#A9A9A9 guifg=#000000 ctermbg=248 ctermfg=0
hi BGadd8e6 guibg=#ADD8E6 guifg=#000000 ctermbg=152 ctermfg=0
hi BGadff2f guibg=#ADFF2F guifg=#000000 ctermbg=154 ctermfg=0
hi BGafeeee guibg=#AFEEEE guifg=#000000 ctermbg=159 ctermfg=0
hi BGb0c4de guibg=#B0C4DE guifg=#000000 ctermbg=153 ctermfg=0
hi BGb0e0e6 guibg=#B0E0E6 guifg=#000000 ctermbg=152 ctermfg=0
hi BGb22222 guibg=#B22222 guifg=#FFFFFF ctermbg=124 ctermfg=15
hi BGb8860b guibg=#B8860B guifg=#000000 ctermbg=136 ctermfg=0
hi BGba55d3 guibg=#BA55D3 guifg=#000000 ctermbg=134 ctermfg=0
hi BGbc8f8f guibg=#BC8F8F guifg=#000000 ctermbg=138 ctermfg=0
hi BGbdb76b guibg=#BDB76B guifg=#000000 ctermbg=143 ctermfg=0
hi BGc71585 guibg=#C71585 guifg=#FFFFFF ctermbg=162 ctermfg=15
hi BGcd5c5c guibg=#CD5C5C guifg=#000000 ctermbg=167 ctermfg=0
hi BGcd853f guibg=#CD853F guifg=#000000 ctermbg=172 ctermfg=0
hi BGd2691e guibg=#D2691E guifg=#000000 ctermbg=166 ctermfg=0
hi BGd2b48c guibg=#D2B48C guifg=#000000 ctermbg=180 ctermfg=0
hi BGd3d3d3 guibg=#D3D3D3 guifg=#000000 ctermbg=252 ctermfg=0
hi BGd87093 guibg=#D87093 guifg=#000000 ctermbg=168 ctermfg=0
hi BGd8bfd8 guibg=#D8BFD8 guifg=#000000 ctermbg=182 ctermfg=0
hi BGda70d6 guibg=#DA70D6 guifg=#000000 ctermbg=170 ctermfg=0
hi BGdaa520 guibg=#DAA520 guifg=#000000 ctermbg=178 ctermfg=0
hi BGdc143c guibg=#DC143C guifg=#FFFFFF ctermbg=197 ctermfg=15
hi BGdcdcdc guibg=#DCDCDC guifg=#000000 ctermbg=253 ctermfg=0
hi BGdda0dd guibg=#DDA0DD guifg=#000000 ctermbg=183 ctermfg=0
hi BGdeb887 guibg=#DEB887 guifg=#000000 ctermbg=180 ctermfg=0
hi BGe0ffff guibg=#E0FFFF guifg=#000000 ctermbg=195 ctermfg=0
hi BGe6e6fa guibg=#E6E6FA guifg=#000000 ctermbg=189 ctermfg=0
hi BGe9967a guibg=#E9967A guifg=#000000 ctermbg=209 ctermfg=0
hi BGee82ee guibg=#EE82EE guifg=#000000 ctermbg=213 ctermfg=0
hi BGeee8aa guibg=#EEE8AA guifg=#000000 ctermbg=229 ctermfg=0
hi BGf08080 guibg=#F08080 guifg=#000000 ctermbg=210 ctermfg=0
hi BGf0e68c guibg=#F0E68C guifg=#000000 ctermbg=186 ctermfg=0
hi BGf0f8ff guibg=#F0F8FF guifg=#000000 ctermbg=231 ctermfg=0
hi BGf0fff0 guibg=#F0FFF0 guifg=#000000 ctermbg=195 ctermfg=0
hi BGf0ffff guibg=#F0FFFF guifg=#000000 ctermbg=231 ctermfg=0
hi BGf4a460 guibg=#F4A460 guifg=#000000 ctermbg=215 ctermfg=0
hi BGf5deb3 guibg=#F5DEB3 guifg=#000000 ctermbg=223 ctermfg=0
hi BGf5f5dc guibg=#F5F5DC guifg=#000000 ctermbg=230 ctermfg=0
hi BGf5f5f5 guibg=#F5F5F5 guifg=#000000 ctermbg=255 ctermfg=0
hi BGf5fffa guibg=#F5FFFA guifg=#000000 ctermbg=231 ctermfg=0
hi BGf8f8ff guibg=#F8F8FF guifg=#000000 ctermbg=231 ctermfg=0
hi BGfa8072 guibg=#FA8072 guifg=#000000 ctermbg=210 ctermfg=0
hi BGfaebd7 guibg=#FAEBD7 guifg=#000000 ctermbg=255 ctermfg=0
hi BGfaf0e6 guibg=#FAF0E6 guifg=#000000 ctermbg=255 ctermfg=0
hi BGfafad2 guibg=#FAFAD2 guifg=#000000 ctermbg=230 ctermfg=0
hi BGfdf5e6 guibg=#FDF5E6 guifg=#000000 ctermbg=255 ctermfg=0
hi BGff1493 guibg=#FF1493 guifg=#FFFFFF ctermbg=198 ctermfg=15
hi BGff4500 guibg=#FF4500 guifg=#FFFFFF ctermbg=202 ctermfg=15
hi BGff6347 guibg=#FF6347 guifg=#000000 ctermbg=203 ctermfg=0
hi BGff69b4 guibg=#FF69B4 guifg=#000000 ctermbg=205 ctermfg=0
hi BGff7f50 guibg=#FF7F50 guifg=#000000 ctermbg=209 ctermfg=0
hi BGff8c00 guibg=#FF8C00 guifg=#000000 ctermbg=208 ctermfg=0
hi BGffa07a guibg=#FFA07A guifg=#000000 ctermbg=216 ctermfg=0
hi BGffa500 guibg=#FFA500 guifg=#000000 ctermbg=214 ctermfg=0
hi BGffb6c1 guibg=#FFB6C1 guifg=#000000 ctermbg=217 ctermfg=0
hi BGffc0cb guibg=#FFC0CB guifg=#000000 ctermbg=217 ctermfg=0
hi BGffd700 guibg=#FFD700 guifg=#000000 ctermbg=220 ctermfg=0
hi BGffdab9 guibg=#FFDAB9 guifg=#000000 ctermbg=223 ctermfg=0
hi BGffdead guibg=#FFDEAD guifg=#000000 ctermbg=223 ctermfg=0
hi BGffe4b5 guibg=#FFE4B5 guifg=#000000 ctermbg=223 ctermfg=0
hi BGffe4c4 guibg=#FFE4C4 guifg=#000000 ctermbg=223 ctermfg=0
hi BGffe4e1 guibg=#FFE4E1 guifg=#000000 ctermbg=224 ctermfg=0
hi BGffebcd guibg=#FFEBCD guifg=#000000 ctermbg=223 ctermfg=0
hi BGffefd5 guibg=#FFEFD5 guifg=#000000 ctermbg=230 ctermfg=0
hi BGfff0f5 guibg=#FFF0F5 guifg=#000000 ctermbg=255 ctermfg=0
hi BGfff5ee guibg=#FFF5EE guifg=#000000 ctermbg=231 ctermfg=0
hi BGfff8dc guibg=#FFF8DC guifg=#000000 ctermbg=230 ctermfg=0
hi BGfffacd guibg=#FFFACD guifg=#000000 ctermbg=230 ctermfg=0
hi BGfffaf0 guibg=#FFFAF0 guifg=#000000 ctermbg=231 ctermfg=0
hi BGfffafa guibg=#FFFAFA guifg=#000000 ctermbg=231 ctermfg=0
hi BGffffe0 guibg=#FFFFE0 guifg=#000000 ctermbg=230 ctermfg=0
hi BGfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=231 ctermfg=0
call extend( b:css_color_hi,
\{'00008b':0,'0000cd':0,'006400':0,'008b8b':0,'00bfff':1,'00ced1':1
\,'00fa9a':1,'00ff7f':1,'191970':0,'1e90ff':1,'20b2aa':1,'228b22':0
\,'2e8b57':0,'2f4f4f':0,'32cd32':1,'3cb371':1,'40e0d0':1,'4169e1':0
\,'4682b4':0,'483d8b':0,'48d1cc':1,'4b0082':0,'556b2f':0,'5f9ea0':1
\,'6495ed':1,'66cdaa':1,'696969':0,'6a5acd':0,'6b8e23':0,'708090':1
\,'778899':1,'7b68ee':1,'7cfc00':1,'7fff00':1,'7fffd4':1,'87ceeb':1
\,'87cefa':1,'8a2be2':0,'8b0000':0,'8b008b':0,'8b4513':0,'8fbc8f':1
\,'90ee90':1,'9370d8':1,'9400d3':0,'98fb98':1,'9932cc':0,'9acd32':1
\,'a0522d':0,'a52a2a':0,'a9a9a9':1,'add8e6':1,'adff2f':1,'afeeee':1
\,'b0c4de':1,'b0e0e6':1,'b22222':0,'b8860b':1,'ba55d3':1,'bc8f8f':1
\,'bdb76b':1,'c71585':0,'cd5c5c':1,'cd853f':1,'d2691e':1,'d2b48c':1
\,'d3d3d3':1,'d87093':1,'d8bfd8':1,'da70d6':1,'daa520':1,'dc143c':0
\,'dcdcdc':1,'dda0dd':1,'deb887':1,'e0ffff':1,'e6e6fa':1,'e9967a':1
\,'ee82ee':1,'eee8aa':1,'f08080':1,'f0e68c':1,'f0f8ff':1,'f0fff0':1
\,'f0ffff':1,'f4a460':1,'f5deb3':1,'f5f5dc':1,'f5f5f5':1,'f5fffa':1
\,'f8f8ff':1,'fa8072':1,'faebd7':1,'faf0e6':1,'fafad2':1,'fdf5e6':1
\,'ff1493':0,'ff4500':0,'ff6347':1,'ff69b4':1,'ff7f50':1,'ff8c00':1
\,'ffa07a':1,'ffa500':1,'ffb6c1':1,'ffc0cb':1,'ffd700':1,'ffdab9':1
\,'ffdead':1,'ffe4b5':1,'ffe4c4':1,'ffe4e1':1,'ffebcd':1,'ffefd5':1
\,'fff0f5':1,'fff5ee':1,'fff8dc':1,'fffacd':1,'fffaf0':1,'fffafa':1
\,'ffffe0':1,'fffff0':1} )
syn case ignore
syn keyword BGf0f8ff AliceBlue contained containedin=@colorableGroup
syn keyword BGfaebd7 AntiqueWhite contained containedin=@colorableGroup
syn keyword BG7fffd4 Aquamarine contained containedin=@colorableGroup
syn keyword BGf0ffff Azure contained containedin=@colorableGroup
syn keyword BGf5f5dc Beige contained containedin=@colorableGroup
syn keyword BGffe4c4 Bisque contained containedin=@colorableGroup
syn keyword BGffebcd BlanchedAlmond contained containedin=@colorableGroup
syn keyword BG8a2be2 BlueViolet contained containedin=@colorableGroup
syn keyword BGa52a2a Brown contained containedin=@colorableGroup
syn keyword BGdeb887 BurlyWood contained containedin=@colorableGroup
syn keyword BG5f9ea0 CadetBlue contained containedin=@colorableGroup
syn keyword BG7fff00 Chartreuse contained containedin=@colorableGroup
syn keyword BGd2691e Chocolate contained containedin=@colorableGroup
syn keyword BGff7f50 Coral contained containedin=@colorableGroup
syn keyword BG6495ed CornflowerBlue contained containedin=@colorableGroup
syn keyword BGfff8dc Cornsilk contained containedin=@colorableGroup
syn keyword BGdc143c Crimson contained containedin=@colorableGroup
syn keyword BG00ffff Cyan contained containedin=@colorableGroup
syn keyword BG00008b DarkBlue contained containedin=@colorableGroup
syn keyword BG008b8b DarkCyan contained containedin=@colorableGroup
syn keyword BGb8860b DarkGoldenRod contained containedin=@colorableGroup
syn keyword BGa9a9a9 DarkGray contained containedin=@colorableGroup
syn keyword BG006400 DarkGreen contained containedin=@colorableGroup
syn keyword BGa9a9a9 DarkGrey contained containedin=@colorableGroup
syn keyword BGbdb76b DarkKhaki contained containedin=@colorableGroup
syn keyword BG8b008b DarkMagenta contained containedin=@colorableGroup
syn keyword BG556b2f DarkOliveGreen contained containedin=@colorableGroup
syn keyword BG9932cc DarkOrchid contained containedin=@colorableGroup
syn keyword BG8b0000 DarkRed contained containedin=@colorableGroup
syn keyword BGe9967a DarkSalmon contained containedin=@colorableGroup
syn keyword BG8fbc8f DarkSeaGreen contained containedin=@colorableGroup
syn keyword BG483d8b DarkSlateBlue contained containedin=@colorableGroup
syn keyword BG2f4f4f DarkSlateGray contained containedin=@colorableGroup
syn keyword BG2f4f4f DarkSlateGrey contained containedin=@colorableGroup
syn keyword BG00ced1 DarkTurquoise contained containedin=@colorableGroup
syn keyword BG9400d3 DarkViolet contained containedin=@colorableGroup
syn keyword BGff8c00 Darkorange contained containedin=@colorableGroup
syn keyword BGff1493 DeepPink contained containedin=@colorableGroup
syn keyword BG00bfff DeepSkyBlue contained containedin=@colorableGroup
syn keyword BG696969 DimGray contained containedin=@colorableGroup
syn keyword BG696969 DimGrey contained containedin=@colorableGroup
syn keyword BG1e90ff DodgerBlue contained containedin=@colorableGroup
syn keyword BGb22222 FireBrick contained containedin=@colorableGroup
syn keyword BGfffaf0 FloralWhite contained containedin=@colorableGroup
syn keyword BG228b22 ForestGreen contained containedin=@colorableGroup
syn keyword BGdcdcdc Gainsboro contained containedin=@colorableGroup
syn keyword BGf8f8ff GhostWhite contained containedin=@colorableGroup
syn keyword BGffd700 Gold contained containedin=@colorableGroup
syn keyword BGdaa520 GoldenRod contained containedin=@colorableGroup
syn keyword BGadff2f GreenYellow contained containedin=@colorableGroup
syn keyword BG808080 Grey contained containedin=@colorableGroup
syn keyword BGf0fff0 HoneyDew contained containedin=@colorableGroup
syn keyword BGff69b4 HotPink contained containedin=@colorableGroup
syn keyword BGcd5c5c IndianRed contained containedin=@colorableGroup
syn keyword BG4b0082 Indigo contained containedin=@colorableGroup
syn keyword BGfffff0 Ivory contained containedin=@colorableGroup
syn keyword BGf0e68c Khaki contained containedin=@colorableGroup
syn keyword BGe6e6fa Lavender contained containedin=@colorableGroup
syn keyword BGfff0f5 LavenderBlush contained containedin=@colorableGroup
syn keyword BG7cfc00 LawnGreen contained containedin=@colorableGroup
syn keyword BGfffacd LemonChiffon contained containedin=@colorableGroup
syn keyword BGadd8e6 LightBlue contained containedin=@colorableGroup
syn keyword BGf08080 LightCoral contained containedin=@colorableGroup
syn keyword BGe0ffff LightCyan contained containedin=@colorableGroup
syn keyword BGfafad2 LightGoldenRodYellow contained containedin=@colorableGroup
syn keyword BGd3d3d3 LightGray contained containedin=@colorableGroup
syn keyword BG90ee90 LightGreen contained containedin=@colorableGroup
syn keyword BGd3d3d3 LightGrey contained containedin=@colorableGroup
syn keyword BGffb6c1 LightPink contained containedin=@colorableGroup
syn keyword BGffa07a LightSalmon contained containedin=@colorableGroup
syn keyword BG20b2aa LightSeaGreen contained containedin=@colorableGroup
syn keyword BG87cefa LightSkyBlue contained containedin=@colorableGroup
syn keyword BG778899 LightSlateGray contained containedin=@colorableGroup
syn keyword BG778899 LightSlateGrey contained containedin=@colorableGroup
syn keyword BGb0c4de LightSteelBlue contained containedin=@colorableGroup
syn keyword BGffffe0 LightYellow contained containedin=@colorableGroup
syn keyword BG32cd32 LimeGreen contained containedin=@colorableGroup
syn keyword BGfaf0e6 Linen contained containedin=@colorableGroup
syn keyword BGff00ff Magenta contained containedin=@colorableGroup
syn keyword BG66cdaa MediumAquaMarine contained containedin=@colorableGroup
syn keyword BG0000cd MediumBlue contained containedin=@colorableGroup
syn keyword BGba55d3 MediumOrchid contained containedin=@colorableGroup
syn keyword BG9370d8 MediumPurple contained containedin=@colorableGroup
syn keyword BG3cb371 MediumSeaGreen contained containedin=@colorableGroup
syn keyword BG7b68ee MediumSlateBlue contained containedin=@colorableGroup
syn keyword BG00fa9a MediumSpringGreen contained containedin=@colorableGroup
syn keyword BG48d1cc MediumTurquoise contained containedin=@colorableGroup
syn keyword BGc71585 MediumVioletRed contained containedin=@colorableGroup
syn keyword BG191970 MidnightBlue contained containedin=@colorableGroup
syn keyword BGf5fffa MintCream contained containedin=@colorableGroup
syn keyword BGffe4e1 MistyRose contained containedin=@colorableGroup
syn keyword BGffe4b5 Moccasin contained containedin=@colorableGroup
syn keyword BGffdead NavajoWhite contained containedin=@colorableGroup
syn keyword BGfdf5e6 OldLace contained containedin=@colorableGroup
syn keyword BG6b8e23 OliveDrab contained containedin=@colorableGroup
syn keyword BGffa500 Orange contained containedin=@colorableGroup
syn keyword BGff4500 OrangeRed contained containedin=@colorableGroup
syn keyword BGda70d6 Orchid contained containedin=@colorableGroup
syn keyword BGeee8aa PaleGoldenRod contained containedin=@colorableGroup
syn keyword BG98fb98 PaleGreen contained containedin=@colorableGroup
syn keyword BGafeeee PaleTurquoise contained containedin=@colorableGroup
syn keyword BGd87093 PaleVioletRed contained containedin=@colorableGroup
syn keyword BGffefd5 PapayaWhip contained containedin=@colorableGroup
syn keyword BGffdab9 PeachPuff contained containedin=@colorableGroup
syn keyword BGcd853f Peru contained containedin=@colorableGroup
syn keyword BGffc0cb Pink contained containedin=@colorableGroup
syn keyword BGdda0dd Plum contained containedin=@colorableGroup
syn keyword BGb0e0e6 PowderBlue contained containedin=@colorableGroup
syn keyword BGbc8f8f RosyBrown contained containedin=@colorableGroup
syn keyword BG4169e1 RoyalBlue contained containedin=@colorableGroup
syn keyword BG663399 RebeccaPurple contained containedin=@colorableGroup
syn keyword BG8b4513 SaddleBrown contained containedin=@colorableGroup
syn keyword BGfa8072 Salmon contained containedin=@colorableGroup
syn keyword BGf4a460 SandyBrown contained containedin=@colorableGroup
syn keyword BG2e8b57 SeaGreen contained containedin=@colorableGroup
syn keyword BGfff5ee SeaShell contained containedin=@colorableGroup
syn keyword BGa0522d Sienna contained containedin=@colorableGroup
syn keyword BG87ceeb SkyBlue contained containedin=@colorableGroup
syn keyword BG6a5acd SlateBlue contained containedin=@colorableGroup
syn keyword BG708090 SlateGray contained containedin=@colorableGroup
syn keyword BG708090 SlateGrey contained containedin=@colorableGroup
syn keyword BGfffafa Snow contained containedin=@colorableGroup
syn keyword BG00ff7f SpringGreen contained containedin=@colorableGroup
syn keyword BG4682b4 SteelBlue contained containedin=@colorableGroup
syn keyword BGd2b48c Tan contained containedin=@colorableGroup
syn keyword BGd8bfd8 Thistle contained containedin=@colorableGroup
syn keyword BGff6347 Tomato contained containedin=@colorableGroup
syn keyword BG40e0d0 Turquoise contained containedin=@colorableGroup
syn keyword BGee82ee Violet contained containedin=@colorableGroup
syn keyword BGf5deb3 Wheat contained containedin=@colorableGroup
syn keyword BGf5f5f5 WhiteSmoke contained containedin=@colorableGroup
syn keyword BG9acd32 YellowGreen contained containedin=@colorableGroup

View file

@ -0,0 +1,6 @@
#!/bin/sh
set -e
s=startuptime.txt
vim --startuptime $s -o -c qa "$@"
perl -lane'$sum += $F[1] if m!/\.vim/after/syntax/css\.vim$!; END {print $sum}' $s
rm $s

View file

@ -0,0 +1,13 @@
# TODO #0f0 should show up green
# TODO f00 should not show up red
set word = '#0f0'
echo "#0f0"
echo #f00
#f00
##0f0
# TODO #0f0
# TODO #0f0 TODO
cat <<X
#0f0
X

View file

@ -0,0 +1,24 @@
i { background: #359 }
b { background: #335599 }
u { background: rgba(144, 0, 0, .5) }
s { background: hsl(0, 100%, 50%) }
*::color1 { -x-: #359 }
*::color2 { -x-: #335599 }
*::color3 { -x-: rgba(144, 0, 0, .5) }
*::color4 { -x-: hsl(0, 100%, 50%) }
/*
* #123, #456
*/
/* #123456 */
ul {
color: white;
}
ul li {
color: yellow;
background: black;
}

View file

@ -0,0 +1,10 @@
# #0f0 should show up green
# f00 should not show up red
#f00
##0f0
# #0f0
echo '#0f0'
set result "#0f0"
echo #f00
echo ##0f0

View file

@ -0,0 +1,11 @@
var Example = React.createClass({
render: function() {
var style = {
color: '#ffde00',
backgroundColor: 'green',
border: '3px dotted rgba(255,0,0)'
fontSize: 200
};
return <div style={style}> Hi! </div>;
}
});

View file

@ -0,0 +1,24 @@
i { background: #359 }
b { background: #335599 }
u { background: rgba(144, 0, 0, .5) }
s { background: hsl(0, 100%, 50%) }
@color1: #359;
@color1: #335599;
@color3: rgba(144, 0, 0, .5);
@color4: hsl(0, 100%, 50%);
/*
* #123, #456
*/
// #123456
ul {
color: white;
li {
color: yellow;
background: black;
}
}

View file

@ -0,0 +1,69 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.colorscheme.nord;
hexColor = types.str // {
check = (x: hasPrefix "#" x && builtins.stringLength x == 7);
description = "hexadecimal color";
};
mkHexColorOption = name: default:
mkOption {
type = hexColor;
default = default;
description = name;
};
in {
## POLAR NIGHT
# The origin color or the Polar Night palette.
nord0 = mkHexColorOption "nord0" "#2E3440";
# A brighter shade color based on nord0.
nord1 = mkHexColorOption "nord1" "#3B4252";
# An even more brighter shade color of nord0.
nord2 = mkHexColorOption "nord2" "#434C5E";
# The brightest shade color based on nord0.
nord3 = mkHexColorOption "nord3" "#4C566A";
## SNOW STORM
# The origin color or the Snow Storm palette.
nord4 = mkHexColorOption "nord4" "#D8DEE9";
# A brighter shade color of nord4.
nord5 = mkHexColorOption "nord5" "#E5E9F0";
# The brightest shade color based on nord4.
nord6 = mkHexColorOption "nord6" "#ECEFF4";
## FROST
# A calm and highly contrasted color reminiscent of frozen polar water.
nord7 = mkHexColorOption "nord7" "#8FBCBB";
# The bright and shiny primary accent color reminiscent of pure and clear ice.
nord8 = mkHexColorOption "nord8" "#88C0D0";
# A more darkened and less saturated color reminiscent of arctic waters.
nord9 = mkHexColorOption "nord9" "#81A1C1";
# A dark and intensive color reminiscent of the deep arctic ocean.
nord10 = mkHexColorOption "nord10" "#5E81AC";
## AURORA
# RED
nord11 = mkHexColorOption "nord11" "#BF616A";
# ORANGE
nord12 = mkHexColorOption "nord12" "#D08770";
# YELLOW
nord13 = mkHexColorOption "nord13" "#EBCB8B";
# GREEN
nord14 = mkHexColorOption "nord14" "#A3BE8C";
# PURPLE
nord15 = mkHexColorOption "nord15" "#B48EAD";
}

View file

@ -0,0 +1,25 @@
i
background: #359
b
background: #335599
u
background: rgba(144, 0, 0, .5)
s
background: hsl(0, 100%, 50%)
!color1 = #359
!color2 = #335599
!color3 = rgba(144, 0, 0, .5)
!color4 = hsl(0, 100%, 50%)
/*
* #123, #456
*/
// #123456
ul
color = white
li
color = yellow
background = black

View file

@ -0,0 +1,24 @@
i { background: #359 }
b { background: #335599 }
u { background: rgba(144, 0, 0, .5) }
s { background: hsl(0, 100%, 50%) }
$color1: #359;
$color2: #335599;
$color3: rgba(144, 0, 0, .5);
$color4: hsl(0, 100%, 50%);
/*
* #123, #456
*/
// #123456
ul {
color: white;
li {
color: yellow;
background: black;
}
}

View file

@ -0,0 +1,26 @@
# XXX #0f0 should show up green
# XXX f00 should not show up red
# FIXME ff0 should show up yellow but are known not to
echo '#0f0'
echo ##0f0
echo \#ff0
echo #f00
echo ##0f0
echo # #0f0
cmd '#0f0'
cmd "#0f0"
cmd \#ff0
cmd #f00
cmd ##0f0
cmd # #0f0
echo `foo # #0f0`
for (( x = '#0f0' )) ; do : ; done
for (( x = "#0f0" )) ; do : ; done
#f00
##0f0 XXX
# #0f0 XXX
# XXX #0f0 XXX
cat << ''
#0f0

View file

@ -0,0 +1,28 @@
i
background #359
b
background #335599
u
background rgba(144, 0, 0, .5)
s
background hsl(0, 100%, 50%)
color1 = #359
color2 = #335599
color3 = rgba(144, 0, 0, .5)
color4 = hsl(0, 100%, 50%)
/*
* #123, #456
*/
// #123456
ul {
color: white;
li {
color: yellow;
background: black;
}
}

View file

@ -0,0 +1,13 @@
# TODO #0f0 should show up green
# TODO f00 should not show up red
set word = '#0f0'
echo "#0f0"
echo #f00
#f00
##0f0
# TODO #0f0
# TODO #0f0 TODO
cat <<X
#0f0
X

View file

@ -0,0 +1,21 @@
import { DefaultTheme } from 'styled-components';
const MyTheme = {
green2: '#2f7a5c',
green3: '#35b281',
green4: '#26805c',
green5: '#28664D',
};
/* green darker variations
'#3fa27b'
'#378e6c'
'#2f7a5c'
'#28664D'
'#20513e'
*/
let x = '#20513e';
let y = foo('#20513e');
export default myTheme;

Some files were not shown because too many files have changed in this diff Show more