Repository: LintaoAmons/CoolStuffes
Branch: main
Commit: 5460c29ebb8f
Files: 121
Total size: 420.5 KB
Directory structure:
gitextract_1f212uj9/
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── hammerspoon/
│ ├── .gitignore
│ ├── .hammerspoon/
│ │ ├── LICENSE
│ │ ├── Spoons/
│ │ │ ├── ReloadConfiguration.spoon/
│ │ │ │ ├── docs.json
│ │ │ │ └── init.lua
│ │ │ └── WinWin.spoon/
│ │ │ ├── docs.json
│ │ │ └── init.lua
│ │ ├── countdown.lua
│ │ ├── init.lua
│ │ ├── scenarioShortcuts.lua
│ │ ├── switch-app.lua
│ │ └── windows.lua
│ └── .luarc.json
├── ideavim/
│ └── .ideavimrc
├── karabiner/
│ └── .config/
│ └── karabiner/
│ ├── assets/
│ │ └── complex_modifications/
│ │ ├── bring-back-grave-accent-and-tilde.json
│ │ ├── hyper-key.json
│ │ ├── switch-option-and-cmd-when-wezterm.json
│ │ └── tab-only-keyboard-core.json
│ ├── automatic_backups/
│ │ ├── karabiner_20230719.json
│ │ ├── karabiner_20230814.json
│ │ └── karabiner_20231011.json
│ └── karabiner.json
├── nvim/
│ └── .config/
│ └── nvim/
│ ├── .stylua.toml
│ ├── READMD.md
│ ├── init.lua
│ └── lua/
│ ├── config/
│ │ ├── keymaps.lua
│ │ └── options.lua
│ ├── features/
│ │ ├── readme.md
│ │ └── terminal-and-run.lua
│ ├── plugins/
│ │ ├── editor-core/
│ │ │ ├── auto-close-pair.lua
│ │ │ ├── autosave.lua
│ │ │ ├── context-menu.lua
│ │ │ ├── file-navi.lua
│ │ │ ├── fuzzy-finders.lua
│ │ │ ├── window-tab-management/
│ │ │ │ ├── tab.lua
│ │ │ │ └── window.lua
│ │ │ └── window-tab-management.lua
│ │ ├── editor-enhance/
│ │ │ ├── aerial.lua
│ │ │ ├── ai/
│ │ │ │ ├── avante.lua
│ │ │ │ ├── code-companion.lua
│ │ │ │ ├── gp.lua
│ │ │ │ └── supermaven-nvim.lua
│ │ │ ├── ai.lua
│ │ │ ├── bookmarks.lua
│ │ │ ├── comment.lua
│ │ │ ├── copy.lua
│ │ │ ├── duplicate.lua
│ │ │ ├── encode-decode.lua
│ │ │ ├── flash.lua
│ │ │ ├── flatten.lua
│ │ │ ├── fold.lua
│ │ │ ├── lazydev.lua
│ │ │ ├── leap.lua
│ │ │ ├── multi-cursor.lua
│ │ │ ├── preview-plantuml.lua
│ │ │ ├── project.lua
│ │ │ ├── scratch.lua
│ │ │ ├── show-color.lua
│ │ │ ├── smart-open.lua
│ │ │ ├── surround.lua
│ │ │ ├── switch-case.lua
│ │ │ ├── terminal-and-run.lua
│ │ │ ├── text-objects.lua
│ │ │ └── trouble.lua
│ │ ├── git/
│ │ │ ├── context-menu.lua
│ │ │ ├── diffview.lua
│ │ │ ├── gitgraph.lua
│ │ │ ├── gitsign.lua
│ │ │ └── neogit.lua
│ │ ├── init.lua
│ │ ├── lang/
│ │ │ ├── css.lua
│ │ │ ├── go.lua
│ │ │ ├── helm.lua
│ │ │ ├── http.lua
│ │ │ ├── json.lua
│ │ │ ├── jsts.lua
│ │ │ ├── lua-and-example.lua
│ │ │ ├── markdown.lua
│ │ │ ├── prisma.lua
│ │ │ ├── python.lua
│ │ │ ├── sh.lua
│ │ │ ├── terraform.lua
│ │ │ ├── test-menu.lua
│ │ │ └── vim.lua
│ │ ├── lang-core/
│ │ │ ├── cmp.lua
│ │ │ ├── debug.lua
│ │ │ ├── find-and-replace.lua
│ │ │ ├── formatting.lua
│ │ │ ├── lint.lua
│ │ │ ├── lsp.lua
│ │ │ ├── refactor.lua
│ │ │ ├── snippet.lua
│ │ │ ├── test.lua
│ │ │ └── treesitter.lua
│ │ └── ui/
│ │ ├── beacon.lua
│ │ ├── cursor-word.lua
│ │ ├── dress.lua
│ │ ├── heirline.lua
│ │ ├── hlchuck.lua
│ │ ├── noice.lua
│ │ ├── nui-components.lua
│ │ ├── themes.lua
│ │ └── todo-comments.lua
│ └── util/
│ ├── base/
│ │ ├── fs.lua
│ │ ├── git.lua
│ │ ├── strings.lua
│ │ ├── sys.lua
│ │ └── table.lua
│ ├── editor.lua
│ ├── init.lua
│ ├── lang.lua
│ └── log.lua
├── tmux/
│ └── .tmux.conf
├── update.sh
├── vscode-jupyter-notebook/
│ └── vscode-jupyter-notebook.md
├── warpd/
│ └── .config/
│ └── warpd/
│ └── config
├── wezterm/
│ └── .wezterm.lua
└── zsh/
└── .zshrc
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.local
lvim/.config/lvim/bckgit
lvim/.config/lvim/plugin
.DS_Store
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2022 LintaoAmons
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: Makefile
================================================
update:
git pull --rebase
/opt/homebrew/bin/bash update.sh
================================================
FILE: README.md
================================================
转移到了/Moved to [VimEverywhere](https://github.com/LintaoAmons/VimEverywhere)
================================================
FILE: hammerspoon/.gitignore
================================================
# Compiled Lua sources
luac.out
# luarocks build files
*.src.rock
*.zip
*.tar.gz
# Object files
*.o
*.os
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
*.def
*.exp
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
.local-history
================================================
FILE: hammerspoon/.hammerspoon/LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: hammerspoon/.hammerspoon/Spoons/ReloadConfiguration.spoon/docs.json
================================================
[
{
"Command": [],
"Constant": [],
"Constructor": [],
"Deprecated": [],
"Field": [],
"Function": [],
"Method": [
{
"def": "ReloadConfiguration:bindHotkeys(mapping)",
"desc": "Binds hotkeys for ReloadConfiguration",
"doc": "Binds hotkeys for ReloadConfiguration\n\nParameters:\n * mapping - A table containing hotkey modifier/key details for the following items:\n * reloadConfiguration - This will cause the configuration to be reloaded",
"name": "bindHotkeys",
"parameters": [
" * mapping - A table containing hotkey modifier/key details for the following items:",
" * reloadConfiguration - This will cause the configuration to be reloaded"
],
"signature": "ReloadConfiguration:bindHotkeys(mapping)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "ReloadConfiguration:start()",
"desc": "Start ReloadConfiguration",
"doc": "Start ReloadConfiguration\n\nParameters:\n * None",
"name": "start",
"parameters": [
" * None"
],
"signature": "ReloadConfiguration:start()",
"stripped_doc": "",
"type": "Method"
}
],
"Variable": [
{
"def": "ReloadConfiguration.watch_paths",
"desc": "List of directories to watch for changes, defaults to hs.configdir",
"doc": "List of directories to watch for changes, defaults to hs.configdir",
"name": "watch_paths",
"signature": "ReloadConfiguration.watch_paths",
"stripped_doc": "",
"type": "Variable"
}
],
"desc": "Adds a hotkey to reload the hammerspoon configuration, and a pathwatcher to automatically reload on changes.",
"doc": "Adds a hotkey to reload the hammerspoon configuration, and a pathwatcher to automatically reload on changes.\n\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ReloadConfiguration.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ReloadConfiguration.spoon.zip)",
"items": [
{
"def": "ReloadConfiguration:bindHotkeys(mapping)",
"desc": "Binds hotkeys for ReloadConfiguration",
"doc": "Binds hotkeys for ReloadConfiguration\n\nParameters:\n * mapping - A table containing hotkey modifier/key details for the following items:\n * reloadConfiguration - This will cause the configuration to be reloaded",
"name": "bindHotkeys",
"parameters": [
" * mapping - A table containing hotkey modifier/key details for the following items:",
" * reloadConfiguration - This will cause the configuration to be reloaded"
],
"signature": "ReloadConfiguration:bindHotkeys(mapping)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "ReloadConfiguration:start()",
"desc": "Start ReloadConfiguration",
"doc": "Start ReloadConfiguration\n\nParameters:\n * None",
"name": "start",
"parameters": [
" * None"
],
"signature": "ReloadConfiguration:start()",
"stripped_doc": "",
"type": "Method"
},
{
"def": "ReloadConfiguration.watch_paths",
"desc": "List of directories to watch for changes, defaults to hs.configdir",
"doc": "List of directories to watch for changes, defaults to hs.configdir",
"name": "watch_paths",
"signature": "ReloadConfiguration.watch_paths",
"stripped_doc": "",
"type": "Variable"
}
],
"name": "ReloadConfiguration",
"stripped_doc": "\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ReloadConfiguration.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ReloadConfiguration.spoon.zip)",
"submodules": [],
"type": "Module"
}
]
================================================
FILE: hammerspoon/.hammerspoon/Spoons/ReloadConfiguration.spoon/init.lua
================================================
--- === ReloadConfiguration ===
---
--- Adds a hotkey to reload the hammerspoon configuration, and a pathwatcher to automatically reload on changes.
---
--- Download: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ReloadConfiguration.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ReloadConfiguration.spoon.zip)
local obj = {}
obj.__index = obj
-- Metadata
obj.name = "ReloadConfiguration"
obj.version = "1.0"
obj.author = "Jon Lorusso "
obj.homepage = "https://github.com/Hammerspoon/Spoons"
obj.license = "MIT - https://opensource.org/licenses/MIT"
--- ReloadConfiguration.watch_paths
--- Variable
--- List of directories to watch for changes, defaults to hs.configdir
obj.watch_paths = { hs.configdir }
--- ReloadConfiguration:bindHotkeys(mapping)
--- Method
--- Binds hotkeys for ReloadConfiguration
---
--- Parameters:
--- * mapping - A table containing hotkey modifier/key details for the following items:
--- * reloadConfiguration - This will cause the configuration to be reloaded
function obj:bindHotkeys(mapping)
local def = { reloadConfiguration = hs.fnutils.partial(hs.reload, self) }
hs.spoons.bindHotkeysToSpec(def, mapping)
end
--- ReloadConfiguration:start()
--- Method
--- Start ReloadConfiguration
---
--- Parameters:
--- * None
function obj:start()
self.watchers = {}
for _,dir in pairs(self.watch_paths) do
self.watchers[dir] = hs.pathwatcher.new(dir, hs.reload):start()
end
return self
end
return obj
================================================
FILE: hammerspoon/.hammerspoon/Spoons/WinWin.spoon/docs.json
================================================
[
{
"Command": [],
"Constant": [],
"Constructor": [],
"Deprecated": [],
"Field": [],
"Function": [],
"Method": [
{
"def": "WinWin:centerCursor()",
"desc": "Center the cursor on the focused window.",
"doc": "Center the cursor on the focused window.\n",
"name": "centerCursor",
"signature": "WinWin:centerCursor()",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:moveAndResize(option)",
"desc": "Move and resize the focused window.",
"doc": "Move and resize the focused window.\n\nParameters:\n * option - A string specifying the option, valid strings are: `halfleft`, `halfright`, `halfup`, `halfdown`, `cornerNW`, `cornerSW`, `cornerNE`, `cornerSE`, `center`, `fullscreen`, `maximize`, `minimize`, `expand`, `shrink`.",
"name": "moveAndResize",
"parameters": [
" * option - A string specifying the option, valid strings are: `halfleft`, `halfright`, `halfup`, `halfdown`, `cornerNW`, `cornerSW`, `cornerNE`, `cornerSE`, `center`, `fullscreen`, `maximize`, `minimize`, `expand`, `shrink`."
],
"signature": "WinWin:moveAndResize(option)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:moveToScreen(direction)",
"desc": "Move the focused window between all of the screens in the `direction`.",
"doc": "Move the focused window between all of the screens in the `direction`.\n\nParameters:\n * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`, `next`.",
"name": "moveToScreen",
"parameters": [
" * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`, `next`."
],
"signature": "WinWin:moveToScreen(direction)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:stepMove(direction)",
"desc": "Move the focused window in the `direction` by on step. The step scale equals to the width/height of one gridpart.",
"doc": "Move the focused window in the `direction` by on step. The step scale equals to the width/height of one gridpart.\n\nParameters:\n * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`.",
"name": "stepMove",
"parameters": [
" * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`."
],
"signature": "WinWin:stepMove(direction)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:stepResize(direction)",
"desc": "Resize the focused window in the `direction` by on step.",
"doc": "Resize the focused window in the `direction` by on step.\n\nParameters:\n * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`.",
"name": "stepResize",
"parameters": [
" * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`."
],
"signature": "WinWin:stepResize(direction)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:undo()",
"desc": "Undo the last window manipulation. Only those \"moveAndResize\" manipulations can be undone.",
"doc": "Undo the last window manipulation. Only those \"moveAndResize\" manipulations can be undone.\n",
"name": "undo",
"signature": "WinWin:undo()",
"stripped_doc": "",
"type": "Method"
}
],
"Variable": [
{
"def": "WinWin.gridparts",
"desc": "An integer specifying how many gridparts the screen should be divided into. Defaults to 30.",
"doc": "An integer specifying how many gridparts the screen should be divided into. Defaults to 30.",
"name": "gridparts",
"signature": "WinWin.gridparts",
"stripped_doc": "",
"type": "Variable"
}
],
"desc": "Windows manipulation",
"doc": "Windows manipulation\n\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/WinWin.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/WinWin.spoon.zip)",
"items": [
{
"def": "WinWin:centerCursor()",
"desc": "Center the cursor on the focused window.",
"doc": "Center the cursor on the focused window.\n",
"name": "centerCursor",
"signature": "WinWin:centerCursor()",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin.gridparts",
"desc": "An integer specifying how many gridparts the screen should be divided into. Defaults to 30.",
"doc": "An integer specifying how many gridparts the screen should be divided into. Defaults to 30.",
"name": "gridparts",
"signature": "WinWin.gridparts",
"stripped_doc": "",
"type": "Variable"
},
{
"def": "WinWin:moveAndResize(option)",
"desc": "Move and resize the focused window.",
"doc": "Move and resize the focused window.\n\nParameters:\n * option - A string specifying the option, valid strings are: `halfleft`, `halfright`, `halfup`, `halfdown`, `cornerNW`, `cornerSW`, `cornerNE`, `cornerSE`, `center`, `fullscreen`, `maximize`, `minimize`, `expand`, `shrink`.",
"name": "moveAndResize",
"parameters": [
" * option - A string specifying the option, valid strings are: `halfleft`, `halfright`, `halfup`, `halfdown`, `cornerNW`, `cornerSW`, `cornerNE`, `cornerSE`, `center`, `fullscreen`, `maximize`, `minimize`, `expand`, `shrink`."
],
"signature": "WinWin:moveAndResize(option)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:moveToScreen(direction)",
"desc": "Move the focused window between all of the screens in the `direction`.",
"doc": "Move the focused window between all of the screens in the `direction`.\n\nParameters:\n * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`, `next`.",
"name": "moveToScreen",
"parameters": [
" * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`, `next`."
],
"signature": "WinWin:moveToScreen(direction)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:stepMove(direction)",
"desc": "Move the focused window in the `direction` by on step. The step scale equals to the width/height of one gridpart.",
"doc": "Move the focused window in the `direction` by on step. The step scale equals to the width/height of one gridpart.\n\nParameters:\n * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`.",
"name": "stepMove",
"parameters": [
" * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`."
],
"signature": "WinWin:stepMove(direction)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:stepResize(direction)",
"desc": "Resize the focused window in the `direction` by on step.",
"doc": "Resize the focused window in the `direction` by on step.\n\nParameters:\n * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`.",
"name": "stepResize",
"parameters": [
" * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`."
],
"signature": "WinWin:stepResize(direction)",
"stripped_doc": "",
"type": "Method"
},
{
"def": "WinWin:undo()",
"desc": "Undo the last window manipulation. Only those \"moveAndResize\" manipulations can be undone.",
"doc": "Undo the last window manipulation. Only those \"moveAndResize\" manipulations can be undone.\n",
"name": "undo",
"signature": "WinWin:undo()",
"stripped_doc": "",
"type": "Method"
}
],
"name": "WinWin",
"stripped_doc": "\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/WinWin.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/WinWin.spoon.zip)",
"submodules": [],
"type": "Module"
}
]
================================================
FILE: hammerspoon/.hammerspoon/Spoons/WinWin.spoon/init.lua
================================================
--- === WinWin ===
---
--- Windows manipulation
---
--- Download: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/WinWin.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/WinWin.spoon.zip)
local obj = {}
obj.__index = obj
-- Metadata
obj.name = "WinWin"
obj.version = "1.0"
obj.author = "ashfinal "
obj.homepage = "https://github.com/Hammerspoon/Spoons"
obj.license = "MIT - https://opensource.org/licenses/MIT"
-- Windows manipulation history. Only the last operation is stored.
obj.history = {}
--- WinWin.gridparts
--- Variable
--- An integer specifying how many gridparts the screen should be divided into. Defaults to 30.
obj.gridparts = 30
--- WinWin:stepMove(direction)
--- Method
--- Move the focused window in the `direction` by on step. The step scale equals to the width/height of one gridpart.
---
--- Parameters:
--- * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`.
function obj:stepMove(direction)
local cwin = hs.window.focusedWindow()
if cwin then
local cscreen = cwin:screen()
local cres = cscreen:frame()
local stepw = cres.w / obj.gridparts
local steph = cres.h / obj.gridparts
local wtopleft = cwin:topLeft()
if direction == "left" then
cwin:setTopLeft({
x = wtopleft.x - stepw,
y = wtopleft.y
})
elseif direction == "right" then
cwin:setTopLeft({
x = wtopleft.x + stepw,
y = wtopleft.y
})
elseif direction == "up" then
cwin:setTopLeft({
x = wtopleft.x,
y = wtopleft.y - steph
})
elseif direction == "down" then
cwin:setTopLeft({
x = wtopleft.x,
y = wtopleft.y + steph
})
else
hs.alert.show("Unknown direction: " .. direction)
end
else
hs.alert.show("No focused window!")
end
end
--- WinWin:stepResize(direction)
--- Method
--- Resize the focused window in the `direction` by on step.
---
--- Parameters:
--- * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`.
function obj:stepResize(direction)
local cwin = hs.window.focusedWindow()
if cwin then
local cscreen = cwin:screen()
local cres = cscreen:frame()
local stepw = cres.w / obj.gridparts
local steph = cres.h / obj.gridparts
local wsize = cwin:size()
if direction == "left" then
cwin:setSize({
w = wsize.w - stepw,
h = wsize.h
})
elseif direction == "right" then
cwin:setSize({
w = wsize.w + stepw,
h = wsize.h
})
elseif direction == "up" then
cwin:setSize({
w = wsize.w,
h = wsize.h - steph
})
elseif direction == "down" then
cwin:setSize({
w = wsize.w,
h = wsize.h + steph
})
else
hs.alert.show("Unknown direction: " .. direction)
end
else
hs.alert.show("No focused window!")
end
end
local function windowStash(window)
local winid = window:id()
local winf = window:frame()
if #obj.history > 50 then
-- Make sure the history doesn't reach the maximum (50 items).
table.remove(obj.history) -- Remove the last item
end
local winstru = {winid, winf}
table.insert(obj.history, winstru) -- Insert new item of window history
end
--- WinWin:moveAndResize(option)
--- Method
--- Move and resize the focused window.
---
--- Parameters:
--- * option - A string specifying the option, valid strings are:
--- `halfleft`, `halfright`, `halfup`, `halfdown`, `cornerNW`, `cornerSW`, `cornerNE`, `cornerSE`, `center`, `fullscreen`, `maximize`, `minimize`, `expand`, `shrink`.
function obj:moveAndResize(option)
local cwin = hs.window.focusedWindow()
if cwin then
local cscreen = cwin:screen()
local cres = cscreen:frame()
local stepw = cres.w / obj.gridparts
local steph = cres.h / obj.gridparts
local wf = cwin:frame()
options = {
halfleft = function()
cwin:setFrame({
x = cres.x,
y = cres.y,
w = cres.w / 2,
h = cres.h
})
end,
halfright = function()
cwin:setFrame({
x = cres.x + cres.w / 2,
y = cres.y,
w = cres.w / 2,
h = cres.h
})
end,
halfup = function()
cwin:setFrame({
x = cres.x,
y = cres.y,
w = cres.w,
h = cres.h / 2
})
end,
halfdown = function()
cwin:setFrame({
x = cres.x,
y = cres.y + cres.h / 2,
w = cres.w,
h = cres.h / 2
})
end,
cornerNW = function()
cwin:setFrame({
x = cres.x,
y = cres.y,
w = cres.w / 2,
h = cres.h / 2
})
end,
cornerNE = function()
cwin:setFrame({
x = cres.x + cres.w / 2,
y = cres.y,
w = cres.w / 2,
h = cres.h / 2
})
end,
cornerSW = function()
cwin:setFrame({
x = cres.x,
y = cres.y + cres.h / 2,
w = cres.w / 2,
h = cres.h / 2
})
end,
cornerSE = function()
cwin:setFrame({
x = cres.x + cres.w / 2,
y = cres.y + cres.h / 2,
w = cres.w / 2,
h = cres.h / 2
})
end,
fullscreen = function()
cwin:setFullScreen(true)
end,
maximize = function()
cwin:maximize()
end,
minimize = function()
cwin:minimize()
end,
center = function()
cwin:centerOnScreen()
end,
expand = function()
cwin:setFrame({
x = wf.x - stepw,
y = wf.y - steph,
w = wf.w + (stepw * 2),
h = wf.h + (steph * 2)
})
end,
shrink = function()
cwin:setFrame({
x = wf.x + stepw,
y = wf.y + steph,
w = wf.w - (stepw * 2),
h = wf.h - (steph * 2)
})
end
}
if options[option] == nil then
hs.alert.show("Unknown option: " .. option)
else
-- if the window is fullscreen, and that's not what the user wants,
-- toggle fullscreen off before proceeding
if option ~= "fullscreen" and cwin:isFullScreen() then
cwin:setFullScreen(false)
-- a sleep is required to let the window manager register the new state,
-- otherwise the follow-up minimize() call doesn't work
hs.timer.usleep(999999)
end
windowStash(cwin)
options[option]()
end
else
hs.alert.show("No focused window!")
end
end
--- WinWin:moveToScreen(direction)
--- Method
--- Move the focused window between all of the screens in the `direction`.
---
--- Parameters:
--- * direction - A string specifying the direction, valid strings are: `left`, `right`, `up`, `down`, `next`.
function obj:moveToScreen(direction)
local cwin = hs.window.focusedWindow()
if cwin then
local cscreen = cwin:screen()
if direction == "up" then
cwin:moveOneScreenNorth()
elseif direction == "down" then
cwin:moveOneScreenSouth()
elseif direction == "left" then
cwin:moveOneScreenWest()
elseif direction == "right" then
cwin:moveOneScreenEast()
elseif direction == "next" then
cwin:moveToScreen(cscreen:next())
else
hs.alert.show("Unknown direction: " .. direction)
end
else
hs.alert.show("No focused window!")
end
end
--- WinWin:undo()
--- Method
--- Undo the last window manipulation. Only those "moveAndResize" manipulations can be undone.
---
function obj:undo()
local cwin = hs.window.focusedWindow()
local cwinid = cwin:id()
for idx, val in ipairs(obj.history) do
-- Has this window been stored previously?
if val[1] == cwinid then
cwin:setFrame(val[2])
end
end
end
--- WinWin:centerCursor()
--- Method
--- Center the cursor on the focused window.
---
function obj:centerCursor()
local cwin = hs.window.focusedWindow()
local wf = cwin:frame()
local cscreen = cwin:screen()
local cres = cscreen:frame()
if cwin then
-- Center the cursor one the focused window
hs.mouse.setAbsolutePosition({
x = wf.x + wf.w / 2,
y = wf.y + wf.h / 2
})
else
-- Center the cursor on the screen
hs.mouse.setAbsolutePosition({
x = cres.x + cres.w / 2,
y = cres.y + cres.h / 2
})
end
end
return obj
================================================
FILE: hammerspoon/.hammerspoon/countdown.lua
================================================
local remindTimer = nil
local sound = hs.sound.getByName("Glass")
function remindUser()
hs.alert.show("Time is up!", 5)
sound:play()
remindTimer = nil -- set timer object to nil so that it can be restarted later
end
function parseTime(input)
local totalSeconds = 0
for value, unit in input:gmatch("(%d+)([smh]?)") do
value = tonumber(value)
if unit == "s" or unit == "" then
totalSeconds = totalSeconds + value
elseif unit == "m" then
totalSeconds = totalSeconds + value * 60
elseif unit == "h" then
totalSeconds = totalSeconds + value * 60 * 60
end
end
return totalSeconds
end
function startRemindTimer()
-- Ask the user for input
local ok, result = hs.dialog.textPrompt("Remind Timer", "Enter the time (e.g. 5s, 10m, 1h, 1h3m4s):", "20m")
if ok then
-- Parse the user input
local time = parseTime(result)
if time ~= nil then
-- Start the timer
remindTimer = hs.timer.doAfter(time, remindUser)
-- Wait for 300ms before focusing on the popup window
hs.timer.doAfter(0.3, function()
local dialogWindow = hs.window.find("Remind Timer")
if dialogWindow then
dialogWindow:focus()
end
end)
else
hs.alert.show("Invalid input, please enter a time in the format of 5s, 10m, or 1h3m4s.")
end
end
end
function stopRemindTimer()
if remindTimer ~= nil then
remindTimer:stop()
hs.notify.new({
title = "Reminder",
informativeText = "Timer Cancelled",
soundName = "Glass"
}):send()
remindTimer = nil
else
hs.notify.new({
title = "Reminder",
informativeText = "No Timer to cancel",
soundName = "Glass"
}):send()
end
end
function formatTime(seconds)
local hours = math.floor(seconds / 3600)
local minutes = math.floor(seconds / 60 % 60)
local remainingSeconds = math.floor(seconds % 60)
local timeString = ""
if hours > 0 then
return tostring(hours) .. " hour" .. (hours > 1 and "s" or "") .. " " .. tostring(minutes) .. " minute" ..
(minutes > 1 and "s" or "") .. " " .. tostring(remainingSeconds) .. " second" ..
(remainingSeconds ~= 1 and "s" or "")
end
if minutes > 0 then
return tostring(minutes) .. " minute" .. (minutes > 1 and "s" or "") .. " " .. tostring(remainingSeconds) ..
" second" .. (remainingSeconds ~= 1 and "s" or "")
end
return tostring(remainingSeconds) .. " second" .. (remainingSeconds ~= 1 and "s" or "")
end
function getRemainTime()
if remindTimer ~= nil then
local remainTime = remindTimer:nextTrigger()
local timeString = formatTime(remainTime)
hs.alert.show("Remaining time: " .. timeString)
sound:play()
else
hs.alert.show("No timer is running")
end
end
local hyperKey = { "shift", "alt", "ctrl", "cmd" }
function showCurrentTime()
local prettyNow = os.date("%A 📅%B %d %Y 🕐%I:%M:%S %p")
hs.alert.show(prettyNow, hs.alert.defaultStyle, hs.screen.mainScreen(), 1.5)
end
hs.hotkey.bind(hyperKey, "T", showCurrentTime)
-- Set a hotkey to get the remaining time of the timer
hs.hotkey.bind({"cmd", "ctrl", "alt"}, "R", getRemainTime)
-- Set a hotkey to start the timer
hs.hotkey.bind({"cmd", "ctrl", "alt"}, "T", startRemindTimer)
-- Set a hotkey to stop the timer
hs.hotkey.bind({"cmd", "ctrl", "alt"}, "S", stopRemindTimer)
================================================
FILE: hammerspoon/.hammerspoon/init.lua
================================================
require("windows")
-- require('scenarioShortcuts')
require("countdown")
require("switch-app")
hs.loadSpoon("ReloadConfiguration")
spoon.ReloadConfiguration:start()
================================================
FILE: hammerspoon/.hammerspoon/scenarioShortcuts.lua
================================================
local hyperKey = { "shift", "alt", "ctrl", "cmd" }
local function remap(mods, key, pressFn)
return hs.hotkey.bind(mods, key, pressFn, nil, pressFn)
end
function showFocusAlert(content)
hs.alert.show(content, hs.alert.defaultStyle, hs.screen.mainScreen(), 0.5)
end
local hyperKey = { "shift", "alt", "ctrl", "cmd" }
function showCurrentTime()
local prettyNow = os.date("%A 📅%B %d %Y 🕐%I:%M:%S %p")
hs.alert.show(prettyNow, hs.alert.defaultStyle, hs.screen.mainScreen(), 1.5)
end
remap(hyperKey, "t", showCurrentTime)
local function keyStroke(mods, key)
if key == nil then
key = mods
mods = {}
end
return function()
hs.eventtap.keyStroke(mods, key, 1000)
end
end
-- TODO 变成接受两个变量(from, to),变量的类型是 {keycode,mods}
function tmuxCmdCtrlToPrefix(fromKey, mods, toKey)
if mods == nil then
mods = {}
end
if toKey == nil then
toKey = fromKey
end
return remap({ "cmd", "ctrl" }, fromKey, function()
hs.eventtap.keyStroke({ "ctrl" }, "b", 1000)
hs.timer.doAfter(0.2, function()
hs.eventtap.keyStroke(mods, toKey)
end)
end)
end
function tmuxHyperToPrefix(key)
return remap(hyperKey, key, function()
hs.eventtap.keyStroke({ "ctrl" }, "b", 1000)
hs.timer.doAfter(0.2, function()
hs.eventtap.keyStroke({}, key)
end)
end)
end
function tmuxSwitchWindow(windowNumber)
return tmuxHyperToPrefix(windowNumber)
end
function terminalCommand(key, cmd)
return remap({ "cmd", "ctrl" }, key, function()
hs.eventtap.keyStrokes(cmd)
hs.timer.doAfter(0.2, function()
hs.eventtap.keyStroke({}, "return", 1000)
end)
end)
end
local allScenarios = {
everEnable = "everEnable",
firefox = "firefox",
terminal = "terminal",
joplin = "joplin",
}
local scenarioShortcuts = {
[allScenarios.everEnable] = {
toggleKeyboardCursor = remap(hyperKey, "c", keyStroke({ "alt", "cmd" }, "c")),
},
[allScenarios.firefox] = {
nextTab = remap({ "cmd", "ctrl" }, "l", keyStroke({ "ctrl" }, "tab")),
prevTab = remap({ "cmd", "ctrl" }, "h", keyStroke({ "ctrl", "shift" }, "tab")),
},
[allScenarios.terminal] = {
showAllSessionWindowPane = tmuxCmdCtrlToPrefix("i", { }, "w"),
-- tmux::session
previousSession = tmuxCmdCtrlToPrefix("[", { "shift" }, "9"),
nextSession = tmuxCmdCtrlToPrefix("]", { "shift" }, "0"),
-- tmux::pane
paneRight = tmuxCmdCtrlToPrefix("l"),
paneLeft = tmuxCmdCtrlToPrefix("h"),
paneUp = tmuxCmdCtrlToPrefix("k"),
paneDown = tmuxCmdCtrlToPrefix("j"),
switchToNextPane = tmuxCmdCtrlToPrefix("o", {}, "z"),
maximizePane = tmuxCmdCtrlToPrefix("o", {}, "z"),
switchToWindow1 = tmuxHyperToPrefix("1"),
switchToWindow2 = tmuxHyperToPrefix("2"),
switchToWindow3 = tmuxHyperToPrefix("3"),
switchToWindow4 = tmuxHyperToPrefix("4"),
closePane = tmuxHyperToPrefix("x"),
},
[allScenarios.joplin] = {},
}
local function enableScenarioShortcuts(scenario)
for _, value in pairs(scenarioShortcuts[scenario]) do
value:enable()
end
end
local function disableScenarioShortcuts(scenario)
for _, value in pairs(scenarioShortcuts[scenario]) do
value:disable()
end
end
local function isInTable(table, value)
for k, v in pairs(table) do
if v == value then
return true
end
end
return false
end
local function enableAndDisableScenarios(scenarios)
scenarios = scenarios or {}
for _, value in pairs(allScenarios) do
if isInTable(scenarios, value) then
enableScenarioShortcuts(value)
else
disableScenarioShortcuts(value)
end
end
end
function applicationWatcher(appName, eventType, appObject)
if eventType == hs.application.watcher.activated then
-- 初始化senarioShortcuts
if appName == "Finder" then
-- Bring all Finder windows forward when one gets activated
appObject:selectMenuItem({ "Window", "Bring All to Front" })
end
if appName == "Alacritty" then
showFocusAlert("TERMINAL")
enableAndDisableScenarios({ allScenarios.terminal, allScenarios.everEnable })
end
if appName == "IntelliJ IDEA" then
showFocusAlert("IDEA")
enableAndDisableScenarios({ allScenarios.everEnable })
end
if appName == "Firefox" then
showFocusAlert("FIREFOX")
enableAndDisableScenarios({ allScenarios.firefox, allScenarios.everEnable })
end
if appName == "Joplin" then
showFocusAlert("JOPLIN")
enableAndDisableScenarios({ allScenarios.joplin, allScenarios.everEnable })
end
end
end
appWatcher = hs.application.watcher.new(applicationWatcher)
appWatcher:start()
================================================
FILE: hammerspoon/.hammerspoon/switch-app.lua
================================================
-- Define the keyboard shortcut to switch to Chrome
local hyperKey = { "shift", "alt", "ctrl", "cmd" }
local shortcuts = {
["Google Chat.app"] = "g",
["Google Chrome.app"] = "f",
["Obsidian"] = "j",
["wezTerm"] = "k",
["Finder"] = "l",
["Intellij IDEA"] = "i",
["Arc"] = "o",
["Excalidraw.app"] = "n",
["Visual Studio Code"] = "m", -- this is Visual Studio Code
}
local function switchTo(appName)
local appRunning = hs.application.get(appName)
if appRunning then
-- If App is running, activate it
appRunning:activate()
else
-- If App is not running, launch it
hs.application.launchOrFocus(appName)
end
end
for appName, shortcut in pairs(shortcuts) do
hs.hotkey
.new(hyperKey, shortcut, function()
switchTo(appName)
end)
:enable()
end
================================================
FILE: hammerspoon/.hammerspoon/windows.lua
================================================
local hyperKey = { "shift", "alt", "ctrl", "cmd" }
hs.hotkey.bind(hyperKey, "a", function()
hs.window.focusedWindow():moveToUnit({ 0, 0, 0.5, 1 })
end)
hs.hotkey.bind(hyperKey, "d", function()
hs.window.focusedWindow():moveToUnit({ 0.5, 0, 0.5, 1 })
end)
hs.hotkey.bind(hyperKey, "w", function()
hs.window.focusedWindow():moveToUnit({ 0, 0, 1, 0.5 })
end)
hs.hotkey.bind(hyperKey, "s", function()
hs.window.focusedWindow():moveToUnit({ 0, 0.5, 1, 0.5 })
end)
-- full screen
hs.hotkey.bind(hyperKey, "z", function()
hs.window.focusedWindow():moveToUnit({ 0, 0, 1, 1 })
end)
-- move to another screen
hs.hotkey.bind(hyperKey, "r", function()
-- get the focused window
local win = hs.window.focusedWindow()
-- get the screen where the focused window is displayed, a.k.a. current screen
local screen = win:screen()
-- compute the unitRect of the focused window relative to the current screen
-- and move the window to the next screen setting the same unitRect
win:move(win:frame():toUnitRect(screen:frame()), screen:next(), true, 0)
end)
-- Toggle a window between its normal size, and being maximized
local function toggle_window_full_screen()
local win = hs.window.focusedWindow()
if win ~= nil then
win:setFullScreen(not win:isFullScreen())
end
end
hs.hotkey.bind(hyperKey, "e", toggle_window_full_screen)
-- local switcher = hs.window.switcher.new(hs.window.filter.new():setCurrentSpace(true):setDefaultFilter({}))
-- hs.hotkey.bind(hyperKey, "m", "Next window", function()
-- switcher:next()
-- end)
-- hs.hotkey.bind(hyperKey, "n", "Previous window", function()
-- switcher:previous()
-- end)
-- -- quarter of screen
-- --[[
-- u i
-- j k
-- --]]
-- hs.hotkey.bind({'ctrl', 'alt', 'cmd'}, 'u', function() hs.window.focusedWindow():moveToUnit({0, 0, 0.5, 0.5}) end)
-- hs.hotkey.bind({'ctrl', 'alt', 'cmd'}, 'k', function() hs.window.focusedWindow():moveToUnit({0.5, 0.5, 0.5, 0.5}) end)
-- hs.hotkey.bind({'ctrl', 'alt', 'cmd'}, 'i', function() hs.window.focusedWindow():moveToUnit({0.5, 0, 0.5, 0.5}) end)
-- hs.hotkey.bind({'ctrl', 'alt', 'cmd'}, 'j', function() hs.window.focusedWindow():moveToUnit({0, 0.5, 0.5, 0.5}) end)
================================================
FILE: hammerspoon/.luarc.json
================================================
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.diagnostics.globals": [
"vim",
"describe",
"it",
"before_each",
"after_each",
"hs"
]
}
================================================
FILE: ideavim/.ideavimrc
================================================
" ================================================================================================
" = Extensions =====================================
" ================================================================================================
Plug 'tpope/vim-surround'
Plug 'preservim/nerdtree'
Plug 'terryma/vim-multiple-cursors'
map
map mx
map mv
" ================================================================================================
" = Basic settings =====================================
" ================================================================================================
set clipboard+=unnamed
set ignorecase
set scrolloff=30
set history=200
set number
set relativenumber
set incsearch
set hlsearch
set keep-english-in-normal
" ================================================================================================
" = No Leader Keymaps =====================================
" ================================================================================================
nmap ge (GotoNextError)
nmap gt (GotoTest)
nmap gm (MethodUp)
nmap ga (GotoImplementation)
nmap go (GotoTypeDeclaration)
" bookmark
nmap mm (ToggleBookmark)
nmap ma mA
nmap 'a 'A
nmap L (NextTab)
nmap H (PreviousTab)
" ================================================================================================
" = Leader Keymaps =====================================
" ================================================================================================
" leaderkey
let mapleader=" "
" ================================================================================================
" 👻👻👻 Which-Key 👻👻👻
" ================================================================================================
set which-key
set notimeout
" d: diff
nmap dd (Vcs.ShowTabbedFileHistory)
" f: Find/Format ⭐️
let g:WhichKeyDesc_FindOrFormat = "f FindOrFormat"
let g:WhichKeyDesc_FindOrFormat_FindFile = "ff FindFile"
nmap ff (GotoFile)
let g:WhichKeyDesc_FindOrFormat_FindFileLocation = "fl FindFileLocation"
nmap fl (SelectInProjectView)
let g:WhichKeyDesc_FindOrFormat_FindText = "ft FindText"
nmap ft (FindInPath)
let g:WhichKeyDesc_FindOrFormat_Commands = "fc Commands"
nmap fc (GotoAction)
let g:WhichKeyDesc_FindOrFormat_OpenedProject = "fp OpenedProject"
nmap fp (OpenProjectWindows)
let g:WhichKeyDesc_FindOrFormat_Format = "fm Format"
nmap fm (ReformatCode) \| (OptimizeImports)
" g: Git ⭐️
let g:WhichKeyDesc_Git = "g Git"
let g:WhichKeyDesc_Git_RollbackHunk = "gr RollbackHunk"
nmap gr :action Vcs.RollbackChangedLines
" i: Insert ⭐️
let g:WhichKeyDesc_InsertAfterBrackets = "i InsertAfterBrackets"
nmap i f(a
" j: add Semicolon and goto nextline⭐️
let g:WhichKeyDesc_InsertSemicolon = "j InsertSemicolon"
nmap j A;o
" l: lsp: Language server protocol (align with neovim)⭐️
let g:WhichKeyDesc_LSP = "l LSP"
let g:WhichKeyDesc_LSP_Rename = "lr Rename"
nmap lr (RenameElement)
" n: No ⭐️
let g:WhichKeyDesc_No_Highlight = "nl NoHighlight"
nmap nl :nohlsearch
" s: Show ⭐️
let g:WhichKeyDesc_Show = "s Show"
let g:WhichKeyDesc_Show_FileStructure = "ss ShowFileStructure"
nmap ss (FileStructurePopup)
let g:WhichKeyDesc_Show_Bookmarks = "sb ShowBookmarks"
nmap sb (ShowBookmarks)
let g:WhichKeyDesc_Show_ParameterInfo = "sb ShowParameterInfo"
nmap sp (ParameterInfo)
" r: Run/Re ⭐️
let g:WhichKeyDesc_RunOrRe = "r RunOrRe"
let g:WhichKeyDesc_RunOrRe_ReRun = "rr ReRun"
nmap rr (Rerun)
let g:WhichKeyDesc_RunOrRe_ReRunTests = "rt ReRunTests"
nmap rt (RerunTests)
let g:WhichKeyDesc_RunOrRe_Rename = "rn Rename"
map rn (RenameElement)
" w: Window ⭐️
let g:WhichKeyDesc_Windows = "w Windows"
let g:WhichKeyDesc_Windows_maximize = "wo maximize"
nmap wo (UnsplitAll) \| (HideAllWindows)
let g:WhichKeyDesc_Windows_splitWindowVertically = "wl splitWindowVertically"
nmap wl (Macro.SplitVertically)
let g:WhichKeyDesc_Windows_closeActiveWindow = "wc closeActiveWindow"
nmap wc c
" z: zip(fold) ⭐️
let g:WhichKeyDesc_Zip = "z Zip"
let g:WhichKeyDesc_Zip_unZipAll = "zo unZipAll"
nmap zo (ExpandAllRegions)
let g:WhichKeyDesc_Zip_ZipAll = "zc ZipAll"
nmap zc (CollapseAllRegions)
" c: Close ⭐️;
let g:WhichKeyDesc_CloseBuffer = "c CloseBuffer"
nmap c :q!
" e: Toggle Explorer ⭐️
let g:WhichKeyDesc_ToggleExplorerOrExtract = "e ToggleExplorer"
nmap e (ActivateProjectToolWindow)
" e: Extract
" extract method/function
vmap em (ExtractMethod)
" extract constant
vmap ec (IntroduceConstant)
" extract field
vmap ef (IntroduceField)
" extract variable
vmap ev (IntroduceVariable)
================================================
FILE: karabiner/.config/karabiner/assets/complex_modifications/bring-back-grave-accent-and-tilde.json
================================================
{
"title": "Bring back grave_accent_and_tilde back after ESC mapping",
"rules": [
{
"description": "R_Shift+ESC to Tilde",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": "right_shift",
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": [
"left_shift"
]
}
]
}
]
},
{
"description": "Super_key+ESC to grave accent",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": [
"left_shift",
"left_command",
"left_control",
"left_option"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": []
}
]
}
]
}
]
}
================================================
FILE: karabiner/.config/karabiner/assets/complex_modifications/hyper-key.json
================================================
{
"title": "RightCommand : (HYPER) SHIFT+COMMAND+OPTION+CONTROL",
"rules": [
{
"description": "RightCommand : (HYPER) SHIFT+COMMAND+OPTION+CONTROL",
"manipulators": [
{
"from": {
"key_code": "right_command",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": ["left_command", "left_control", "left_option"]
}
],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+,",
"from": {
"key_code": "comma",
"modifiers": {
"mandatory": ["command", "shift", "option", "control"]
}
},
"to": [],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+.",
"from": {
"key_code": "period",
"modifiers": {
"mandatory": ["command", "shift", "option", "control"]
}
},
"to": [],
"type": "basic"
},
{
"from": {
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+/",
"key_code": "slash",
"modifiers": {
"mandatory": ["command", "shift", "option", "control"]
}
},
"to": [],
"type": "basic"
}
]
}
]
}
================================================
FILE: karabiner/.config/karabiner/assets/complex_modifications/switch-option-and-cmd-when-wezterm.json
================================================
{
"title": "WezTerm switch option with cmd",
"rules": [
{
"description": "WezTerm Left Option to Cmd",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": ["^com\\.github\\.wez\\.wezterm$"],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "left_option",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_command",
"lazy": true
}
],
"type": "basic"
}
]
},
{
"description": "WezTerm Left Cmd to Option",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": ["^com\\.github\\.wez\\.wezterm$"],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "left_command",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "left_option",
"lazy": true
}
],
"type": "basic"
}
]
}
]
}
================================================
FILE: karabiner/.config/karabiner/assets/complex_modifications/tab-only-keyboard-core.json
================================================
{
"title": "Tab : use only keyboard core area",
"rules": [
{
"description": "Tab + number: F1 ~ F12",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "1",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f1"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "2",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f2"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "3",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f3"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "4",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f4"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "5",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f5"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "6",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "7",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f7"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "8",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f8"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "9",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f9"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "0",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f10"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "hyphen",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f11"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "equal_sign",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f12"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + backspace to delete",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + hjkl to arrow keys",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + n/m --> HOME/END",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "n",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "home"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "m",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "end"
}
],
"type": "basic"
}
]
}
]
}
================================================
FILE: karabiner/.config/karabiner/automatic_backups/karabiner_20230719.json
================================================
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": []
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 4161,
"vendor_id": 1008
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 13330,
"vendor_id": 14
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}
================================================
FILE: karabiner/.config/karabiner/automatic_backups/karabiner_20230814.json
================================================
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "R_Shift+ESC to Tilde",
"manipulators": [
{
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": "right_shift",
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
}
]
},
{
"description": "Super_key+ESC to grave accent",
"manipulators": [
{
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": [
"left_shift",
"left_command",
"left_control",
"left_option"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": []
}
],
"type": "basic"
}
]
},
{
"description": "RightCommand : (HYPER) SHIFT+COMMAND+OPTION+CONTROL",
"manipulators": [
{
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+,",
"from": {
"key_code": "comma",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+.",
"from": {
"key_code": "period",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
},
{
"from": {
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+/",
"key_code": "slash",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
}
]
},
{
"description": "Tab + number: F1 ~ F12",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "1",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f1"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "2",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f2"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "3",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f3"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "4",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f4"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "5",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f5"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "6",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "7",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f7"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "8",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f8"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "9",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f9"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "0",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f10"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "hyphen",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f11"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "equal_sign",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f12"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + backspace to delete",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + hjkl to arrow keys",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 4161,
"vendor_id": 1008
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 13330,
"vendor_id": 14
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
},
{
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "left_option"
},
"to": [
{
"key_code": "left_command"
}
]
},
{
"from": {
"key_code": "right_option"
},
"to": [
{
"key_code": "right_command"
}
]
}
],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}
================================================
FILE: karabiner/.config/karabiner/automatic_backups/karabiner_20231011.json
================================================
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "R_Shift+ESC to Tilde",
"manipulators": [
{
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": "right_shift",
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
}
]
},
{
"description": "Super_key+ESC to grave accent",
"manipulators": [
{
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": [
"left_shift",
"left_command",
"left_control",
"left_option"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": []
}
],
"type": "basic"
}
]
},
{
"description": "RightCommand : (HYPER) SHIFT+COMMAND+OPTION+CONTROL",
"manipulators": [
{
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+,",
"from": {
"key_code": "comma",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+.",
"from": {
"key_code": "period",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
},
{
"from": {
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+/",
"key_code": "slash",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
}
]
},
{
"description": "Tab + number: F1 ~ F12",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "1",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f1"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "2",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f2"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "3",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f3"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "4",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f4"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "5",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f5"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "6",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "7",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f7"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "8",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f8"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "9",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f9"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "0",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f10"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "hyphen",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f11"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "equal_sign",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f12"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + backspace to delete",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + hjkl to arrow keys",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 4161,
"vendor_id": 1008
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 13330,
"vendor_id": 14
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
},
{
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "left_option"
},
"to": [
{
"key_code": "left_command"
}
]
},
{
"from": {
"key_code": "right_option"
},
"to": [
{
"key_code": "right_command"
}
]
}
],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 8249,
"vendor_id": 6785
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
},
{
"from": {
"key_code": "left_option"
},
"to": [
{
"key_code": "left_command"
}
]
},
{
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "grave_accent_and_tilde"
},
"to": [
{
"key_code": "escape"
}
]
},
{
"from": {
"key_code": "right_option"
},
"to": [
{
"key_code": "right_command"
}
]
},
{
"from": {
"key_code": "left_control"
},
"to": [
{
"key_code": "caps_lock"
}
]
}
],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}
================================================
FILE: karabiner/.config/karabiner/karabiner.json
================================================
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "R_Shift+ESC to Tilde",
"manipulators": [
{
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": "right_shift",
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": [
"left_shift"
]
}
],
"type": "basic"
}
]
},
{
"description": "Super_key+ESC to grave accent",
"manipulators": [
{
"from": {
"key_code": "escape",
"modifiers": {
"mandatory": [
"left_shift",
"left_command",
"left_control",
"left_option"
]
}
},
"to": [
{
"key_code": "grave_accent_and_tilde",
"modifiers": []
}
],
"type": "basic"
}
]
},
{
"description": "RightCommand : (HYPER) SHIFT+COMMAND+OPTION+CONTROL",
"manipulators": [
{
"from": {
"key_code": "right_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+,",
"from": {
"key_code": "comma",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
},
{
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+.",
"from": {
"key_code": "period",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
},
{
"from": {
"description": "Avoid starting sysdiagnose with the built-in macOS shortcut cmd+shift+option+ctrl+/",
"key_code": "slash",
"modifiers": {
"mandatory": [
"command",
"shift",
"option",
"control"
]
}
},
"to": [],
"type": "basic"
}
]
},
{
"description": "Tab + number: F1 ~ F12",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "1",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f1"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "2",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f2"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "3",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f3"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "4",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f4"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "5",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f5"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "6",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "7",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f7"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "8",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f8"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "9",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f9"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "0",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f10"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "hyphen",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f11"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "equal_sign",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f12"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + backspace to delete",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
},
{
"description": "Tab + hjkl to arrow keys",
"manipulators": [
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "tab pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "tab",
"modifiers": {
"optional": [
"any"
]
}
},
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 250
},
"to": [
{
"set_variable": {
"name": "tab pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "tab pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "tab"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 4161,
"vendor_id": 1008
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 13330,
"vendor_id": 14
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
},
{
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "left_option"
},
"to": [
{
"key_code": "left_command"
}
]
},
{
"from": {
"key_code": "right_option"
},
"to": [
{
"key_code": "right_command"
}
]
}
],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 8249,
"vendor_id": 6785
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
},
{
"from": {
"key_code": "grave_accent_and_tilde"
},
"to": [
{
"key_code": "escape"
}
]
},
{
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "left_control"
},
"to": [
{
"key_code": "caps_lock"
}
]
},
{
"from": {
"key_code": "left_option"
},
"to": [
{
"key_code": "left_command"
}
]
},
{
"from": {
"key_code": "right_option"
},
"to": [
{
"key_code": "right_command"
}
]
}
],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 33382,
"vendor_id": 9354
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 41619,
"vendor_id": 1241
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "left_control"
}
]
},
{
"from": {
"key_code": "left_option"
},
"to": [
{
"key_code": "left_command"
}
]
},
{
"from": {
"key_code": "left_command"
},
"to": [
{
"key_code": "left_option"
}
]
},
{
"from": {
"key_code": "right_option"
},
"to": [
{
"key_code": "right_command"
}
]
}
],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}
================================================
FILE: nvim/.config/nvim/.stylua.toml
================================================
column_width = 100
indent_type = "Spaces"
indent_width = 2
[sort_requires]
enabled = true
================================================
FILE: nvim/.config/nvim/READMD.md
================================================
## 去 https://oatnil.top 看看我的配置解析
## Go to https://oatnil.top to see my configuration explanation
================================================
FILE: nvim/.config/nvim/init.lua
================================================
require("config.options")
require("config.keymaps")
vim.g.config_utils = {
opts_ensure_installed = function(opts, new_item)
opts = opts or {}
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, new_item)
else
opts.ensure_installed = new_item
end
end,
}
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
-- NOTE: Here is where you install your plugins.
require("lazy").setup({
spec = { { import = "plugins" } },
change_detection = {
-- automatically check for config file changes and reload the ui
enabled = false,
notify = false, -- get a notification when changes are found
},
})
================================================
FILE: nvim/.config/nvim/lua/config/keymaps.lua
================================================
local command1 = "split"
vim.keymap.set("n", "ws", "" .. command1 .. "")
vim.api.nvim_create_user_command("SplitHorizotally", command1, {})
local command5 = "FzfLua live_grep"
vim.keymap.set("n", "ff", "" .. command5 .. "")
vim.api.nvim_create_user_command("LiveGrepInProject", command5, {})
local quitNvim = "qa!"
vim.keymap.set("n", "", "" .. quitNvim .. "")
vim.api.nvim_create_user_command("QuitNvim", quitNvim, {})
local no_highlight = "nohlsearch"
vim.keymap.set("n", "nl", "" .. no_highlight .. "")
local dont_replace_register = "P"
vim.keymap.set("v", "p", dont_replace_register)
local better_j = "gj"
vim.keymap.set("n", "j", better_j)
local better_k = "gk"
vim.keymap.set("n", "k", better_k)
local exit_alias = ""
vim.keymap.set("i", "jk", exit_alias)
local reload_buffer = "checktime"
vim.api.nvim_create_user_command("ReloadBuffer", reload_buffer, {})
================================================
FILE: nvim/.config/nvim/lua/config/options.lua
================================================
-- code is stolen from https://github.com/echasnovski/nvim/blob/master/lua/ec/settings.lua
-- stylua: ignore start
-- Leader key =================================================================
vim.g.mapleader = " "
vim.g.maplocalleader = ","
vim.g.autoformat = false
local opt = vim.opt
-- General ====================================================================
opt.backup = false -- Don't store backup
opt.mouse = 'a' -- Enable mouse
-- https://github.com/mfussenegger/nvim-dap/blob/master/doc/dap.txt
-- error: Stopped at line 2 but `switchbuf` setting prevented jump to location. Target buffer 55 not open in any window?
-- opt.switchbuf = 'usetab' -- Use already opened buffers when switching
opt.writebackup = false -- Don't store backup
opt.undofile = true -- Enable persistent undo
opt.swapfile = false
opt.guifont = 'FiraCode Nerd Font:h16'
opt.cmdheight = 0
opt.clipboard = ""
-- UI =========================================================================
opt.conceallevel = 0
opt.breakindent = true -- Indent wrapped lines to match line start
opt.cursorline = true -- Enable highlighting of the current line
opt.laststatus = 3 -- show statusline in last window
opt.linebreak = true -- Wrap long lines at 'breakat' (if 'wrap' is set)
opt.list = true -- Show helpful character indicators
opt.relativenumber = true -- Show relative line numbers
opt.number = true -- Show current line's real line number instead of 0
opt.pumblend = 0 -- Make builtin completion menus slightly transparent
opt.pumheight = 10 -- Make popup menu smaller
opt.ruler = false -- Don't show cursor position
opt.shortmess = 'aoOWFc' -- Disable certain messages from |ins-completion-menu|
opt.showmode = false -- Don't show mode in command line
opt.signcolumn = 'yes' -- Always show signcolumn or it would frequently shift
opt.splitbelow = true -- Horizontal splits will be below
opt.splitright = true -- Vertical splits will be to the right
opt.termguicolors = true -- Enable gui colors
opt.winblend = 0 -- Make floating windows transparent
opt.wrap = false -- Display long lines as just one line
vim.o.fillchars = table.concat(
{ 'eob: ', 'fold:╌', 'horiz:═', 'horizdown:╦', 'horizup:╩', 'vert:║', 'verthoriz:╬', 'vertleft:╣',
'vertright:╠' },
','
)
vim.o.listchars = table.concat(
{ 'extends:…', 'nbsp:␣', 'precedes:…', 'tab:> ' },
','
)
opt.shortmess:append('C') -- Don't show "Scanning..." messages
opt.splitkeep = 'screen' -- Reduce scroll during window split
-- Editing ====================================================================
opt.autoindent = true -- Use auto indent
opt.expandtab = true -- Convert tabs to spaces
opt.formatoptions = 'rqnl1j' -- Improve comment editing
opt.ignorecase = true -- Ignore case when searching (use `\C` to force not doing that)
opt.incsearch = true -- Show search results while typing
opt.infercase = true -- Infer letter cases for a richer built-in keyword completion
opt.shiftwidth = 4 -- Use this number of spaces for indentation
opt.smartcase = true -- Don't ignore case when searching if pattern has upper case
opt.smartindent = true -- Make indenting smart
opt.tabstop = 4 -- Insert 4 spaces for a tab
opt.virtualedit = 'block' -- Allow going past the end of line in visual block mode
opt.iskeyword:append('-') -- Treat dash separated words as a word text object
opt.completeopt = 'menuone,noinsert,noselect' -- Customize completions
-- Define pattern for a start of 'numbered' list. This is responsible for
-- correct formatting of lists when using `gw`. This basically reads as 'at
-- least one special character (digit, -, +, *) possibly followed some
-- punctuation (. or `)`) followed by at least one space is a start of list
-- item'
opt.formatlistpat = [[^\s*[0-9\-\+\*]\+[\.\)]*\s\+]]
--stylua: ignore end
--
opt.clipboard = "unnamedplus"
================================================
FILE: nvim/.config/nvim/lua/features/readme.md
================================================
this folder won't be `imported` directly in `nvim-lintao/.config/nvim-lintao/init.lua:14:4`
it will be use as an lib for the plugins configurations
the function here usually stands for a feature that will appear in multiple places
================================================
FILE: nvim/.config/nvim/lua/features/terminal-and-run.lua
================================================
local editor = require("util.editor")
local M = {}
function M.run_current_line()
local sys = require("util.base.sys")
local stringUtil = require("util.base.strings")
local currentLine = editor.buf.read.get_current_line()
local stdout = vim.fn.system(currentLine)
local result = stringUtil.split_into_lines(stdout)
editor.buf.write.put_lines(result, "l", true, true)
pcall(sys.copy_to_system_clipboard, stringUtil.join(result, "\n"))
end
return M
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/auto-close-pair.lua
================================================
return {
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
},
{
"windwp/nvim-ts-autotag",
config = function()
require("nvim-ts-autotag").setup({
opts = {
-- Defaults
enable_close = true, -- Auto close tags
enable_rename = true, -- Auto rename pairs of tags
enable_close_on_slash = false, -- Auto close on trailing
},
-- Also override individual filetype configs, these take priority.
-- Empty by default, useful if one of the "opts" global settings
-- doesn't work well in a specific filetype
per_filetype = {
-- ["html"] = {
-- enable_close = false,
-- },
},
})
end,
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/autosave.lua
================================================
local function save()
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_call(buf, function()
vim.cmd("silent! write")
end)
end
function ToggleAutoSave()
local flag = vim.g.auto_save or false
if flag then
vim.g.auto_save = false
vim.api.nvim_del_augroup_by_name("AutoSave")
else
vim.api.nvim_create_augroup("AutoSave", {
clear = true,
})
vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, {
callback = save,
pattern = "*",
group = "AutoSave",
})
vim.g.auto_save = true
end
end
ToggleAutoSave()
vim.api.nvim_create_user_command("ToggleAutoSave", ToggleAutoSave, {})
return {}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/context-menu.lua
================================================
vim.keymap.set({ "v", "n", "t" }, "", function() -- use wezterm remapping to ""
require("context-menu").trigger_context_menu()
end, {})
return {
dir = "/Volumes/t7ex/Documents/oatnil/beta/context-menu.nvim",
config = function()
require("context-menu").setup({
close_menu = { "q", "", "" },
menu_items = {
{
order = 1,
cmd = "Code Action",
not_ft = { "markdown", "toggleterm" },
action = {
type = "callback",
callback = function(_)
vim.cmd([[Lspsaga code_action]])
end,
},
},
{
order = 2,
cmd = "Run Test",
not_ft = { "markdown" },
filter_func = function(context)
local a = context.filename
if string.find(a, ".test.") or string.find(a, "spec.") then
return true
else
return false
end
end,
action = {
type = "callback",
callback = function(_)
require("neotest").run.run()
end,
},
},
},
})
end,
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/file-navi.lua
================================================
local function context_dir(state)
-- return the directory of the current neo-tree node
local node = state.tree:get_node()
if node.type == "directory" then
return node.path
end
return node.path:gsub("/[^/]*$", "") -- go up one level
end
local function open_mini_files()
local cmd = function()
require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
end
vim.keymap.set("n", "e", cmd, { noremap = true, silent = true })
end
open_mini_files()
local function reveal_current_file()
local command = "Neotree reveal reveal_force_cwd"
vim.keymap.set("n", "fl", "" .. command .. "", { noremap = true, silent = true })
vim.api.nvim_create_user_command("LocateCurrentBuf", command, {})
end
reveal_current_file()
vim.keymap.set("n", "", "Neotree toggle", { desc = "ExplorerToggle" })
return {
{
-- https://github.com/linkarzu/dotfiles-latest/blob/64707e247c71a2536327e33effab57641c54d001/neovim/neobean/lua/plugins/mini-files.lua#L62
"echasnovski/mini.files",
version = false,
config = function()
require("mini.files").setup({ -- General options
mappings = {
close = "q",
-- Use this if you want to open several files
-- go_in = "l",
-- This opens the file, but quits out of mini.files (default L)
go_in_plus = "l",
-- I swapped the following 2 (default go_out: h)
-- go_out_plus: when you go out, it shows you only 1 item to the right
-- go_out: shows you all the items to the right
go_out = "H",
go_out_plus = "h",
-- Default
reset = ",",
-- Default @
reveal_cwd = ".",
show_help = "g?",
-- Default =
synchronize = "s",
trim_left = "<",
trim_right = ">",
},
windows = {
preview = true,
width_focus = 30,
width_preview = 80,
},
options = {
-- Whether to delete permanently or move into module-specific trash
permanent_delete = false,
-- Whether to use for editing directories
use_as_default_explorer = true,
},
})
vim.api.nvim_set_hl(0, 'MiniFilesNormal', { bg = '#111111' })
vim.api.nvim_set_hl(0, 'MiniFilesBorder', { bg = '#111111' })
end,
},
{
"s1n7ax/nvim-window-picker",
name = "window-picker",
event = "VeryLazy",
version = "2.*",
config = function()
require("window-picker").setup()
end,
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function()
require("neo-tree").setup({
source_selector = {
sources = { -- table
{
source = "filesystem", -- string
display_name = " Files ", -- string | nil
},
{
source = "git_status", -- string
display_name = " Git ", -- string | nil
},
},
},
window = {
position = "left",
-- width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["t"] = {
function(state)
local node = state.tree:get_node()
vim.fn.jobstart({ "open", node.path }, { detach = true })
end,
desc = "Open the current node by system default software",
nowait = true,
},
-- copy absolute path to clipboard
["Y"] = {
function(state)
local node = state.tree:get_node()
local content = node.path
vim.fn.setreg('"', content)
vim.fn.setreg("1", content)
vim.fn.setreg("+", content)
end,
desc = "copy absolute path",
nowait = true,
},
-- [""] = {
-- function(state)
-- local node = state.tree:get_node()
-- vim.cmd("tabnew")
-- vim.cmd("DiffviewOpen -- " .. node.path)
-- end,
-- desc = "Open file in diffview",
-- nowait = true,
-- },
-- open in telescope live grep
[""] = {
function(state)
require("telescope.builtin").live_grep({ cwd = context_dir(state) })
end,
desc = "live grep in current dir",
nowait = true,
},
[""] = {
function(state)
local node = state.tree:get_node()
if node.type == "directory" then
require("grug-far").grug_far({ prefills = { paths = node.path } })
else
require("grug-far").grug_far({ prefills = { paths = context_dir(state) } })
end
-- close neo-tree
vim.cmd("Neotree close")
end,
desc = "replace in current dir",
nowait = true,
},
[""] = {
"toggle_node",
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
["o"] = "open",
[""] = "cancel", -- close preview or floating neo-tree window
["P"] = { "toggle_preview", config = { use_float = true } },
["l"] = "open_drop",
["S"] = "open_split",
["s"] = "open_vsplit",
-- ["S"] = "split_with_window_picker",
-- ["s"] = "vsplit_with_window_picker",
-- ["t"] = "hello",
-- [""] = "open_drop",
-- ["t"] = "open_tab_drop",
["w"] = "open_with_window_picker",
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
["x"] = "close_node",
-- ['C'] = 'close_all_subnodes',
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["a"] = {
"add",
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none", -- "none", "relative", "absolute"
},
},
-- ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["D"] = "delete",
["r"] = "rename",
["y"] = "copy_to_clipboard",
["d"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
},
},
filesystem = {
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = false,
hide_gitignored = false,
hide_by_name = {
--"node_modules"
},
hide_by_pattern = { -- uses glob style patterns
-- "._*", -- mac file info on exFat external disk
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
".gitignored",
".dockerignore",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
follow_current_file = {
enabled = false, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
[""] = "navigate_up",
["h"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
-- ["f"] = "fuzzy_finder_directory",
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
-- ["ff"] = "filter_on_submit",
[""] = "clear_filter",
[""] = function(state)
-- get the current node
local node = state.tree:get_node()
-- if the node is not a directory, walk up the tree until we find one
while node and node.type ~= "directory" do
local parent_id = node:get_parent_id()
if parent_id == nil then
-- we must have reached the root node
-- this should not happen because the root node is always a directory
-- but just in case...
node = nil
break
end
node = state.tree:get_node(parent_id)
end
-- if we somehow didn't find a directory, just use the root node
local path = node and node.path or state.path
require("telescope.builtin").live_grep({
search_dirs = { path },
prompt_title = string.format("Grep in [%s]", vim.fs.basename(path)),
})
end,
},
fuzzy_finder_mappings = {
-- define keymaps for filter popup window in fuzzy_finder_mode
[""] = "move_cursor_down",
[""] = "move_cursor_down",
[""] = "move_cursor_up",
[""] = "move_cursor_up",
},
},
commands = {
hello = function()
print("Hello, neo-tree!")
end,
}, -- Add a custom command or override a global one using the same function name
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["bd"] = "buffer_delete",
[""] = "navigate_up",
["."] = "set_root",
},
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["u"] = "git_unstage_file",
["a"] = "git_add_file",
["r"] = "git_revert_file",
["c"] = "git_commit",
["gp"] = "git_push",
["gg"] = "git_commit_and_push",
},
},
},
})
end,
},
-- {
-- "Bekaboo/dropbar.nvim",
-- cond = function()
-- return vim.fn.has("nvim-0.10") == 1
-- end,
-- opts = function()
-- local utils = require("dropbar.utils")
-- return {
-- menu = {
-- -- When on, preview the symbol under the cursor on CursorMoved
-- preview = true,
-- -- When on, automatically set the cursor to the closest previous/next
-- -- clickable component in the direction of cursor movement on CursorMoved
-- quick_navigation = true,
-- entry = {
-- padding = {
-- left = 1,
-- right = 1,
-- },
-- },
-- -- Menu scrollbar options
-- scrollbar = {
-- enable = true,
-- -- The background / gutter of the scrollbar
-- -- When false, only the scrollbar thumb is shown.
-- background = true,
-- },
-- ---@type table>
-- keymaps = {
-- ["q"] = "q",
-- [""] = "q",
-- ["h"] = "q",
-- [""] = function()
-- local menu = utils.menu.get_current()
-- if not menu then
-- return
-- end
-- local cursor = vim.api.nvim_win_get_cursor(menu.win)
-- local component = menu.entries[cursor[1]]:first_clickable(cursor[2])
-- if component then
-- menu:click_on(component, nil, 1, "l")
-- end
-- end,
-- ["l"] = function()
-- local menu = utils.menu.get_current()
-- if not menu then
-- return
-- end
-- local cursor = vim.api.nvim_win_get_cursor(menu.win)
-- local component = menu.entries[cursor[1]]:first_clickable(cursor[2])
-- if component then
-- menu:click_on(component, nil, 1, "l")
-- end
-- end,
-- ["i"] = function()
-- local menu = utils.menu.get_current()
-- if not menu then
-- return
-- end
-- menu:fuzzy_find_open()
-- end,
-- },
-- },
-- }
-- end,
-- },
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/fuzzy-finders.lua
================================================
return {
{
"ibhagwan/fzf-lua",
-- optional for icon support
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
-- calling `setup` is optional for customization
require("fzf-lua").setup({})
end,
},
{ -- Fuzzy Finder (files, lsp, etc)
"nvim-telescope/telescope.nvim",
event = "VimEnter",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
"nvim-telescope/telescope-fzf-native.nvim",
-- `build` is used to run some command when the plugin is installed/updated.
-- This is only run then, not every time Neovim starts up.
build = "make",
-- `cond` is a condition used to determine whether this plugin should be
-- installed and loaded.
cond = function()
return vim.fn.executable("make") == 1
end,
},
{ "nvim-telescope/telescope-ui-select.nvim" },
-- Useful for getting pretty icons, but requires a Nerd Font.
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
},
config = function()
-- Two important keymaps to use while in Telescope are:
-- - Insert mode:
-- - Normal mode: ?
require("telescope").setup({
-- You can put your default mappings / updates / etc. in here
-- All the info you're looking for is in `:help telescope.setup()`
--
-- defaults = {
-- mappings = {
-- i = { [''] = 'to_fuzzy_refine' },
-- },
-- },
-- pickers = {}
defaults = {
mappings = {
i = {
[""] = require("telescope.actions").close,
},
n = {
[""] = require("telescope.actions").close,
},
},
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
},
})
-- Enable Telescope extensions if they are installed
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "ui-select")
end,
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/window-tab-management/tab.lua
================================================
local tabNext = "tabnext"
vim.keymap.set("n", "tl", "" .. tabNext .. "")
local tabPrevious = "tabprevious"
vim.keymap.set("n", "th", "" .. tabPrevious .. "")
local tabClose = "tabclose"
vim.keymap.set("n", "tt", "" .. tabClose .. "")
local find_tab = "FzfLua tabs"
vim.keymap.set("n", "tk", ":" .. find_tab .. "")
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/window-tab-management/window.lua
================================================
local function split_vertically()
local cmd = function()
if vim.bo.buftype == "terminal" then
local Terminal = require("toggleterm.terminal").Terminal
Terminal:new({}):toggle()
else
vim.cmd("rightbelow vsplit")
end
end
vim.keymap.set("n", "wl", cmd)
vim.api.nvim_create_user_command("SplitVertically", cmd, {})
end
split_vertically()
local function split_horizontally()
local cmd = "split"
vim.api.nvim_create_user_command("SplitHorizontally", cmd, {})
end
split_horizontally()
local function close_window_or_buffer()
local closeWindowOrBuffer = function()
local isOk, _ = pcall(vim.cmd, "close")
if not isOk then
vim.cmd("bd")
end
end
vim.keymap.set("n", "", closeWindowOrBuffer)
end
close_window_or_buffer()
local maxmise_windows = function()
require("util.editor").window.close_all_other_windows({
"filesystem", -- neo-tree
"Trouble",
"term",
})
end
vim.keymap.set("n", "wo", maxmise_windows)
local function maxmise_windows_all()
local cmd = function()
require("util.editor").window.close_all_other_windows({})
end
vim.keymap.set("n", "wO", cmd)
end
maxmise_windows_all()
local popup_window = {
cmd = function()
local api = vim.api
local buf = api.nvim_create_buf(false, true)
local opts = {
style = "minimal",
relative = "editor",
height = api.nvim_get_option("lines") - 2,
width = api.nvim_get_option("columns") - 3,
title = "Popup",
row = 2,
col = 3,
border = "rounded",
zindex = 20,
}
-- Create the floating window with the current buffer
api.nvim_open_win(buf, true, opts)
-- Set the buffer's modifiable option to true
api.nvim_buf_set_option(buf, "modifiable", true)
end,
actions = function(cmd)
vim.api.nvim_create_user_command("PopupWindow", cmd, {})
end,
}
popup_window.actions(popup_window.cmd)
local open_in_popup_window = {
cmd = function()
popup_window.cmd()
require("telescope").extensions.smart_open.smart_open({
cwd_only = true,
filename_first = false,
})
end,
actions = function(cmd)
vim.api.nvim_create_user_command("OpenInPopupWindow", cmd, {})
end,
}
open_in_popup_window.actions(open_in_popup_window.cmd)
local function maxmise_windows_as_popup()
local cmd = function()
local api = vim.api
-- Get the current buffer
local current_buf = api.nvim_get_current_buf()
-- Get the editor's dimensions
local win_width = api.nvim_get_option("columns")
local win_height = api.nvim_get_option("lines")
-- Define the floating window options
local opts = {
style = "minimal",
relative = "editor",
height = win_height - 2,
width = win_width - 3,
row = 2,
col = 3,
border = "rounded",
}
-- Create the floating window with the current buffer
api.nvim_open_win(current_buf, true, opts)
-- Set the buffer's modifiable option to true
api.nvim_buf_set_option(current_buf, "modifiable", true)
end
vim.keymap.set("n", "wp", cmd)
vim.api.nvim_create_user_command("MaxmiseWindowsAsPopup", cmd, {})
end
maxmise_windows_as_popup()
--stylua: ignore start
vim.keymap.set("n", "", "" .. "TmuxNavigateLeft" .. "")
vim.keymap.set("n", "", "" .. "TmuxNavigateRight" .. "")
vim.keymap.set("n", "", "" .. "TmuxNavigateDown" .. "")
vim.keymap.set("n", "", "" .. "TmuxNavigateUp" .. "")
local function resize_window()
vim.keymap.set( "n", "", "vertical resize +5", { desc = "Increase window width" })
vim.keymap.set( "n", "", "vertical resize -5", { desc = "Decrease window width" })
vim.keymap.set("n", "", "resize -5", { desc = "Increase window height" })
vim.keymap.set("n", "", "resize +5", { desc = "Decrease window height" })
end
resize_window()
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-core/window-tab-management.lua
================================================
require("plugins.editor-core.window-tab-management.window")
require("plugins.editor-core.window-tab-management.tab")
return {
"christoomey/vim-tmux-navigator",
event = "VeryLazy",
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/aerial.lua
================================================
(function()
local command = "AerialToggle"
vim.keymap.set("n", "ss", "" .. command .. "")
vim.api.nvim_create_user_command("ToggleOutline", command, {})
end)()
return {
"stevearc/aerial.nvim",
event = "VeryLazy",
config = function()
require("aerial").setup()
end,
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/ai/avante.lua
================================================
return {
"yetone/avante.nvim",
-- enabled = false,
event = "VeryLazy",
build = "make",
opts = {
-- provider = "openai", -- Only recommend using Claude
claude = {
endpoint = "your_endpoint",
model = "claude-3-5-sonnet-20240620",
temperature = 0,
max_tokens = 4096,
},
mappings = {
ask = "aa",
edit = "ae",
refresh = "ar",
--- @class AvanteConflictMappings
diff = {
ours = "co",
theirs = "ct",
none = "c0",
both = "cb",
next = "]x",
prev = "[x",
},
jump = {
next = "]]",
prev = "[[",
},
submit = {
normal = "",
insert = "",
},
toggle = {
debug = "ad",
hint = "ah",
},
},
},
dependencies = {
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below is optional, make sure to setup it properly if you have lazy=true
{
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/ai/code-companion.lua
================================================
opts = { noremap = true, silent = true }
vim.keymap.set({ "n", "v" }, "ac", "CodeCompanionChat", opts)
vim.keymap.set({ "n", "v" }, "ak", "CodeCompanionActions", opts)
vim.keymap.set({ "n", "v" }, "aj", "CodeCompanion", opts)
return {
"olimorris/codecompanion.nvim",
-- dir ="/Volumes/t7ex/Documents/Github/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"hrsh7th/nvim-cmp", -- Optional: For using slash commands and variables in the chat buffer
"nvim-telescope/telescope.nvim", -- Optional: For using slash commands
{ "stevearc/dressing.nvim", opts = {} }, -- Optional: Improves the default Neovim UI
},
config = function()
require("codecompanion").setup({
adapters = {
anthropic = function()
return require("codecompanion.adapters").extend("anthropic", {
url = "your_url",
})
end,
},
strategies = {
chat = {
adapter = "anthropic",
},
inline = {
adapter = "anthropic",
},
agent = {
adapter = "anthropic",
},
},
prompt_library = {
["Commit Message for Staged Files"] = {
strategy = "chat",
description = "staged file commit messages",
opts = {
index = 9,
default_prompt = true,
mapping = "gm",
slash_cmd = "commit-stage",
auto_submit = true,
},
prompts = {
{
role = "system",
content = "You are an expert at following the Conventional Commit specification.",
},
{
role = "user",
contains_code = true,
content = function()
return "Given the git diff listed below, please generate a commit message and put it inside a commit command for me:\n\n"
.. "```\n"
.. vim.fn.system("git diff --staged")
.. "\n```"
end,
},
},
},
},
keymaps = {
send = {
modes = {
n = { "", "" },
i = "",
},
index = 1,
callback = "keymaps.send",
description = "Send",
},
},
})
end,
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/ai/gp.lua
================================================
return {
"robitx/gp.nvim",
config = function()
local conf = {
-- For customization, refer to Install > Configuration in the Documentation/Readme
providers = {
anthropic = {
endpoint = "your_endpoint",
secret = os.getenv("ANTHROPIC_API_KEY"),
},
},
agents = {
{
provider = "anthropic",
name = "ChatClaude-3-Haiku",
chat = true,
command = false,
-- string with model name or table with model name and parameters
model = { model = "claude-3-haiku-20240307", temperature = 0.8, top_p = 1 },
-- system prompt (use this to specify the persona/role of the AI)
system_prompt = require("gp.defaults").chat_system_prompt,
},
},
hooks = {},
}
require("gp").setup(conf)
-- Setup shortcuts here (see Usage > Shortcuts in the Documentation/Readme)
end,
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/ai/supermaven-nvim.lua
================================================
return {
"supermaven-inc/supermaven-nvim",
config = function()
require("supermaven-nvim").setup({
disable_keymaps = true,
log_level = "error",
})
local completion_preview = require("supermaven-nvim.completion_preview")
vim.keymap.set(
"i",
"",
completion_preview.on_accept_suggestion,
{ noremap = true, silent = true }
)
vim.keymap.set(
"i",
"",
completion_preview.on_accept_suggestion_word,
{ noremap = true, silent = true }
)
end,
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/ai.lua
================================================
return {
{ import = "plugins.editor-enhance.ai" },
{
"LintaoAmons/context-menu.nvim",
opts = function()
require("context-menu").setup({
close_menu = { "q", "", "" },
menu_items = {
{
order = 1,
cmd = "AI",
keymap = "a",
action = {
type = "sub_cmds",
sub_cmds = {
{
order = 1,
keymap = "a",
cmd = "New",
action = {
type = "callback",
callback = function(_)
vim.cmd([[GpChatNew]])
end,
},
},
{
order = 3,
keymap = "p",
cmd = "Append",
action = {
type = "callback",
callback = function(_)
vim.cmd([[GpAppend]])
end,
},
},
{
order = 2,
cmd = "Find",
keymap = "f",
action = {
type = "callback",
callback = function(_)
vim.cmd([[GpChatFinder]])
end,
},
},
},
},
},
},
})
end,
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/bookmarks.lua
================================================
vim.keymap.set("n", "mg", "" .. "BookmarksGotoRecent" .. "")
vim.keymap.set("n", "mm", "" .. "BookmarksMark" .. "")
vim.keymap.set("n", "ma", "" .. "BookmarksCommands" .. "")
vim.keymap.set("n", "mo", "" .. "BookmarksGoto" .. "")
return {
{
"LintaoAmons/bookmarks.nvim",
-- branch = "dev",
event = "VeryLazy",
-- dir = "/Volumes/t7ex/Documents/oatnil/beta/bookmarks.nvim",
dependencies = {
{ "nvim-neo-tree/neo-tree.nvim" },
{ "ibhagwan/fzf-lua" },
},
config = function()
require("bookmarks").setup({
json_db_path = vim.fn.stdpath("data") .. "/bookmarks.db.json",
signs = {
mark = { icon = "", color = "red", line_bg = "#572626" },
desc_format = function(desc)
return desc
end,
},
picker = {
-- choose built-in sort logic by name: string, find all the sort logics in `bookmarks.adapter.sort-logic`
-- or custom sort logic: function(bookmarks: Bookmarks.Bookmark[]): nil
sort_by = "created_at",
},
treeview = {
win_cmd = "left", -- "left", "right", "bottom"
keymap = {
quit = { "q", "" },
refresh = "R",
create_folder = "a",
tree_cut = "x",
tree_paste = "p",
collapse = "o",
delete = "d",
active = "s",
copy = "c",
},
},
hooks = {
{
callback = function(bookmark, projects)
local project_path
for _, p in ipairs(projects) do
if p.name == bookmark.location.project_name then
project_path = p.path
end
end
if project_path then
vim.cmd("cd " .. project_path)
end
end,
},
},
})
end,
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/comment.lua
================================================
return {
{
"folke/ts-comments.nvim",
opts = {},
event = "VeryLazy",
},
{ "echasnovski/mini.comment", version = "*", opts = {} },
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/copy.lua
================================================
--- Returns the absolute path of the current file relative to the project root, and the current line and column.
--- @return string|nil
local function copy_line_ref()
local current_file_dir = vim.fn.expand("%:p:h") -- '%:p:h' expands to the directory of the current file
-- Find the .git directory starting from the current file's directory and moving upwards
local git_dir = vim.fn.finddir(".git", current_file_dir .. ";")
-- If a .git directory is found, get the project root
if git_dir ~= "" then
local project_root = vim.fn.fnamemodify(git_dir, ":p:h:h") -- Get the project root directory
-- Get the absolute path of the current file
local current_file_absolute = vim.fn.expand("%:p") -- Calculate the relative path from the project root to the current file
local relative_path = string.sub(current_file_absolute, string.len(project_root) + 2)
-- Get the current line and column in the same line by unpacking the cursor position
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
local line_ref = relative_path .. ":" .. line .. ":" .. col
vim.fn.setreg("+", line_ref)
-- Return the reference path, line, and column
return line_ref
else
return nil -- Return nil if no .git directory is found
end
end
vim.api.nvim_create_user_command("CopyLineRef", copy_line_ref, {})
local function copy_buf_name()
local buf_name = vim.fn.expand("%:p:t")
vim.print(buf_name)
vim.fn.setreg("+", buf_name)
return buf_name
end
vim.api.nvim_create_user_command("CopyBufName", copy_buf_name, {})
local function copy_buf_abs_path()
local abs_path = require("util.editor").buf.read.get_buf_abs_path()
vim.print(abs_path)
vim.fn.setreg("+", abs_path)
return abs_path
end
vim.api.nvim_create_user_command("CopyBufAbsPath", copy_buf_abs_path, {})
local function copy_buf_abs_dir_path()
local result = require("util.editor").buf.read.get_buf_abs_dir_path()
vim.print(result)
vim.fn.setreg("+", result)
return result
end
vim.api.nvim_create_user_command("CopyBufAbsDirPath", copy_buf_abs_dir_path, {})
local function copy_buf_relative_dir_path()
local result = require("util.editor").buf.read.get_buf_relative_dir_path()
vim.print(result)
vim.fn.setreg("+", result)
return result
end
vim.api.nvim_create_user_command("CopyBufRelativeDirPath", copy_buf_relative_dir_path, {})
return {
{
"LintaoAmons/context-menu.nvim",
opts = function(_)
require("context-menu").setup({
menu_items = {
{
cmd = "Copy",
keymap = "c",
action = {
type = "sub_cmds",
sub_cmds = {
{
cmd = "Copy Line Ref",
order = 91,
action = {
type = "callback",
callback = function(_)
copy_line_ref()
end,
},
},
{
cmd = "Copy Buf Name",
order = 92,
action = {
type = "callback",
callback = function(_)
copy_buf_name()
end,
},
},
{
cmd = "Copy Buf Abs Path",
order = 92,
action = {
type = "callback",
callback = function(_)
copy_buf_abs_path()
end,
},
},
{
cmd = "Copy Buf Abs Dir Path",
order = 92,
action = {
type = "callback",
callback = function(_)
copy_buf_abs_dir_path()
end,
},
},
{
cmd = "Copy Buf Relative Dir Path",
order = 92,
action = {
type = "callback",
callback = function(_)
copy_buf_relative_dir_path()
end,
},
},
},
},
},
},
})
end,
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/duplicate.lua
================================================
vim.keymap.set("v", "", "VisualDuplicate +1", { desc = "Duplication" })
vim.keymap.set("v", "", "VisualDuplicate -1", { desc = "Duplication" })
return {
"hinell/duplicate.nvim",
event = "VeryLazy",
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/encode-decode.lua
================================================
--- Function to increment each character in the selected text, except blank characters (encode)
local function encode_selected_chars()
local start_pos = vim.fn.getpos("'<")
local end_pos = vim.fn.getpos("'>")
local start_line = start_pos[2]
local start_col = start_pos[3]
local end_line = end_pos[2]
local end_col = end_pos[3]
-- Iterate through each line in the selected region
for line_num = start_line, end_line do
local line = vim.fn.getline(line_num)
local col_start = (line_num == start_line) and start_col or 1
local col_end = (line_num == end_line) and end_col or #line
local new_line = line:sub(1, col_start - 1)
-- Increment each character in the current line
for col = col_start, col_end do
local char = line:sub(col, col)
if char and char ~= " " and char ~= "\t" then
local new_char = string.char(char:byte() + 1)
new_line = new_line .. new_char
else
new_line = new_line .. char
end
end
new_line = new_line .. line:sub(col_end + 1)
-- Replace the line in the buffer
vim.fn.setline(line_num, new_line)
end
end
--- Function to decrement each character in the selected text, except blank characters (decode)
local function decode_selected_chars()
local start_pos = vim.fn.getpos("'<")
local end_pos = vim.fn.getpos("'>")
local start_line = start_pos[2]
local start_col = start_pos[3]
local end_line = end_pos[2]
local end_col = end_pos[3]
-- Iterate through each line in the selected region
for line_num = start_line, end_line do
local line = vim.fn.getline(line_num)
local col_start = (line_num == start_line) and start_col or 1
local col_end = (line_num == end_line) and end_col or #line
local new_line = line:sub(1, col_start - 1)
-- Decrement each character in the current line
for col = col_start, col_end do
local char = line:sub(col, col)
if char and char ~= " " and char ~= "\t" then
local new_char = string.char(char:byte() - 1)
new_line = new_line .. new_char
else
new_line = new_line .. char
end
end
new_line = new_line .. line:sub(col_end + 1)
-- Replace the line in the buffer
vim.fn.setline(line_num, new_line)
end
end
vim.keymap.set({ "n", "v" }, "ie", encode_selected_chars)
vim.keymap.set({ "n", "v" }, "id", decode_selected_chars)
-- Revised Explanation:
-- C-u in Keybinding:
-- : clears any existing command-line input. This ensures a clean state before running the Lua function.
-- This is especially useful when mapping functions to visual mode keybindings because Vim could otherwise append the function call to any existing text on the command line, leading to errors.
-- vim.api.nvim_set_keymap("v", "ie", ":lua encode_selected_chars()", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("v", "id", ":lua decode_selected_chars()", { noremap = true, silent = true })
return {}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/flash.lua
================================================
-- stylua: ignore start
-- vim.keymap.set({ "n", "x", "o" }, "ss", function() require("flash").treesitter() end, {})
-- stylua: ignore end
if true then
return {}
end
return {
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
-- labels = "abcdefghijklmnopqrstuvwxyz",
labels = "asdfghjklqwertyuiopzxcvbnm",
search = {
-- search/jump in all windows
multi_window = true,
-- search direction
forward = true,
-- when `false`, find only matches in the given direction
wrap = true,
---@type Flash.Pattern.Mode
-- Each mode will take ignorecase and smartcase into account.
-- * exact: exact match
-- * search: regular search
-- * fuzzy: fuzzy search
-- * fun(str): custom function that returns a pattern
-- For example, to only match at the beginning of a word:
-- mode = function(str)
-- return "\\<" .. str
-- end,
mode = "exact",
-- behave like `incsearch`
incremental = false,
-- Excluded filetypes and custom window filters
---@type (string|fun(win:window))[]
exclude = {
"notify",
"cmp_menu",
"noice",
"flash_prompt",
function(win)
-- exclude non-focusable windows
return not vim.api.nvim_win_get_config(win).focusable
end,
},
-- Optional trigger character that needs to be typed before
-- a jump label can be used. It's NOT recommended to set this,
-- unless you know what you're doing
trigger = "",
-- max pattern length. If the pattern length is equal to this
-- labels will no longer be skipped. When it exceeds this length
-- it will either end in a jump or terminate the search
max_length = false, ---@type number|false
},
jump = {
-- save location in the jumplist
jumplist = true,
-- jump position
pos = "start", ---@type "start" | "end" | "range"
-- add pattern to search history
history = false,
-- add pattern to search register
register = false,
-- clear highlight after jump
nohlsearch = false,
-- automatically jump when there is only one match
autojump = false,
-- You can force inclusive/exclusive jumps by setting the
-- `inclusive` option. By default it will be automatically
-- set based on the mode.
inclusive = nil, ---@type boolean?
-- jump position offset. Not used for range jumps.
-- 0: default
-- 1: when pos == "end" and pos < current position
offset = nil, ---@type number
},
label = {
-- allow uppercase labels
uppercase = true,
-- add any labels with the correct case here, that you want to exclude
exclude = "",
-- add a label for the first match in the current window.
-- you can always jump to the first match with ``
current = true,
-- show the label after the match
after = true, ---@type boolean|number[]
-- show the label before the match
before = false, ---@type boolean|number[]
-- position of the label extmark
style = "overlay", ---@type "eol" | "overlay" | "right_align" | "inline"
-- flash tries to re-use labels that were already assigned to a position,
-- when typing more characters. By default only lower-case labels are re-used.
reuse = "lowercase", ---@type "lowercase" | "all" | "none"
-- for the current window, label targets closer to the cursor first
distance = true,
-- minimum pattern length to show labels
-- Ignored for custom labelers.
min_pattern_length = 0,
-- Enable this to use rainbow colors to highlight labels
-- Can be useful for visualizing Treesitter ranges.
rainbow = {
enabled = false,
-- number between 1 and 9
shade = 5,
},
-- With `format`, you can change how the label is rendered.
-- Should return a list of `[text, highlight]` tuples.
---@class Flash.Format
---@field state Flash.State
---@field match Flash.Match
---@field hl_group string
---@field after boolean
---@type fun(opts:Flash.Format): string[][]
format = function(opts)
return { { opts.match.label, opts.hl_group } }
end,
},
highlight = {
-- show a backdrop with hl FlashBackdrop
backdrop = true,
-- Highlight the search matches
matches = true,
-- extmark priority
priority = 5000,
groups = {
match = "FlashMatch",
current = "FlashCurrent",
backdrop = "FlashBackdrop",
label = "FlashLabel",
},
},
-- action to perform when picking a label.
-- defaults to the jumping logic depending on the mode.
---@type fun(match:Flash.Match, state:Flash.State)|nil
action = nil,
-- initial pattern to use when opening flash
pattern = "",
-- When `true`, flash will try to continue the last search
continue = false,
-- Set config to a function to dynamically change the config
config = nil, ---@type fun(opts:Flash.Config)|nil
-- You can override the default options for a specific mode.
-- Use it with `require("flash").jump({mode = "forward"})`
---@type table
modes = {
-- options used when flash is activated through
-- a regular search with `/` or `?`
search = {
-- when `true`, flash will be activated during regular search by default.
-- You can always toggle when searching with `require("flash").toggle()`
enabled = false,
highlight = { backdrop = false },
jump = { history = true, register = true, nohlsearch = true },
search = {
-- `forward` will be automatically set to the search direction
-- `mode` is always set to `search`
-- `incremental` is set to `true` when `incsearch` is enabled
},
},
-- options used when flash is activated through
-- `f`, `F`, `t`, `T`, `;` and `,` motions
char = {
enabled = true,
-- dynamic configuration for ftFT motions
config = function(opts)
-- autohide flash when in operator-pending mode
opts.autohide = opts.autohide or (vim.fn.mode(true):find("no") and vim.v.operator == "y")
-- disable jump labels when not enabled, when using a count,
-- or when recording/executing registers
opts.jump_labels = opts.jump_labels
and vim.v.count == 0
and vim.fn.reg_executing() == ""
and vim.fn.reg_recording() == ""
-- Show jump labels only in operator-pending mode
-- opts.jump_labels = vim.v.count == 0 and vim.fn.mode(true):find("o")
end,
-- hide after jump when not using jump labels
autohide = false,
-- show jump labels
jump_labels = false,
-- set to `false` to use the current line only
multi_line = true,
-- When using jump labels, don't use these keys
-- This allows using those keys directly after the motion
label = { exclude = "hjkliardc" },
-- by default all keymaps are enabled, but you can disable some of them,
-- by removing them from the list.
-- If you rather use another key, you can map them
-- to something else, e.g., { [";"] = "L", [","] = H }
keys = { "f", "F", "t", "T", ";", "," },
---@alias Flash.CharActions table
-- The direction for `prev` and `next` is determined by the motion.
-- `left` and `right` are always left and right.
char_actions = function(motion)
return {
[";"] = "next", -- set to `right` to always go right
[","] = "prev", -- set to `left` to always go left
-- clever-f style
[motion:lower()] = "next",
[motion:upper()] = "prev",
-- jump2d style: same case goes next, opposite case goes prev
-- [motion] = "next",
-- [motion:match("%l") and motion:upper() or motion:lower()] = "prev",
}
end,
search = { wrap = false },
highlight = { backdrop = true },
jump = {
register = false,
-- when using jump labels, set to 'true' to automatically jump
-- or execute a motion when there is only one match
autojump = false,
},
},
-- options used for treesitter selections
-- `require("flash").treesitter()`
treesitter = {
labels = "abcdefghijklmnopqrstuvwxyz",
jump = { pos = "range", autojump = true },
search = { incremental = false },
label = { before = true, after = true, style = "inline" },
highlight = {
backdrop = false,
matches = false,
},
},
treesitter_search = {
jump = { pos = "range" },
search = { multi_window = true, wrap = true, incremental = false },
remote_op = { restore = true },
label = { before = true, after = true, style = "inline" },
},
-- options used for remote flash
remote = {
remote_op = { restore = true, motion = true },
},
},
-- options for the floating window that shows the prompt,
-- for regular jumps
-- `require("flash").prompt()` is always available to get the prompt text
prompt = {
enabled = true,
prefix = { { "⚡", "FlashPromptIcon" } },
win_config = {
relative = "editor",
width = 1, -- when <=1 it's a percentage of the editor width
height = 1,
row = -1, -- when negative it's an offset from the bottom
col = 0, -- when negative it's an offset from the right
zindex = 1000,
},
},
-- options for remote operator pending mode
remote_op = {
-- restore window views and cursor position
-- after doing a remote operation
restore = false,
-- For `jump.pos = "range"`, this setting is ignored.
-- `true`: always enter a new motion when doing a remote operation
-- `false`: use the window's cursor position and jump target
-- `nil`: act as `true` for remote windows, `false` for the current window
motion = false,
},
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/flatten.lua
================================================
return {
-- Open files and command output from wezterm, kitty, and neovim terminals in your current neovim instance
{
"willothy/flatten.nvim",
config = true,
-- or pass configuration with
opts = {
window = {
-- Options:
-- current -> open in current window (default)
-- alternate -> open in alternate window (recommended)
-- tab -> open in new tab
-- split -> open in split
-- vsplit -> open in vsplit
-- smart -> smart open (avoids special buffers)
-- OpenHandler -> allows you to handle file opening yourself (see Types)
--
open = "alternate",
-- Options:
-- vsplit -> opens files in diff vsplits
-- split -> opens files in diff splits
-- tab_vsplit -> creates a new tabpage, and opens diff vsplits
-- tab_split -> creates a new tabpage, and opens diff splits
-- OpenHandler -> allows you to handle file opening yourself (see Types)
diff = "tab_vsplit",
-- Affects which file gets focused when opening multiple at once
-- Options:
-- "first" -> open first file of new files (default)
-- "last" -> open last file of new files
focus = "first",
},
},
-- Ensure that it runs first to minimize delay when opening file from terminal
lazy = false,
priority = 1001,
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/fold.lua
================================================
return {
-- UFO folding
{
"kevinhwang91/nvim-ufo",
dependencies = {
"kevinhwang91/promise-async",
{
"luukvbaal/statuscol.nvim",
config = function()
local builtin = require("statuscol.builtin")
require("statuscol").setup({
relculright = true,
segments = {
{ text = { builtin.foldfunc }, click = "v:lua.ScFa" },
{ text = { "%s" }, click = "v:lua.ScSa" },
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
},
})
end,
},
},
event = "BufReadPost",
opts = {
provider_selector = function()
return { "treesitter", "indent" }
end,
},
init = function()
-- UFO folding
vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.keymap.set("n", "zo", require("ufo").openAllFolds)
vim.keymap.set("n", "zc", require("ufo").closeAllFolds)
end,
},
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/lazydev.lua
================================================
vim.api.nvim_create_user_command("PutMessage", function()
vim.cmd([[put =execute('messages')]])
end, {})
return {
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- Library items can be absolute paths
-- "~/projects/my-awesome-lib",
-- Or relative, which means they will be resolved as a plugin
-- "LazyVim",
-- When relative, you can also provide a path to the library in the plugin dir
"luvit-meta/library", -- see below
},
},
},
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
{ -- optional completion source for require statements and module annotations
"hrsh7th/nvim-cmp",
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, {
name = "lazydev",
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
})
end,
},
-- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/leap.lua
================================================
return {
"ggandor/leap.nvim",
config = function()
-- Disable auto-jumping to the first match
require("leap").opts.safe_labels = {}
-- The below settings make Leap's highlighting closer to what you've been
-- used to in Lightspeed.
vim.api.nvim_set_hl(0, "LeapBackdrop", { link = "Comment" }) -- or some grey
vim.api.nvim_set_hl(0, "LeapMatch", {
-- For light themes, set to 'black' or similar.
fg = "white",
bold = true,
nocombine = true,
})
-- Deprecated option. Try it without this setting first, you might find
-- you don't even miss it.
require("leap").opts.highlight_unlabeled_phase_one_targets = true
vim.keymap.set("n", "s", function()
require("leap").leap({
target_windows = require("leap.user").get_focusable_windows(),
})
end)
end,
}
================================================
FILE: nvim/.config/nvim/lua/plugins/editor-enhance/multi-cursor.lua
================================================
return { -- Multi Cursor
-- https://github.com/chrisgrieser/.config/blob/106d4eb2f039f1b9506fd5cfeed7e7d09f832e87/nvim/lua/plugins/bulk-processing.lua#L3C12-L3C12
"mg979/vim-visual-multi",
event = "VeryLazy",
init = function()
-- Multi-Cursor https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt
-- vim.g.VM_leader = "\\"
vim.g.VM_theme = "purplegray"
vim.g.VM_maps = {
-- TODO: fix mappings already been used to check project
-- permanent mappings
["Find Under"] = "",
["Find Subword Under"] = "