Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
840a880f03 |
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
tt.*
|
||||||
|
.tests
|
||||||
|
doc/tags
|
||||||
|
debug
|
||||||
|
.repro
|
||||||
|
foo.*
|
||||||
|
*.log
|
||||||
|
data
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"neodev": {
|
||||||
|
"library": {
|
||||||
|
"enabled": true,
|
||||||
|
"plugins": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"neoconf": {
|
||||||
|
"plugins": {
|
||||||
|
"lua_ls": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
column_width = 120
|
|
||||||
line_endings = "Unix"
|
|
||||||
indent_type = "Spaces"
|
|
||||||
indent_width = 4
|
|
||||||
quote_style = "AutoPreferDouble"
|
|
||||||
# call_parentheses = "None"
|
|
||||||
@@ -1,24 +1,201 @@
|
|||||||
This is free and unencumbered software released into the public domain.
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
distribute this software, either in source code form or as a compiled
|
|
||||||
binary, for any purpose, commercial or non-commercial, and by any
|
|
||||||
means.
|
|
||||||
|
|
||||||
In jurisdictions that recognize copyright laws, the author or authors
|
1. Definitions.
|
||||||
of this software dedicate any and all copyright interest in the
|
|
||||||
software to the public domain. We make this dedication for the benefit
|
|
||||||
of the public at large and to the detriment of our heirs and
|
|
||||||
successors. We intend this dedication to be an overt act of
|
|
||||||
relinquishment in perpetuity of all present and future rights to this
|
|
||||||
software under copyright law.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
For more information, please refer to <https://unlicense.org>
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
@@ -1,852 +1,4 @@
|
|||||||

|
# 💤 LazyVim
|
||||||
https://www.youtube.com/watch?v=TNRFegMqbWA
|
|
||||||
# Installing NvChad Version 2.5
|
|
||||||
## Backup and remove old nvim config.
|
|
||||||
Backup old nvim config.
|
|
||||||
```
|
|
||||||
mv ~/.config/nvim ~/.config/nvim-old
|
|
||||||
```
|
|
||||||
Or remove old nvim config.
|
|
||||||
```
|
|
||||||
rm -rf ~/.config/nvim
|
|
||||||
```
|
|
||||||
Remove local/state and local/share
|
|
||||||
```
|
|
||||||
rm -rf ~/.local/state/nvim
|
|
||||||
rm -rf ~/.local/share/nvim
|
|
||||||
```
|
|
||||||
## Install NvChad.
|
|
||||||
Install required packages.
|
|
||||||
```
|
|
||||||
sudo pacman -S --needed neovim unzip luarocks xclip wl-clipboard
|
|
||||||
```
|
|
||||||
Install NvChad config from https://nvchad.com/docs/quickstart/install
|
|
||||||
```
|
|
||||||
git clone https://github.com/NvChad/starter ~/.config/nvim && nvim
|
|
||||||
```
|
|
||||||
Or this already configured version
|
|
||||||
```
|
|
||||||
git clone https://github.com/ProgrammingRainbow/NvChad-2.5 ~/.config/nvim && nvim
|
|
||||||
```
|
|
||||||
You can safely remove the `.git` and image files.
|
|
||||||
```
|
|
||||||
rm-rf ~/.config/nvim/.git
|
|
||||||
rm ~/.config/nvim/*.png
|
|
||||||
```
|
|
||||||
Edit the file `~/.config/nvim/lua/options.lua` to change tabs from 2 to 4 spaces. \
|
|
||||||
Original config is here https://github.com/NvChad/NvChad/blob/v2.5/lua/nvchad/options.lua
|
|
||||||
```
|
|
||||||
-- local o = vim.o
|
|
||||||
```
|
|
||||||
To this.
|
|
||||||
```
|
|
||||||
local o = vim.o
|
|
||||||
|
|
||||||
-- Indenting
|
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
|
||||||
o.shiftwidth = 4
|
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
|
||||||
o.tabstop = 4
|
|
||||||
o.softtabstop = 4
|
|
||||||
|
|
||||||
```
|
|
||||||
Edit `~/.config/nvim/.stylua.toml` to change indent width to 4 and to use parentheses.
|
|
||||||
```
|
|
||||||
column_width = 120
|
|
||||||
line_endings = "Unix"
|
|
||||||
indent_type = "Spaces"
|
|
||||||
indent_width = 4
|
|
||||||
quote_style = "AutoPreferDouble"
|
|
||||||
# call_parentheses = "None"
|
|
||||||
```
|
|
||||||
## Setup Format and Style with Conform.
|
|
||||||
Edit `~/.config/nvim/lua/plugins/init.lua` to load module on save.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"stevearc/conform.nvim",
|
|
||||||
event = "BufWritePre",
|
|
||||||
config = function()
|
|
||||||
require("configs.conform")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Edit `~/.config/nvim/lua/configs/conform.lua` to enable format_on_save.
|
|
||||||
```
|
|
||||||
local options = {
|
|
||||||
formatters_by_ft = {
|
|
||||||
lua = { "stylua" },
|
|
||||||
},
|
|
||||||
|
|
||||||
format_on_save = {
|
|
||||||
-- These options will be passed to conform.format()
|
|
||||||
timeout_ms = 500,
|
|
||||||
lsp_fallback = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require("conform").setup(options)
|
|
||||||
```
|
|
||||||
## Setup Treesitter
|
|
||||||
https://github.com/nvim-treesitter/nvim-treesitter \
|
|
||||||
Added to the Top of `~/.config/nvim/lua/plugins/init.lua`.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
config = function()
|
|
||||||
require("configs.treesitter")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create file `~/.config/nvim/lua/configs/treesitter.lua`. \
|
|
||||||
Copy from the internal one.
|
|
||||||
https://github.com/NvChad/NvChad/blob/v2.5/lua/nvchad/configs/treesitter.lua
|
|
||||||
```
|
|
||||||
local options = {
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"fish",
|
|
||||||
"lua",
|
|
||||||
"luadoc",
|
|
||||||
"markdown",
|
|
||||||
"printf",
|
|
||||||
"toml",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
use_languagetree = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
indent = { enable = true },
|
|
||||||
}
|
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup(options)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Basic Treesitter commands.
|
|
||||||
List Treesitter installed languages.
|
|
||||||
```
|
|
||||||
:TSInstallInfo
|
|
||||||
```
|
|
||||||
Install fish for treesitter.
|
|
||||||
```
|
|
||||||
:TSInstall fish
|
|
||||||
```
|
|
||||||
Update fish.
|
|
||||||
```
|
|
||||||
:TSUpdate fish
|
|
||||||
```
|
|
||||||
Update all.
|
|
||||||
```
|
|
||||||
:TSUpdate
|
|
||||||
```
|
|
||||||
Disable treesitter highlighting.
|
|
||||||
```
|
|
||||||
:TSDisable highlight
|
|
||||||
```
|
|
||||||
Enable treesitter highlighting.
|
|
||||||
```
|
|
||||||
:TSEnable highlight
|
|
||||||
```
|
|
||||||
## Treesitter language for filetype.
|
|
||||||
Check loaded treesitter language.
|
|
||||||
```
|
|
||||||
:lua print(require"nvim-treesitter.parsers".get_buf_lang())
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```
|
|
||||||
:Inspect
|
|
||||||
```
|
|
||||||
Check filetype of buffer.
|
|
||||||
```
|
|
||||||
:echo &filetype
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```
|
|
||||||
:set filetype?
|
|
||||||
```
|
|
||||||
Set filetype.
|
|
||||||
```
|
|
||||||
:set filetype=fish
|
|
||||||
```
|
|
||||||
## Setup LSPConfig.
|
|
||||||
https://github.com/neovim/nvim-lspconfig \
|
|
||||||
Edit file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
Under Treesitter add an lspconfig entry.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
config = function()
|
|
||||||
require("nvchad.configs.lspconfig").defaults()
|
|
||||||
require("configs.lspconfig")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lspconfig.lua`. \
|
|
||||||
We will be adding a table that has a list of all servers configured. \
|
|
||||||
This will be used later in the mason-lspconfig to automate there installation. \
|
|
||||||
Then we will have a simple default_servers table for looping and setting up default configs. \
|
|
||||||
Using the NvChad default lua_ls found \
|
|
||||||
here https://github.com/NvChad/NvChad/blob/v2.5/lua/nvchad/configs/lspconfig.lua \
|
|
||||||
we will add love2d support `"${3rd}/love2d/library",` but also disable linting diagnostics.
|
|
||||||
```
|
|
||||||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
|
||||||
local on_init = require("nvchad.configs.lspconfig").on_init
|
|
||||||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
-- list of all servers configured.
|
|
||||||
lspconfig.servers = {
|
|
||||||
"lua_ls",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- list of servers configured with default config.
|
|
||||||
local default_servers = {}
|
|
||||||
|
|
||||||
-- lsps with default config
|
|
||||||
for _, lsp in ipairs(default_servers) do
|
|
||||||
lspconfig[lsp].setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
lspconfig.lua_ls.setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
enable = false, -- Disable all diagnostics from lua_ls
|
|
||||||
-- globals = { "vim" },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
library = {
|
|
||||||
vim.fn.expand("$VIMRUNTIME/lua"),
|
|
||||||
vim.fn.expand("$VIMRUNTIME/lua/vim/lsp"),
|
|
||||||
vim.fn.stdpath("data") .. "/lazy/ui/nvchad_types",
|
|
||||||
vim.fn.stdpath("data") .. "/lazy/lazy.nvim/lua/lazy",
|
|
||||||
"${3rd}/love2d/library",
|
|
||||||
},
|
|
||||||
maxPreload = 100000,
|
|
||||||
preloadFileSize = 10000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## Setting up Linting.
|
|
||||||
https://github.com/mfussenegger/nvim-lint \
|
|
||||||
Edit file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
Between LSPConfig and Confom add an entry for Linting.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-lint",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
config = function()
|
|
||||||
require("configs.lint")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create file `~/.config/nvim/lua/configs/lint.lua`. \
|
|
||||||
`lint.linters_by_ft` is a key, value table for all linters to be configured. \
|
|
||||||
`lint.linters.laucheck.args = {` Will over write the arguments table for luacheck. \
|
|
||||||
To get the default args before editing use this command \
|
|
||||||
`:lua print(vim.inspect(require('lint').linters.luacheck.args))`. \
|
|
||||||
or unpack the original args into the table and add your new args below it.
|
|
||||||
Create an auto command to run the linter when opeing a buffer, saving or leaving insert mode.
|
|
||||||
```
|
|
||||||
local lint = require("lint")
|
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
|
||||||
lua = { "luacheck" },
|
|
||||||
}
|
|
||||||
|
|
||||||
lint.linters.luacheck.args = {
|
|
||||||
unpack(lint.linters.luacheck.args),
|
|
||||||
"--globals",
|
|
||||||
"love",
|
|
||||||
"vim",
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
|
||||||
callback = function()
|
|
||||||
lint.try_lint()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## Setting up mason-conform.
|
|
||||||
https://github.com/zapling/mason-conform.nvim \
|
|
||||||
Edit the file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
Below the conform entry add mason-conform.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"zapling/mason-conform.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "conform.nvim" },
|
|
||||||
config = function()
|
|
||||||
require("configs.mason-conform")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create the file `~/.config/nvim/lua/configs/mason-conform.lua`. \
|
|
||||||
Any formatters you don't wish to auto install add to ignore_install table.
|
|
||||||
```
|
|
||||||
require("mason-conform").setup({
|
|
||||||
-- List of formatters to ignore during install
|
|
||||||
ignore_install = {},
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## Setting up mason-lspconfig.
|
|
||||||
https://github.com/williamboman/mason-lspconfig.nvim \
|
|
||||||
Edit the file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
Below the lspconfig entry add mason-lspconfig.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "nvim-lspconfig" },
|
|
||||||
config = function()
|
|
||||||
require("configs.mason-lspconfig")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create the file `~/.config/nvim/lua/configs/mason-lspconfig.lua`. \
|
|
||||||
This entire file is simply creating a table of servers to pass into ensure_installed. \
|
|
||||||
There is also a table at the top to add any server that should not be installed.
|
|
||||||
```
|
|
||||||
local lspconfig = package.loaded["lspconfig"]
|
|
||||||
|
|
||||||
-- List of servers to ignore during install
|
|
||||||
local ignore_install = {}
|
|
||||||
|
|
||||||
-- Helper function to find if value is in table.
|
|
||||||
local function table_contains(table, value)
|
|
||||||
for _, v in ipairs(table) do
|
|
||||||
if v == value then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Build a list of lsp servers to install minus the ignored list.
|
|
||||||
local all_servers = {}
|
|
||||||
for _, s in ipairs(lspconfig.servers) do
|
|
||||||
if not table_contains(ignore_install, s) then
|
|
||||||
table.insert(all_servers, s)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = all_servers,
|
|
||||||
automatic_installation = false,
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## Setting up mason-lint.
|
|
||||||
https://github.com/rshkarin/mason-nvim-lint \
|
|
||||||
Edit the file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
Below the lint entry add mason-lint.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"rshkarin/mason-nvim-lint",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "nvim-lint" },
|
|
||||||
config = function()
|
|
||||||
require("configs.mason-lint")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create the file `~/.config/nvim/lua/configs/mason-lint.lua`. \
|
|
||||||
This entire file is simply creating a table of linters to pass into ensure_installed. \
|
|
||||||
There is also a table at the top to add any linter that should not be installed.
|
|
||||||
```
|
|
||||||
local lint = package.loaded["lint"]
|
|
||||||
|
|
||||||
-- List of linters to ignore during install
|
|
||||||
local ignore_install = {}
|
|
||||||
|
|
||||||
-- Helper function to find if value is in table.
|
|
||||||
local function table_contains(table, value)
|
|
||||||
for _, v in ipairs(table) do
|
|
||||||
if v == value then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Build a list of linters to install minus the ignored list.
|
|
||||||
local all_linters = {}
|
|
||||||
for _, v in pairs(lint.linters_by_ft) do
|
|
||||||
for _, linter in ipairs(v) do
|
|
||||||
if not table_contains(ignore_install, linter) then
|
|
||||||
table.insert(all_linters, linter)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
require("mason-nvim-lint").setup({
|
|
||||||
ensure_installed = all_linters,
|
|
||||||
automatic_installation = false,
|
|
||||||
})
|
|
||||||
```
|
|
||||||

|
|
||||||
https://www.youtube.com/watch?v=upeAH74q0q4
|
|
||||||
# C and C++
|
|
||||||
## UPDATE
|
|
||||||
I have changed the hack that was in place for clang_format since the video. \
|
|
||||||
Change file `~/.config/nvim/lua/configs/conform.lua`.
|
|
||||||
```
|
|
||||||
c_cpp = { "clang-format" }, -- Hack to force download.
|
|
||||||
c = { "clang_format" },
|
|
||||||
cpp = { "clang_format" },
|
|
||||||
```
|
|
||||||
and
|
|
||||||
```
|
|
||||||
clang_format = {
|
|
||||||
```
|
|
||||||
The a simpler way.
|
|
||||||
```
|
|
||||||
c = { "clang-format" },
|
|
||||||
cpp = { "clang-format" },
|
|
||||||
```
|
|
||||||
and
|
|
||||||
```
|
|
||||||
["clang-format"] = {
|
|
||||||
```
|
|
||||||
In `~/.config/nvim/lua/configs/lspconfig.lua`. The on_attach function takes client and bufnr parameters. It has almost no documentations and i have no idea if leaving it off affects anything. But it appears it should be provided.
|
|
||||||
```
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
on_attach(client, bufnr)
|
|
||||||
```
|
|
||||||
## lspconfig
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lspconfig.lua`. \
|
|
||||||
Add `"clangd",` to lspconfig.servers.
|
|
||||||
```
|
|
||||||
lspconfig.servers = {
|
|
||||||
"lua_ls",
|
|
||||||
"clangd",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
Add a setup for clangd. This disables formatting.
|
|
||||||
```
|
|
||||||
lspconfig.clangd.setup({
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
on_attach(client, bufnr)
|
|
||||||
end,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## conform
|
|
||||||
Edit file `~/.config/nvim/lua/configs/conform.lua`. \
|
|
||||||
Add a C and C++ entry to formatters_by_ft.
|
|
||||||
```
|
|
||||||
c = { "clang-format" },
|
|
||||||
cpp = { "clang-format" },
|
|
||||||
```
|
|
||||||
Between formatters_by_ft and format_on_save tables add. This sets tab spacing to 4. The default is 2.
|
|
||||||
```
|
|
||||||
formatters = {
|
|
||||||
["clang-format"] = {
|
|
||||||
prepend_args = {
|
|
||||||
"-style={ \
|
|
||||||
IndentWidth: 4, \
|
|
||||||
TabWidth: 4, \
|
|
||||||
UseTab: Never, \
|
|
||||||
AccessModifierOffset: 0, \
|
|
||||||
IndentAccessModifiers: true, \
|
|
||||||
PackConstructorInitializers: Never}",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
```
|
|
||||||
## treesitter
|
|
||||||
Edit file `~/.config/nvim/lua/configs/treesitter.lua`. \
|
|
||||||
Add syntax highlighting for c, c++, make and cmake.
|
|
||||||
```
|
|
||||||
"c",
|
|
||||||
"cmake",
|
|
||||||
"cpp",
|
|
||||||
"make",
|
|
||||||
```
|
|
||||||

|
|
||||||
https://www.youtube.com/watch?v=1vK3VCfKEyQ
|
|
||||||
# Golang
|
|
||||||
## UPDATE
|
|
||||||
I think all the formatters for Go only apply to actual .go files. So all non Go filetypes have been removed from `conform.lua`.
|
|
||||||
In `treesitter.lua` gotmpl has been added.
|
|
||||||
## lspconfig
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lspconfig.lua`. \
|
|
||||||
Add `"gopls",` to lspconfig.servers.
|
|
||||||
```
|
|
||||||
lspconfig.servers = {
|
|
||||||
"lua_ls",
|
|
||||||
"gopls",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
Add a setup for gopls. This disables formatting and adds some linting options.
|
|
||||||
```
|
|
||||||
lspconfig.gopls.setup({
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
on_attach(client, bufnr)
|
|
||||||
end,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
cmd = { "gopls" },
|
|
||||||
filetypes = { "go", "gomod", "gotmpl", "gowork" },
|
|
||||||
root_dir = lspconfig.util.root_pattern("go.work", "go.mod", ".git"),
|
|
||||||
settings = {
|
|
||||||
gopls = {
|
|
||||||
analyses = {
|
|
||||||
unusedparams = true,
|
|
||||||
},
|
|
||||||
completeUnimported = true,
|
|
||||||
usePlaceholders = true,
|
|
||||||
staticcheck = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## conform
|
|
||||||
Edit file `~/.config/nvim/lua/configs/conform.lua`. \
|
|
||||||
Add Golang entry to formatters_by_ft.
|
|
||||||
```
|
|
||||||
go = { "gofumpt", "goimports-reviser", "golines" },
|
|
||||||
```
|
|
||||||
Between `formatters_by_ft` and `format_on_save` add entries to table `formatters`.
|
|
||||||
```
|
|
||||||
formatters = {
|
|
||||||
["goimports-reviser"] = {
|
|
||||||
prepend_args = { "-rm-unused" },
|
|
||||||
},
|
|
||||||
golines = {
|
|
||||||
prepend_args = { "--max-len=80" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
```
|
|
||||||
## treesitter
|
|
||||||
Edit file `~/.config/nvim/lua/configs/treesitter.lua`. \
|
|
||||||
Add syntax highlighting for Go related filetypes.
|
|
||||||
```
|
|
||||||
"go",
|
|
||||||
"gomod",
|
|
||||||
"gosum",
|
|
||||||
"gotmpl",
|
|
||||||
"gowork",
|
|
||||||
```
|
|
||||||

|
|
||||||
https://www.youtube.com/watch?v=4o6D1W0iW10
|
|
||||||
# Python
|
|
||||||
## lspconfig
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lspconfig.lua`. \
|
|
||||||
Add `"pyright",` to `lspconfig.servers`.
|
|
||||||
```
|
|
||||||
"pyright",
|
|
||||||
```
|
|
||||||
Add `"pyright"` to `default_servers`.
|
|
||||||
```
|
|
||||||
"pyright",
|
|
||||||
```
|
|
||||||
## conform
|
|
||||||
Edit file `~/.config/nvim/lua/configs/conform.lua`. \
|
|
||||||
Add `python` `entries to formatters_by_ft` for isort and black.
|
|
||||||
```
|
|
||||||
python = { "isort", "black" },
|
|
||||||
```
|
|
||||||
Between `formatters_by_ft` and `format_on_save` add entries to table `formatters`. \
|
|
||||||
Try to speed up black and to to make isort play better wtih black.
|
|
||||||
```
|
|
||||||
formatters = {
|
|
||||||
-- Python
|
|
||||||
black = {
|
|
||||||
prepend_args = {
|
|
||||||
"--fast",
|
|
||||||
"--line-length",
|
|
||||||
"80",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
isort = {
|
|
||||||
prepend_args = {
|
|
||||||
"--profile",
|
|
||||||
"black",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
```
|
|
||||||
## linting
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lint.lua`. \
|
|
||||||
Add a python flake8 entry to `linters_by_ft` table.
|
|
||||||
```
|
|
||||||
python = { "flake8" },
|
|
||||||
```
|
|
||||||
## treesitter
|
|
||||||
Edit file `~/.config/nvim/lua/configs/treesitter.lua`. \
|
|
||||||
Add syntax highlighting for Python.
|
|
||||||
```
|
|
||||||
"python",
|
|
||||||
```
|
|
||||||

|
|
||||||
https://www.youtube.com/watch?v=m0OobzFjEKE
|
|
||||||
# Python (Dreams of Code)
|
|
||||||
## lspconfig
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lspconfig.lua`. \
|
|
||||||
Add `"pyright",` to `lspconfig.servers`.
|
|
||||||
```
|
|
||||||
"pyright",
|
|
||||||
```
|
|
||||||
Choose default or choose to disable type checks for pyright. \
|
|
||||||
(Choice 1) For default add `"pyright"` to `default_servers`.
|
|
||||||
```
|
|
||||||
"pyright",
|
|
||||||
```
|
|
||||||
(Choice 2) Or to prevent duplicate linting from pyright and mypy add the following. This will not stop pyright unused variable hits. I was unable to turn this off.
|
|
||||||
```
|
|
||||||
lspconfig.pyright.setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
python = {
|
|
||||||
analysis = {
|
|
||||||
typeCheckingMode = "off", -- Disable type checking diagnostics
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## conform
|
|
||||||
Edit file `~/.config/nvim/lua/configs/conform.lua`. \
|
|
||||||
Add a `python` entry to `formatters_by_ft` for isort and black.
|
|
||||||
```
|
|
||||||
python = { "black" },
|
|
||||||
```
|
|
||||||
(Optional) Between `formatters_by_ft` and `format_on_save` add entries to table `formatters`. \
|
|
||||||
Try to speed up black and to to make isort play better wtih black.
|
|
||||||
```
|
|
||||||
formatters = {
|
|
||||||
-- Python
|
|
||||||
black = {
|
|
||||||
prepend_args = {
|
|
||||||
"--fast",
|
|
||||||
"--line-length",
|
|
||||||
"80",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
```
|
|
||||||
## linting
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lint.lua`. \
|
|
||||||
Add a python mypy and ruff entries to `linters_by_ft` table.
|
|
||||||
```
|
|
||||||
python = { "mypy", "ruff" },
|
|
||||||
```
|
|
||||||
## treesitter
|
|
||||||
Edit file `~/.config/nvim/lua/configs/treesitter.lua`. \
|
|
||||||
Add syntax highlighting for Python.
|
|
||||||
```
|
|
||||||
"python",
|
|
||||||
```
|
|
||||||
## dap
|
|
||||||
Edit file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
We will add the entry for nvim-dap and also load it's config from `configs/dap.lua`
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
config = function()
|
|
||||||
require("configs.dap")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
Create `~/.config/nvim/lua/configs/dap.lua`. \
|
|
||||||
We are adding a leader + d + b key mapping to set a breakpoint. This key mapping is only set when dap is loaded that's why it's not in mappings.lua
|
|
||||||
```
|
|
||||||
local map = vim.keymap.set
|
|
||||||
|
|
||||||
map(
|
|
||||||
"n",
|
|
||||||
"<leader>db",
|
|
||||||
"<cmd> DapToggleBreakpoint <CR>",
|
|
||||||
{ desc = "Toggle DAP Breakpoint" }
|
|
||||||
)
|
|
||||||
|
|
||||||
map(
|
|
||||||
"n",
|
|
||||||
"<leader>dr",
|
|
||||||
"<cmd> DapContinue <CR>",
|
|
||||||
{ desc = "Start or continue DAP" }
|
|
||||||
)
|
|
||||||
```
|
|
||||||
## dap-ui
|
|
||||||
Edit file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
we need an entry for both nvim-nio and nvim-dap-ui. Dap UI depends on both nvim-dap and nvim-nio. We will load it's configuration from `configs/dap-ui.lua`
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"nvim-neotest/nvim-nio",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
dependencies = {
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
"nvim-neotest/nvim-nio",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("configs.dap-ui")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create `~/.config/nvim/lua/configs/dap-ui.lua`.
|
|
||||||
```
|
|
||||||
local dap = require("dap")
|
|
||||||
local dapui = require("dapui")
|
|
||||||
dapui.setup()
|
|
||||||
|
|
||||||
local map = vim.keymap.set
|
|
||||||
map(
|
|
||||||
"n",
|
|
||||||
"<leader>du",
|
|
||||||
"<cmd>lua require('dapui').toggle()<CR>",
|
|
||||||
{ desc = "Toggle DAP UI" }
|
|
||||||
)
|
|
||||||
|
|
||||||
dap.listeners.after.attach.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.after.launch.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_terminated.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_exited.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
```
|
|
||||||
## dap-python
|
|
||||||
Edit file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
We will have this load when `python` files are loaded. We will load it's configurations from `configs/dap-python.lua`.
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-dap-python",
|
|
||||||
ft = "python",
|
|
||||||
dependencies = {
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("configs.dap-python")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create `~/.config/nvim/lua/configs/dap-python.lua`. \
|
|
||||||
We are setting the path to debugpy and passing that to the dap-python setup. We are also setting up key mappings that will only be loaded when `nvim-dap-python` is loaded.
|
|
||||||
```
|
|
||||||
local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
|
|
||||||
require("dap-python").setup(path)
|
|
||||||
|
|
||||||
local map = vim.keymap.set
|
|
||||||
|
|
||||||
map("n", "<leader>dpr", function()
|
|
||||||
require("dap-python").test_method()
|
|
||||||
end, { desc = "Run DAP Python test method" })
|
|
||||||
```
|
|
||||||
## mason-nvim-dap
|
|
||||||
Edit file `~/.config/nvim/lua/plugins/init.lua`. \
|
|
||||||
We will used `mason-nvim-dap` to automagicly install debugpy. We will set it's loading to verylazy so it doesn't slowdown nvim startup time. It will also load its config from `configs/mason-dap.lua`
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
|
||||||
require("configs.mason-dap")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
Create `~/.config/nvim/lua/configs/mason-dap.lua`. \
|
|
||||||
This mason-nvim-dap like other similar packages doesn't actually load it's packages on demand so we will just put the package into the ensured installed. Debugpy is actually refered to as `python`. Any package that is being installed automatically that you don't want to, can be added into the exclude table.
|
|
||||||
```
|
|
||||||
require("mason-nvim-dap").setup({
|
|
||||||
ensure_installed = { "python" },
|
|
||||||
automatic_installation = { exclude = {} },
|
|
||||||
})
|
|
||||||
```
|
|
||||||

|
|
||||||
https://www.youtube.com/watch?v=-NMYeQGIN20
|
|
||||||
# Odin
|
|
||||||
## lspconfig
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lspconfig.lua`. \
|
|
||||||
Add `"ols",` to `lspconfig.servers`.
|
|
||||||
```
|
|
||||||
"ols",
|
|
||||||
```
|
|
||||||
Add `"ols"` to `default_servers`.
|
|
||||||
```
|
|
||||||
"ols",
|
|
||||||
```
|
|
||||||
## treesitter
|
|
||||||
Edit file `~/.config/nvim/lua/configs/treesitter.lua`. \
|
|
||||||
Add syntax highlighting for Odin.
|
|
||||||
```
|
|
||||||
"odin",
|
|
||||||
```
|
|
||||||

|
|
||||||
https://www.youtube.com/watch?v=CcYQULn_M4s
|
|
||||||
# Haskell
|
|
||||||
## lspconfig
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lspconfig.lua`. \
|
|
||||||
Add the haskell-language-server `"hls",` to `lspconfig.servers`. Unless it's installed on your system.
|
|
||||||
```
|
|
||||||
"hls",
|
|
||||||
```
|
|
||||||
Add a setup for hls. This disables formatting.
|
|
||||||
```
|
|
||||||
lspconfig.hls.setup({
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
on_attach(client, bufnr)
|
|
||||||
end,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
```
|
|
||||||
## linting
|
|
||||||
Edit file `~/.config/nvim/lua/configs/lint.lua`. \
|
|
||||||
Add a hlint entry to `linters_by_ft` table.
|
|
||||||
```
|
|
||||||
haskell = { "hlint" },
|
|
||||||
```
|
|
||||||
## conform
|
|
||||||
Edit file `~/.config/nvim/lua/configs/conform.lua`. \
|
|
||||||
Add an entry to `formatters_by_ft` for ormolu or fourmolu. Also add stylish-haskell.\
|
|
||||||
Four spaces the right choice.
|
|
||||||
```
|
|
||||||
haskell = { "fourmolu", "stylish-haskell" },
|
|
||||||
```
|
|
||||||
Two spaces the wrong choice.
|
|
||||||
```
|
|
||||||
haskell = { "ormolu", "stylish-haskell" },
|
|
||||||
```
|
|
||||||
## treesitter
|
|
||||||
Edit file `~/.config/nvim/lua/configs/treesitter.lua`. \
|
|
||||||
Add syntax highlighting for Haskell.
|
|
||||||
```
|
|
||||||
"haskell",
|
|
||||||
```
|
|
||||||
@@ -1,65 +1,2 @@
|
|||||||
vim.g.base46_cache = vim.fn.stdpath("data") .. "/nvchad/base46/"
|
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||||
vim.g.mapleader = " "
|
require("config.lazy")
|
||||||
|
|
||||||
-- bootstrap lazy and all plugins
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
|
||||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
|
||||||
vim.fn.system({ "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath })
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
local lazy_config = require("configs.lazy")
|
|
||||||
|
|
||||||
-- load plugins
|
|
||||||
require("lazy").setup({
|
|
||||||
{
|
|
||||||
"NvChad/NvChad",
|
|
||||||
lazy = false,
|
|
||||||
branch = "v2.5",
|
|
||||||
import = "nvchad.plugins",
|
|
||||||
config = function()
|
|
||||||
require("options")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{ import = "plugins" },
|
|
||||||
}, lazy_config)
|
|
||||||
|
|
||||||
-- load theme
|
|
||||||
dofile(vim.g.base46_cache .. "defaults")
|
|
||||||
dofile(vim.g.base46_cache .. "statusline")
|
|
||||||
|
|
||||||
require("nvchad.autocmds")
|
|
||||||
|
|
||||||
vim.schedule(function()
|
|
||||||
require("mappings")
|
|
||||||
end)
|
|
||||||
|
|
||||||
require("toggleterm").setup({})
|
|
||||||
|
|
||||||
require("noice").setup({
|
|
||||||
popupmenu = {
|
|
||||||
-- cmp-cmdline has more sources and can be extended
|
|
||||||
backend = "cmp", -- backend to use to show regular cmdline completions
|
|
||||||
},
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
|
||||||
override = {
|
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
|
||||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- you can enable a preset for easier configuration
|
|
||||||
presets = {
|
|
||||||
bottom_search = true, -- use a classic bottom cmdline for search
|
|
||||||
command_palette = true, -- position the cmdline and popupmenu together
|
|
||||||
long_message_to_split = true, -- long messages will be sent to a split
|
|
||||||
inc_rename = true, -- enables an input dialog for inc-rename.nvim
|
|
||||||
lsp_doc_border = true, -- add a border to hover docs and signature help
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,50 +1,83 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
|
"LazyVim": { "branch": "main", "commit": "29829f7eb6e937f9fe43e9455e55704b3fac8794" },
|
||||||
"NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" },
|
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||||
"base46": { "branch": "v2.5", "commit": "40943fc668bf8f1caa4cc45f71c784cf0d3cc34f" },
|
"SchemaStore.nvim": { "branch": "main", "commit": "118e563101169e8c5096023bc45c460e4c4fb77c" },
|
||||||
"cmake-tools.nvim": { "branch": "master", "commit": "53bc5261e1e0b0d28be465d2b2b07a6f0646e1eb" },
|
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
|
||||||
|
"auto-save.nvim": { "branch": "main", "commit": "5fbcaac0a2698c87a9a1bd2083cb6949505cca12" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "4965db2d6155c25db4e8417465fc2703fdf4c2b7" },
|
||||||
|
"clangd_extensions.nvim": { "branch": "main", "commit": "db28f29be928d18cbfb86fbfb9f83f584f658feb" },
|
||||||
|
"cmake-tools.nvim": { "branch": "master", "commit": "83268ea6f969f1e6eaa85f72118a11acb6198bf0" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
"cmp-git": { "branch": "main", "commit": "483ffb9a7471409a841df099d7c13556234365a4" },
|
||||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8" },
|
"conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" },
|
||||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
"dial.nvim": { "branch": "master", "commit": "34bbd9c387c358190e61ce71017faad3dffa7a74" },
|
||||||
|
"flash.nvim": { "branch": "main", "commit": "f899265876ecdcf7352dbc9f0adf87068cedefbb" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "3bd795ab8536435a1d61b8f394d83c88d1494403" },
|
"gitsigns.nvim": { "branch": "main", "commit": "4baa13519c2168cc9a7890a3580c50226ed018fb" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
|
"grug-far.nvim": { "branch": "main", "commit": "3a8690461afac34c0e5bacb0f7b4bc3066aab665" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
|
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" },
|
"inc-rename.nvim": { "branch": "main", "commit": "f9b9e5b9a75074810f40881b7e254b5bbeaf122e" },
|
||||||
"lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
"kulala.nvim": { "branch": "main", "commit": "ba6e6320c8bd9a4188a3f06c52022a3c2dabb710" },
|
||||||
"macrothis.nvim": { "branch": "main", "commit": "3fe6af86ce9eb509737f7955007c58dec96eb02b" },
|
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
|
||||||
"mason-conform.nvim": { "branch": "main", "commit": "abce2be529f3b4b336c56d0ba6336a9144e0fee6" },
|
"lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
|
"lazygit.nvim": { "branch": "main", "commit": "adc37c5a6d7d6e8d0a039f08f3c7837971a1c77a" },
|
||||||
"mason-nvim-lint": { "branch": "main", "commit": "910dadb99cb2bf0d5176026c7a4ab1861c4e561f" },
|
"lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" },
|
||||||
|
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" },
|
||||||
|
"mason-nvim-dap.nvim": { "branch": "main", "commit": "26ea08fd5c7028ea54a3347ac139fc916baf1aa9" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
"menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" },
|
"mini.ai": { "branch": "main", "commit": "6e01c0e5a15554852546fac9853960780ac52ed4" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "64e95aa77587d04f97a5579b2106a82a08a7d968" },
|
"mini.icons": { "branch": "main", "commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36" },
|
||||||
"mini.pick": { "branch": "main", "commit": "75e9a0a7808aa772ca5e31d479ffd0280ab6bf74" },
|
"mini.move": { "branch": "main", "commit": "c8b30e92dd2668dd6e56a9a23cb7d4ee38c2266d" },
|
||||||
"minty": { "branch": "main", "commit": "6dce9f097667862537823d515a0250ce58faab05" },
|
"mini.pairs": { "branch": "main", "commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918" },
|
||||||
"neogit": { "branch": "master", "commit": "dc36aa4b1172189a2e80cbdbd4be2e884e60c09e" },
|
"neoconf.nvim": { "branch": "main", "commit": "fcebf3bd68e409542f81181182a998372d7ce867" },
|
||||||
"noice.nvim": { "branch": "main", "commit": "c6f6fb178ebe9b4fd90383de743c3399f8c3a37c" },
|
"neogen": { "branch": "main", "commit": "d633d2ef572479792f6a09665fe5e897ed49f85c" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
"neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
|
"neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" },
|
"noice.nvim": { "branch": "main", "commit": "dbfc5fbab19ff1c3e29a3268ffa5eda4c09c72ce" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
|
"none-ls.nvim": { "branch": "main", "commit": "aa1620be06f7a5158864a33be045229da67ff840" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "6e385d2fe5da6714f00142afbd8d3591d330ffd7" },
|
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
||||||
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
|
"nvim-ansible": { "branch": "main", "commit": "149986b4fc409c1b258ff5b1671d03b5094b3c74" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "ca7c4c33cac2ad66ec69d45e465379716ef0cc97" },
|
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "3edea87978b2ee93b197513e5cdf86012d33b7fa" },
|
"nvim-dap": { "branch": "master", "commit": "52302f02fea3a490e55475de52fa4deb8af2eb11" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "203da76ecfbb4b192cf830665b03eb651b635c94" },
|
"nvim-dap-python": { "branch": "master", "commit": "34282820bb713b9a5fdb120ae8dd85c2b3f49b51" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
|
||||||
"toggleterm.nvim": { "branch": "main", "commit": "022ff5594acccc8d90d2e46dc43994f7722ebdf7" },
|
"nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" },
|
||||||
"ui": { "branch": "v3.0", "commit": "7905539f1e10f460811dc0db800355611f8a527a" },
|
"nvim-lspconfig": { "branch": "master", "commit": "5dca9e1480ebe39f3f96f98a8196f8ee18fad207" },
|
||||||
"vim-cmake": { "branch": "master", "commit": "896bc2189c8ade62d00a0ebedc59c65d9d9b0d65" },
|
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||||
"vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"vim-tmux-navigator": { "branch": "master", "commit": "424b5caa154bff34dc258ee53cec5a8e36cf7ea8" },
|
"nvim-treesitter": { "branch": "master", "commit": "da89532f036da9855f3105955696df36f583b919" },
|
||||||
"volt": { "branch": "main", "commit": "e01090ff27b34288574c24a09cb166e47c4a0c3d" },
|
"nvim-treesitter-context": { "branch": "master", "commit": "03f382ef224c27a8508cdab2d0b463dcb8ca12a6" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" },
|
||||||
|
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
|
||||||
|
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||||
|
"octo.nvim": { "branch": "master", "commit": "940d7af617015fd5c65f707a267d3daa29be480e" },
|
||||||
|
"one-small-step-for-vimkind": { "branch": "main", "commit": "b9def31568d20b16f7da9479a4174d165046fe8a" },
|
||||||
|
"outline.nvim": { "branch": "main", "commit": "f01eae624e6170656b6fadd6d7b8717636078bd6" },
|
||||||
|
"overseer.nvim": { "branch": "master", "commit": "390332d4687e3d07495a545ba11e62fcf30339f1" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||||
|
"refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" },
|
||||||
|
"render-markdown.nvim": { "branch": "main", "commit": "17a77463f945c4b9e4f371c752efd90e3e1bf604" },
|
||||||
|
"snacks.nvim": { "branch": "main", "commit": "48302be42f9c7035b70974cefe787e5410da3f3b" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "dca4adba7dc5f09302a00b0e76078d54d82d2658" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "6f380b8826fb819c752c8fd7daaee9ef96d4c689" },
|
||||||
|
"ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" },
|
||||||
|
"vim-dadbod": { "branch": "master", "commit": "9f0ca8bcef704659820a95c3bbd2c262583a66a1" },
|
||||||
|
"vim-dadbod-completion": { "branch": "master", "commit": "c7f1be21a08b8fc9d927a19db89a4aa995402787" },
|
||||||
|
"vim-dadbod-ui": { "branch": "master", "commit": "f4d37b7312ae6489e5c04bee654ca521baac188a" },
|
||||||
|
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" },
|
||||||
|
"vim-illuminate": { "branch": "master", "commit": "ec02591dc87ae8679c57becbc95102a1fe5e783b" },
|
||||||
|
"vim-startuptime": { "branch": "master", "commit": "9aaa3c0880e63a8934ba58a430c6139225bba238" },
|
||||||
|
"vim-tmux-navigator": { "branch": "master", "commit": "d847ea942a5bb4d4fab6efebc9f30d787fd96e65" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "0e76a87ac51772569aec678dc74baa8e2a86100c" },
|
||||||
|
"yanky.nvim": { "branch": "main", "commit": "d2696b30e389dced94d5acab728f524a25f308d2" }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"extras": [
|
||||||
|
"lazyvim.plugins.extras.coding.luasnip",
|
||||||
|
"lazyvim.plugins.extras.coding.neogen",
|
||||||
|
"lazyvim.plugins.extras.coding.nvim-cmp",
|
||||||
|
"lazyvim.plugins.extras.coding.yanky",
|
||||||
|
"lazyvim.plugins.extras.dap.core",
|
||||||
|
"lazyvim.plugins.extras.dap.nlua",
|
||||||
|
"lazyvim.plugins.extras.editor.dial",
|
||||||
|
"lazyvim.plugins.extras.editor.harpoon2",
|
||||||
|
"lazyvim.plugins.extras.editor.illuminate",
|
||||||
|
"lazyvim.plugins.extras.editor.inc-rename",
|
||||||
|
"lazyvim.plugins.extras.editor.mini-move",
|
||||||
|
"lazyvim.plugins.extras.editor.navic",
|
||||||
|
"lazyvim.plugins.extras.editor.outline",
|
||||||
|
"lazyvim.plugins.extras.editor.overseer",
|
||||||
|
"lazyvim.plugins.extras.editor.refactoring",
|
||||||
|
"lazyvim.plugins.extras.formatting.black",
|
||||||
|
"lazyvim.plugins.extras.formatting.prettier",
|
||||||
|
"lazyvim.plugins.extras.lang.ansible",
|
||||||
|
"lazyvim.plugins.extras.lang.clangd",
|
||||||
|
"lazyvim.plugins.extras.lang.cmake",
|
||||||
|
"lazyvim.plugins.extras.lang.docker",
|
||||||
|
"lazyvim.plugins.extras.lang.git",
|
||||||
|
"lazyvim.plugins.extras.lang.helm",
|
||||||
|
"lazyvim.plugins.extras.lang.json",
|
||||||
|
"lazyvim.plugins.extras.lang.markdown",
|
||||||
|
"lazyvim.plugins.extras.lang.python",
|
||||||
|
"lazyvim.plugins.extras.lang.sql",
|
||||||
|
"lazyvim.plugins.extras.lang.toml",
|
||||||
|
"lazyvim.plugins.extras.lang.yaml",
|
||||||
|
"lazyvim.plugins.extras.lsp.neoconf",
|
||||||
|
"lazyvim.plugins.extras.lsp.none-ls",
|
||||||
|
"lazyvim.plugins.extras.test.core",
|
||||||
|
"lazyvim.plugins.extras.ui.alpha",
|
||||||
|
"lazyvim.plugins.extras.ui.indent-blankline",
|
||||||
|
"lazyvim.plugins.extras.ui.treesitter-context",
|
||||||
|
"lazyvim.plugins.extras.util.dot",
|
||||||
|
"lazyvim.plugins.extras.util.gitui",
|
||||||
|
"lazyvim.plugins.extras.util.octo",
|
||||||
|
"lazyvim.plugins.extras.util.rest",
|
||||||
|
"lazyvim.plugins.extras.util.startuptime"
|
||||||
|
],
|
||||||
|
"install_version": 8,
|
||||||
|
"news": {
|
||||||
|
"NEWS.md": "10960"
|
||||||
|
},
|
||||||
|
"version": 8
|
||||||
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
-- This file needs to have same structure as nvconfig.lua
|
|
||||||
-- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua
|
|
||||||
|
|
||||||
---@type ChadrcConfig
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
M.base46 = {
|
|
||||||
theme = "falcon",
|
|
||||||
|
|
||||||
-- hl_override = {
|
|
||||||
-- Comment = { italic = true },
|
|
||||||
-- ["@comment"] = { italic = true },
|
|
||||||
-- },
|
|
||||||
}
|
|
||||||
M.nvdash = {
|
|
||||||
|
|
||||||
load_on_startup = true,
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- Autocmds are automatically loaded on the VeryLazy event
|
||||||
|
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||||
|
--
|
||||||
|
-- Add any additional autocmds here
|
||||||
|
-- with `vim.api.nvim_create_autocmd`
|
||||||
|
--
|
||||||
|
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||||
|
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
-- Keymaps are automatically loaded on the VeryLazy event
|
||||||
|
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||||
|
-- Add any additional keymaps here
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
|
{ "\nPress any key to exit..." },
|
||||||
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- add LazyVim and import its plugins
|
||||||
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
|
-- import/override with your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
defaults = {
|
||||||
|
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||||
|
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||||
|
lazy = false,
|
||||||
|
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||||
|
-- have outdated releases, which may break your Neovim install.
|
||||||
|
version = false, -- always use the latest git commit
|
||||||
|
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||||
|
},
|
||||||
|
install = { colorscheme = { "catppuccin" } },
|
||||||
|
checker = {
|
||||||
|
enabled = true, -- check for plugin updates periodically
|
||||||
|
notify = true, -- notify on update
|
||||||
|
}, -- automatically check for plugin updates
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
-- disable some rtp plugins
|
||||||
|
disabled_plugins = {
|
||||||
|
"gzip",
|
||||||
|
-- "matchit",
|
||||||
|
-- "matchparen",
|
||||||
|
-- "netrwPlugin",
|
||||||
|
"tarPlugin",
|
||||||
|
"tohtml",
|
||||||
|
"tutor",
|
||||||
|
"zipPlugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
-- Options are automatically loaded before lazy.nvim startup
|
||||||
|
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||||
|
-- Add any additional options here
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
local options = {
|
|
||||||
formatters_by_ft = {
|
|
||||||
lua = { "stylua" },
|
|
||||||
c = { "clang-format" },
|
|
||||||
cpp = { "clang-format" },
|
|
||||||
-- go = { "gofumpt", "goimports-reviser", "golines" },
|
|
||||||
-- haskell = { "fourmolu", "stylish-haskell" },
|
|
||||||
python = { "isort", "black" },
|
|
||||||
},
|
|
||||||
|
|
||||||
formatters = {
|
|
||||||
-- C & C++
|
|
||||||
["clang-format"] = {
|
|
||||||
prepend_args = {
|
|
||||||
"-style={ \
|
|
||||||
IndentWidth: 4, \
|
|
||||||
TabWidth: 4, \
|
|
||||||
UseTab: Never, \
|
|
||||||
AccessModifierOffset: 0, \
|
|
||||||
IndentAccessModifiers: true, \
|
|
||||||
PackConstructorInitializers: Never}",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- -- Golang
|
|
||||||
-- ["goimports-reviser"] = {
|
|
||||||
-- prepend_args = { "-rm-unused" },
|
|
||||||
-- },
|
|
||||||
-- golines = {
|
|
||||||
-- prepend_args = { "--max-len=80" },
|
|
||||||
-- },
|
|
||||||
-- -- Lua
|
|
||||||
-- stylua = {
|
|
||||||
-- prepend_args = {
|
|
||||||
-- "--column-width", "80",
|
|
||||||
-- "--line-endings", "Unix",
|
|
||||||
-- "--indent-type", "Spaces",
|
|
||||||
-- "--indent-width", "4",
|
|
||||||
-- "--quote-style", "AutoPreferDouble",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- Python
|
|
||||||
black = {
|
|
||||||
prepend_args = {
|
|
||||||
"--fast",
|
|
||||||
"--line-length",
|
|
||||||
"80",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
isort = {
|
|
||||||
prepend_args = {
|
|
||||||
"--profile",
|
|
||||||
"black",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
format_on_save = {
|
|
||||||
-- These options will be passed to conform.format()
|
|
||||||
timeout_ms = 500,
|
|
||||||
lsp_fallback = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require("conform").setup(options)
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
return {
|
|
||||||
defaults = { lazy = true },
|
|
||||||
install = { colorscheme = { "nvchad" } },
|
|
||||||
|
|
||||||
ui = {
|
|
||||||
icons = {
|
|
||||||
ft = "",
|
|
||||||
lazy = " ",
|
|
||||||
loaded = "",
|
|
||||||
not_loaded = "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
performance = {
|
|
||||||
rtp = {
|
|
||||||
disabled_plugins = {
|
|
||||||
"2html_plugin",
|
|
||||||
"tohtml",
|
|
||||||
"getscript",
|
|
||||||
"getscriptPlugin",
|
|
||||||
"gzip",
|
|
||||||
"logipat",
|
|
||||||
"netrw",
|
|
||||||
"netrwPlugin",
|
|
||||||
"netrwSettings",
|
|
||||||
"netrwFileHandlers",
|
|
||||||
"matchit",
|
|
||||||
"tar",
|
|
||||||
"tarPlugin",
|
|
||||||
"rrhelper",
|
|
||||||
"spellfile_plugin",
|
|
||||||
"vimball",
|
|
||||||
"vimballPlugin",
|
|
||||||
"zip",
|
|
||||||
"zipPlugin",
|
|
||||||
"tutor",
|
|
||||||
"rplugin",
|
|
||||||
"syntax",
|
|
||||||
"synmenu",
|
|
||||||
"optwin",
|
|
||||||
"compiler",
|
|
||||||
"bugreport",
|
|
||||||
"ftplugin",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
local lint = require("lint")
|
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
|
||||||
lua = { "luacheck" },
|
|
||||||
-- haskell = { "hlint" },
|
|
||||||
python = { "flake8" },
|
|
||||||
}
|
|
||||||
|
|
||||||
lint.linters.luacheck.args = {
|
|
||||||
unpack(lint.linters.luacheck.args),
|
|
||||||
"--globals",
|
|
||||||
"love",
|
|
||||||
"vim",
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
|
||||||
callback = function()
|
|
||||||
lint.try_lint()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
|
||||||
local on_init = require("nvchad.configs.lspconfig").on_init
|
|
||||||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
-- list of all servers configured.
|
|
||||||
lspconfig.servers = {
|
|
||||||
"ansiblels",
|
|
||||||
"lua_ls",
|
|
||||||
"clangd",
|
|
||||||
-- "gopls",
|
|
||||||
-- "hls",
|
|
||||||
"ols",
|
|
||||||
"pyright",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- list of servers configured with default config.
|
|
||||||
local default_servers = {
|
|
||||||
"ols",
|
|
||||||
"pyright",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- lsps with default config
|
|
||||||
for _, lsp in ipairs(default_servers) do
|
|
||||||
lspconfig[lsp].setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
lspconfig.clangd.setup({
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
on_attach(client, bufnr)
|
|
||||||
end,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- lspconfig.gopls.setup({
|
|
||||||
-- on_attach = function(client, bufnr)
|
|
||||||
-- client.server_capabilities.documentFormattingProvider = false
|
|
||||||
-- client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
-- on_attach(client, bufnr)
|
|
||||||
-- end,
|
|
||||||
-- on_init = on_init,
|
|
||||||
-- capabilities = capabilities,
|
|
||||||
-- cmd = { "gopls" },
|
|
||||||
-- filetypes = { "go", "gomod", "gotmpl", "gowork" },
|
|
||||||
-- root_dir = lspconfig.util.root_pattern("go.work", "go.mod", ".git"),
|
|
||||||
-- settings = {
|
|
||||||
-- gopls = {
|
|
||||||
-- analyses = {
|
|
||||||
-- unusedparams = true,
|
|
||||||
-- },
|
|
||||||
-- completeUnimported = true,
|
|
||||||
-- usePlaceholders = true,
|
|
||||||
-- staticcheck = true,
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- lspconfig.hls.setup({
|
|
||||||
-- on_attach = function(client, bufnr)
|
|
||||||
-- client.server_capabilities.documentFormattingProvider = false
|
|
||||||
-- client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
-- on_attach(client, bufnr)
|
|
||||||
-- end,
|
|
||||||
--
|
|
||||||
-- on_init = on_init,
|
|
||||||
-- capabilities = capabilities,
|
|
||||||
-- })
|
|
||||||
|
|
||||||
lspconfig.lua_ls.setup({
|
|
||||||
on_attach = on_attach,
|
|
||||||
on_init = on_init,
|
|
||||||
capabilities = capabilities,
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
enable = false, -- Disable all diagnostics from lua_ls
|
|
||||||
-- globals = { "vim" },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
library = {
|
|
||||||
vim.fn.expand("$VIMRUNTIME/lua"),
|
|
||||||
vim.fn.expand("$VIMRUNTIME/lua/vim/lsp"),
|
|
||||||
vim.fn.stdpath("data") .. "/lazy/ui/nvchad_types",
|
|
||||||
vim.fn.stdpath("data") .. "/lazy/lazy.nvim/lua/lazy",
|
|
||||||
"${3rd}/love2d/library",
|
|
||||||
},
|
|
||||||
maxPreload = 100000,
|
|
||||||
preloadFileSize = 10000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
require("lspconfig").cmake.setup({
|
|
||||||
cmd = { "${prefix}/bin/cmake-language-server" },
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
require("mason-conform").setup({
|
|
||||||
-- List of formatters to ignore during install
|
|
||||||
ignore_install = {},
|
|
||||||
})
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
local lint = package.loaded["lint"]
|
|
||||||
|
|
||||||
-- List of linters to ignore during install
|
|
||||||
local ignore_install = {}
|
|
||||||
|
|
||||||
-- Helper function to find if value is in table.
|
|
||||||
local function table_contains(table, value)
|
|
||||||
for _, v in ipairs(table) do
|
|
||||||
if v == value then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Build a list of linters to install minus the ignored list.
|
|
||||||
local all_linters = {}
|
|
||||||
for _, v in pairs(lint.linters_by_ft) do
|
|
||||||
for _, linter in ipairs(v) do
|
|
||||||
if not table_contains(ignore_install, linter) then
|
|
||||||
table.insert(all_linters, linter)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
require("mason-nvim-lint").setup({
|
|
||||||
ensure_installed = all_linters,
|
|
||||||
automatic_installation = true,
|
|
||||||
})
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
local lspconfig = package.loaded["lspconfig"]
|
|
||||||
|
|
||||||
-- List of servers to ignore during install
|
|
||||||
local ignore_install = {}
|
|
||||||
|
|
||||||
-- Helper function to find if value is in table.
|
|
||||||
local function table_contains(table, value)
|
|
||||||
for _, v in ipairs(table) do
|
|
||||||
if v == value then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Build a list of lsp servers to install minus the ignored list.
|
|
||||||
local all_servers = {}
|
|
||||||
for _, s in ipairs(lspconfig.servers) do
|
|
||||||
if not table_contains(ignore_install, s) then
|
|
||||||
table.insert(all_servers, s)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = all_servers,
|
|
||||||
automatic_installation = false,
|
|
||||||
})
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
local options = {
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"c",
|
|
||||||
"cmake",
|
|
||||||
"cpp",
|
|
||||||
"fish",
|
|
||||||
-- "go",
|
|
||||||
-- "gomod",
|
|
||||||
-- "gosum",
|
|
||||||
-- "gotmpl",
|
|
||||||
-- "gowork",
|
|
||||||
-- "haskell",
|
|
||||||
"lua",
|
|
||||||
"luadoc",
|
|
||||||
"make",
|
|
||||||
"markdown",
|
|
||||||
"odin",
|
|
||||||
"printf",
|
|
||||||
"python",
|
|
||||||
"toml",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
use_languagetree = true,
|
|
||||||
},
|
|
||||||
|
|
||||||
indent = { enable = true },
|
|
||||||
}
|
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup(options)
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
require("nvchad.mappings")
|
|
||||||
|
|
||||||
local map = vim.keymap.set
|
|
||||||
|
|
||||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
|
||||||
map("i", "jk", "<ESC>")
|
|
||||||
|
|
||||||
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
|
||||||
|
|
||||||
local keymap = vim.api.nvim_set_keymap
|
|
||||||
local opts = { noremap = true }
|
|
||||||
|
|
||||||
-- CMake
|
|
||||||
keymap("", "<leader>cg", ":CMakeGenerate<cr>", {})
|
|
||||||
keymap("", "<leader>cb", ":CMakeBuild<cr>", {})
|
|
||||||
keymap("", "<leader>cq", ":CMakeClose<cr>", {})
|
|
||||||
keymap("", "<leader>cc", ":CMakeClean<cr>", {})
|
|
||||||
|
|
||||||
keymap("", "<leader>nt", ":ToggleTerm<cr>", {})
|
|
||||||
|
|
||||||
function _G.set_terminal_keymaps()
|
|
||||||
local opts = {buffer = 0}
|
|
||||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
|
||||||
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
|
|
||||||
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
|
||||||
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
|
||||||
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
|
||||||
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
|
||||||
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
|
||||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
require("nvchad.options")
|
|
||||||
|
|
||||||
local o = vim.o
|
|
||||||
|
|
||||||
-- Indenting
|
|
||||||
o.shiftwidth = 4
|
|
||||||
o.tabstop = 4
|
|
||||||
o.softtabstop = 4
|
|
||||||
|
|
||||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
|
||||||
|
|
||||||
-- set filetype for .CBL COBOL files.
|
|
||||||
-- vim.cmd([[ au BufRead,BufNewFile *.CBL set filetype=cobol ]])
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
local group = vim.api.nvim_create_augroup("autosave", {})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "AutoSaveWritePost",
|
||||||
|
group = group,
|
||||||
|
callback = function(opts)
|
||||||
|
if opts.data.saved_buffer ~= nil then
|
||||||
|
print("AutoSaved at " .. vim.fn.strftime("%H:%M:%S"))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
|
||||||
|
"okuuva/auto-save.nvim",
|
||||||
|
version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release
|
||||||
|
cmd = "ASToggle", -- optional for lazy loading on command
|
||||||
|
event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events
|
||||||
|
opts = {
|
||||||
|
-- your config goes here
|
||||||
|
-- or just leave it empty :)
|
||||||
|
--
|
||||||
|
|
||||||
|
enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
|
||||||
|
trigger_events = { -- See :h events
|
||||||
|
immediate_save = { "BufLeave", "FocusLost" }, -- vim events that trigger an immediate save
|
||||||
|
defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
|
||||||
|
cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save
|
||||||
|
},
|
||||||
|
-- function that takes the buffer handle and determines whether to save the current buffer or not
|
||||||
|
-- return true: if buffer is ok to be saved
|
||||||
|
-- return false: if it's not ok to be saved
|
||||||
|
-- if set to `nil` then no specific condition is applied
|
||||||
|
condition = nil,
|
||||||
|
write_all_buffers = false, -- write all buffers when the current one meets `condition`
|
||||||
|
noautocmd = false, -- do not execute autocmds when saving
|
||||||
|
lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details
|
||||||
|
debounce_delay = 1000, -- delay after which a pending save is executed
|
||||||
|
-- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable
|
||||||
|
debug = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
return {
|
return {
|
||||||
"Civitasv/cmake-tools.nvim",
|
"Civitasv/cmake-tools.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
init = function()
|
init = function()
|
||||||
local loaded = false
|
local loaded = false
|
||||||
local function check()
|
local function check()
|
||||||
local cwd = vim.uv.cwd()
|
local cwd = vim.uv.cwd()
|
||||||
if vim.fn.filereadable(cwd .. "/CMakeLists.txt") == 1 then
|
if vim.fn.filereadable(cwd .. "/CMakeLists.txt") == 1 then
|
||||||
require("lazy").load({ plugins = { "cmake-tools.nvim" } })
|
require("lazy").load({ plugins = { "cmake-tools.nvim" } })
|
||||||
loaded = true
|
loaded = true
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
check()
|
||||||
|
vim.api.nvim_create_autocmd("DirChanged", {
|
||||||
|
callback = function()
|
||||||
|
if not loaded then
|
||||||
|
check()
|
||||||
end
|
end
|
||||||
check()
|
end,
|
||||||
vim.api.nvim_create_autocmd("DirChanged", {
|
})
|
||||||
callback = function()
|
end,
|
||||||
if not loaded then
|
opts = { "cmake-tools.nvim" },
|
||||||
check()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
opts = {},
|
|
||||||
}
|
}
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
return {
|
|
||||||
"hrsh7th/cmp-cmdline"}
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
}
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||||
|
-- stylua: ignore
|
||||||
|
if true then return {} end
|
||||||
|
|
||||||
|
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
|
||||||
|
--
|
||||||
|
-- In your plugin files, you can:
|
||||||
|
-- * add extra plugins
|
||||||
|
-- * disable/enabled LazyVim plugins
|
||||||
|
-- * override the configuration of LazyVim plugins
|
||||||
|
return {
|
||||||
|
-- add gruvbox
|
||||||
|
{ "ellisonleao/gruvbox.nvim" },
|
||||||
|
|
||||||
|
-- Configure LazyVim to load gruvbox
|
||||||
|
{
|
||||||
|
"LazyVim/LazyVim",
|
||||||
|
opts = {
|
||||||
|
colorscheme = "gruvbox",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- change trouble config
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
-- opts will be merged with the parent spec
|
||||||
|
opts = { use_diagnostic_signs = true },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- disable trouble
|
||||||
|
{ "folke/trouble.nvim", enabled = false },
|
||||||
|
|
||||||
|
-- override nvim-cmp and add cmp-emoji
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = { "hrsh7th/cmp-emoji" },
|
||||||
|
---@param opts cmp.ConfigSchema
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sources, { name = "emoji" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- change some telescope options and a keymap to browse plugin files
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
keys = {
|
||||||
|
-- add a keymap to browse plugin files
|
||||||
|
-- stylua: ignore
|
||||||
|
{
|
||||||
|
"<leader>fp",
|
||||||
|
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||||
|
desc = "Find Plugin File",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- change some options
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
layout_strategy = "horizontal",
|
||||||
|
layout_config = { prompt_position = "top" },
|
||||||
|
sorting_strategy = "ascending",
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- add pyright to lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
---@class PluginLspOpts
|
||||||
|
opts = {
|
||||||
|
---@type lspconfig.options
|
||||||
|
servers = {
|
||||||
|
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||||
|
pyright = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
"jose-elias-alvarez/typescript.nvim",
|
||||||
|
init = function()
|
||||||
|
require("lazyvim.util").lsp.on_attach(function(_, buffer)
|
||||||
|
-- stylua: ignore
|
||||||
|
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
|
||||||
|
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
---@class PluginLspOpts
|
||||||
|
opts = {
|
||||||
|
---@type lspconfig.options
|
||||||
|
servers = {
|
||||||
|
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||||
|
tsserver = {},
|
||||||
|
},
|
||||||
|
-- you can do any additional lsp server setup here
|
||||||
|
-- return true if you don't want this server to be setup with lspconfig
|
||||||
|
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||||
|
setup = {
|
||||||
|
-- example to setup with typescript.nvim
|
||||||
|
tsserver = function(_, opts)
|
||||||
|
require("typescript").setup({ server = opts })
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
-- Specify * to use this function as a fallback for any server
|
||||||
|
-- ["*"] = function(server, opts) end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||||
|
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||||
|
|
||||||
|
-- add more treesitter parsers
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"python",
|
||||||
|
"query",
|
||||||
|
"regex",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||||
|
-- would overwrite `ensure_installed` with the new value.
|
||||||
|
-- If you'd rather extend the default config, use the code below instead:
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
-- add tsx and treesitter
|
||||||
|
vim.list_extend(opts.ensure_installed, {
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- the opts function can also be used to change the default opts:
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_x, {
|
||||||
|
function()
|
||||||
|
return "😄"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- or you can return new options to override all the defaults
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function()
|
||||||
|
return {
|
||||||
|
--[[add your custom lualine config here]]
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- use mini.starter instead of alpha
|
||||||
|
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||||
|
|
||||||
|
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||||
|
|
||||||
|
-- add any tools you want to have installed below
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"ansible-language-server",
|
||||||
|
"ansible-lint",
|
||||||
|
"bash-debug-adapter",
|
||||||
|
"bash-language-server",
|
||||||
|
"biome",
|
||||||
|
"black",
|
||||||
|
"checkmake",
|
||||||
|
"clang-format",
|
||||||
|
"clangd",
|
||||||
|
"cmake-language-server",
|
||||||
|
"cmakelang",
|
||||||
|
"cmakelint",
|
||||||
|
"codelldb",
|
||||||
|
"cpplint",
|
||||||
|
"cpptools",
|
||||||
|
"delve",
|
||||||
|
"django-template-lsp",
|
||||||
|
"djlint",
|
||||||
|
"docker-compose-language-service",
|
||||||
|
"dockerfile-language-server",
|
||||||
|
"gitleaks",
|
||||||
|
"gitlint",
|
||||||
|
"gitui",
|
||||||
|
"gofumpt",
|
||||||
|
"goimports",
|
||||||
|
"gomodifytags",
|
||||||
|
"gopls",
|
||||||
|
"hadolint",
|
||||||
|
"helm-ls",
|
||||||
|
"impl",
|
||||||
|
"lua-language-server",
|
||||||
|
"luacheck",
|
||||||
|
"luaformatter",
|
||||||
|
"luau-lsp",
|
||||||
|
"markdown-oxide",
|
||||||
|
"markdown-toc",
|
||||||
|
"markdownlint",
|
||||||
|
"markdownlint-cli2",
|
||||||
|
"marksman",
|
||||||
|
"markuplint",
|
||||||
|
"mutt-language-server",
|
||||||
|
"neocmakelsp",
|
||||||
|
"prettier",
|
||||||
|
"prettierd",
|
||||||
|
"pyright",
|
||||||
|
"ruff",
|
||||||
|
"shellcheck",
|
||||||
|
"shfmt",
|
||||||
|
"sql-formatter",
|
||||||
|
"sqlfluff",
|
||||||
|
"sqlfmt",
|
||||||
|
"sqlls",
|
||||||
|
"sqls",
|
||||||
|
"stylua",
|
||||||
|
"terraform-ls",
|
||||||
|
"yaml-language-server",
|
||||||
|
"yamlfix",
|
||||||
|
"yamlfmt",
|
||||||
|
"yamllint",
|
||||||
|
"shellcheck",
|
||||||
|
"shfmt",
|
||||||
|
"flake8",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
"voldikss/vim-floaterm",
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
return {
|
|
||||||
"rafamadriz/friendly-snippets"}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
return {
|
|
||||||
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
config = function()
|
|
||||||
require("configs.treesitter")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
config = function()
|
|
||||||
require("nvchad.configs.lspconfig").defaults()
|
|
||||||
require("configs.lspconfig")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "nvim-lspconfig" },
|
|
||||||
config = function()
|
|
||||||
require("configs.mason-lspconfig")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"mfussenegger/nvim-lint",
|
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
|
||||||
config = function()
|
|
||||||
require("configs.lint")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"rshkarin/mason-nvim-lint",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "nvim-lint" },
|
|
||||||
config = function()
|
|
||||||
require("configs.mason-lint")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"stevearc/conform.nvim",
|
|
||||||
event = "BufWritePre",
|
|
||||||
config = function()
|
|
||||||
require("configs.conform")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"zapling/mason-conform.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = { "conform.nvim" },
|
|
||||||
config = function()
|
|
||||||
require("configs.mason-conform")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
-- nvim v0.8.0
|
-- nvim v0.8.0
|
||||||
return {
|
return {
|
||||||
"kdheepak/lazygit.nvim",
|
"kdheepak/lazygit.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
cmd = {
|
cmd = {
|
||||||
"LazyGit",
|
"LazyGit",
|
||||||
"LazyGitConfig",
|
"LazyGitConfig",
|
||||||
"LazyGitCurrentFile",
|
"LazyGitCurrentFile",
|
||||||
"LazyGitFilter",
|
"LazyGitFilter",
|
||||||
"LazyGitFilterCurrentFile",
|
"LazyGitFilterCurrentFile",
|
||||||
},
|
},
|
||||||
-- optional for floating window border decoration
|
-- optional for floating window border decoration
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||||
-- order to load the plugin when the command is run for the first time
|
-- order to load the plugin when the command is run for the first time
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
return {
|
|
||||||
"desdic/macrothis.nvim",
|
|
||||||
opts = {},
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<Leader>kkd",
|
|
||||||
function()
|
|
||||||
require("macrothis").delete()
|
|
||||||
end,
|
|
||||||
desc = "delete",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kke",
|
|
||||||
function()
|
|
||||||
require("macrothis").edit()
|
|
||||||
end,
|
|
||||||
desc = "edit",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kkl",
|
|
||||||
function()
|
|
||||||
require("macrothis").load()
|
|
||||||
end,
|
|
||||||
desc = "load",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kkn",
|
|
||||||
function()
|
|
||||||
require("macrothis").rename()
|
|
||||||
end,
|
|
||||||
desc = "rename",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kkq",
|
|
||||||
function()
|
|
||||||
require("macrothis").quickfix()
|
|
||||||
end,
|
|
||||||
desc = "run macro on all files in quickfix",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kkr",
|
|
||||||
function()
|
|
||||||
require("macrothis").run()
|
|
||||||
end,
|
|
||||||
desc = "run macro",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kks",
|
|
||||||
function()
|
|
||||||
require("macrothis").save()
|
|
||||||
end,
|
|
||||||
desc = "save",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kkx",
|
|
||||||
function()
|
|
||||||
require("macrothis").register()
|
|
||||||
end,
|
|
||||||
desc = "edit register",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kkp",
|
|
||||||
function()
|
|
||||||
require("macrothis").copy_register_printable()
|
|
||||||
end,
|
|
||||||
desc = "Copy register as printable",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<Leader>kkm",
|
|
||||||
function()
|
|
||||||
require("macrothis").copy_macro_printable()
|
|
||||||
end,
|
|
||||||
desc = "Copy macro as printable",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
"echasnovski/mini.nvim",
|
|
||||||
version = "*",
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
return {
|
|
||||||
"NeogitOrg/neogit",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim", -- required
|
|
||||||
"sindrets/diffview.nvim", -- optional - Diff integration
|
|
||||||
|
|
||||||
-- Only one of these is needed.
|
|
||||||
"nvim-telescope/telescope.nvim", -- optional
|
|
||||||
"ibhagwan/fzf-lua", -- optional
|
|
||||||
"echasnovski/mini.pick", -- optional
|
|
||||||
},
|
|
||||||
config = true,
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
-- lazy.nvim
|
|
||||||
return {
|
|
||||||
"folke/noice.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {
|
|
||||||
-- add any options here
|
|
||||||
},
|
|
||||||
dependencies = {
|
|
||||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
-- OPTIONAL:
|
|
||||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
|
||||||
-- If not available, we use `mini` as the fallback
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
local M = {
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-nvim-lua",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"hrsh7th/cmp-cmdline",
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
M.config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "nvim_lua" },
|
|
||||||
{ name = "luasnip" }, -- For luasnip users.
|
|
||||||
{ name = "orgmode" },
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
{ name = "path" },
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup.cmdline(":", {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "path" },
|
|
||||||
}, {
|
|
||||||
{ name = "cmdline" },
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
||||||
@@ -0,0 +1,349 @@
|
|||||||
|
return {
|
||||||
|
"epwalsh/obsidian.nvim",
|
||||||
|
version = "*", -- recommended, use latest release instead of latest commit
|
||||||
|
lazy = true,
|
||||||
|
ft = "markdown",
|
||||||
|
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
|
||||||
|
-- event = {
|
||||||
|
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
|
||||||
|
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
|
||||||
|
-- -- refer to `:h file-pattern` for more examples
|
||||||
|
-- "BufReadPre path/to/my-vault/*.md",
|
||||||
|
-- "BufNewFile path/to/my-vault/*.md",
|
||||||
|
-- },
|
||||||
|
dependencies = {
|
||||||
|
-- Required.
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
"nvim-treesitter",
|
||||||
|
-- see below for full list of optional dependencies 👇
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
{
|
||||||
|
-- A list of workspace names, paths, and configuration overrides.
|
||||||
|
-- If you use the Obsidian app, the 'path' of a workspace should generally be
|
||||||
|
-- your vault root (where the `.obsidian` folder is located).
|
||||||
|
-- When obsidian.nvim is loaded by your plugin manager, it will automatically set
|
||||||
|
-- the workspace to the first workspace in the list whose `path` is a parent of the
|
||||||
|
-- current markdown file being edited.
|
||||||
|
workspaces = {
|
||||||
|
{
|
||||||
|
name = "personal",
|
||||||
|
path = "~/markdown/Personal/",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "work",
|
||||||
|
path = "~/markdown/Technical/",
|
||||||
|
-- Optional, override certain settings.
|
||||||
|
overrides = {
|
||||||
|
notes_subdir = "notes",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Alternatively - and for backwards compatibility - you can set 'dir' to a single path instead of
|
||||||
|
-- 'workspaces'. For example:
|
||||||
|
-- dir = "~/vaults/work",
|
||||||
|
|
||||||
|
-- Optional, if you keep notes in a specific subdirectory of your vault.
|
||||||
|
notes_subdir = "notes",
|
||||||
|
|
||||||
|
-- Optional, set the log level for obsidian.nvim. This is an integer corresponding to one of the log
|
||||||
|
-- levels defined by "vim.log.levels.*".
|
||||||
|
log_level = vim.log.levels.INFO,
|
||||||
|
|
||||||
|
daily_notes = {
|
||||||
|
-- Optional, if you keep daily notes in a separate directory.
|
||||||
|
folder = "notes/dailies",
|
||||||
|
-- Optional, if you want to change the date format for the ID of daily notes.
|
||||||
|
date_format = "%Y-%m-%d",
|
||||||
|
-- Optional, if you want to change the date format of the default alias of daily notes.
|
||||||
|
alias_format = "%B %-d, %Y",
|
||||||
|
-- Optional, default tags to add to each new daily note created.
|
||||||
|
default_tags = { "daily-notes" },
|
||||||
|
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
|
||||||
|
template = nil,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp.
|
||||||
|
completion = {
|
||||||
|
-- Set to false to disable completion.
|
||||||
|
nvim_cmp = true,
|
||||||
|
-- Trigger completion at 2 chars.
|
||||||
|
min_chars = 2,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Optional, configure key mappings. These are the defaults. If you don't want to set any keymappings this
|
||||||
|
-- way then set 'mappings = {}'.
|
||||||
|
mappings = {
|
||||||
|
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
|
||||||
|
["gf"] = {
|
||||||
|
action = function()
|
||||||
|
return require("obsidian").util.gf_passthrough()
|
||||||
|
end,
|
||||||
|
opts = { noremap = false, expr = true, buffer = true },
|
||||||
|
},
|
||||||
|
-- Toggle check-boxes.
|
||||||
|
["<leader>ch"] = {
|
||||||
|
action = function()
|
||||||
|
return require("obsidian").util.toggle_checkbox()
|
||||||
|
end,
|
||||||
|
opts = { buffer = true },
|
||||||
|
},
|
||||||
|
-- Smart action depending on context, either follow link or toggle checkbox.
|
||||||
|
["<cr>"] = {
|
||||||
|
action = function()
|
||||||
|
return require("obsidian").util.smart_action()
|
||||||
|
end,
|
||||||
|
opts = { buffer = true, expr = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Where to put new notes. Valid options are
|
||||||
|
-- * "current_dir" - put new notes in same directory as the current buffer.
|
||||||
|
-- * "notes_subdir" - put new notes in the default notes subdirectory.
|
||||||
|
new_notes_location = "notes_subdir",
|
||||||
|
|
||||||
|
-- Optional, customize how note IDs are generated given an optional title.
|
||||||
|
---@param title string|?
|
||||||
|
---@return string
|
||||||
|
note_id_func = function(title)
|
||||||
|
-- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
|
||||||
|
-- In this case a note with the title 'My new note' will be given an ID that looks
|
||||||
|
-- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
|
||||||
|
local suffix = ""
|
||||||
|
if title ~= nil then
|
||||||
|
-- If title is given, transform it into valid file name.
|
||||||
|
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
|
||||||
|
else
|
||||||
|
-- If title is nil, just add 4 random uppercase letters to the suffix.
|
||||||
|
for _ = 1, 4 do
|
||||||
|
suffix = suffix .. string.char(math.random(65, 90))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return tostring(os.time()) .. "-" .. suffix
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Optional, customize how note file names are generated given the ID, target directory, and title.
|
||||||
|
---@param spec { id: string, dir: obsidian.Path, title: string|? }
|
||||||
|
---@return string|obsidian.Path The full path to the new note.
|
||||||
|
note_path_func = function(spec)
|
||||||
|
-- This is equivalent to the default behavior.
|
||||||
|
local path = spec.dir / tostring(spec.id)
|
||||||
|
return path:with_suffix(".md")
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Optional, customize how wiki links are formatted. You can set this to one of:
|
||||||
|
-- * "use_alias_only", e.g. '[[Foo Bar]]'
|
||||||
|
-- * "prepend_note_id", e.g. '[[foo-bar|Foo Bar]]'
|
||||||
|
-- * "prepend_note_path", e.g. '[[foo-bar.md|Foo Bar]]'
|
||||||
|
-- * "use_path_only", e.g. '[[foo-bar.md]]'
|
||||||
|
-- Or you can set it to a function that takes a table of options and returns a string, like this:
|
||||||
|
wiki_link_func = function(opts)
|
||||||
|
return require("obsidian.util").wiki_link_id_prefix(opts)
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Optional, customize how markdown links are formatted.
|
||||||
|
markdown_link_func = function(opts)
|
||||||
|
return require("obsidian.util").markdown_link(opts)
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Either 'wiki' or 'markdown'.
|
||||||
|
preferred_link_style = "wiki",
|
||||||
|
|
||||||
|
-- Optional, boolean or a function that takes a filename and returns a boolean.
|
||||||
|
-- `true` indicates that you don't want obsidian.nvim to manage frontmatter.
|
||||||
|
disable_frontmatter = false,
|
||||||
|
|
||||||
|
-- Optional, alternatively you can customize the frontmatter data.
|
||||||
|
---@return table
|
||||||
|
note_frontmatter_func = function(note)
|
||||||
|
-- Add the title of the note as an alias.
|
||||||
|
if note.title then
|
||||||
|
note:add_alias(note.title)
|
||||||
|
end
|
||||||
|
|
||||||
|
local out = { id = note.id, aliases = note.aliases, tags = note.tags }
|
||||||
|
|
||||||
|
-- `note.metadata` contains any manually added fields in the frontmatter.
|
||||||
|
-- So here we just make sure those fields are kept in the frontmatter.
|
||||||
|
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
|
||||||
|
for k, v in pairs(note.metadata) do
|
||||||
|
out[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return out
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Optional, for templates (see below).
|
||||||
|
templates = {
|
||||||
|
folder = "templates",
|
||||||
|
date_format = "%Y-%m-%d",
|
||||||
|
time_format = "%H:%M",
|
||||||
|
-- A map for custom variables, the key should be the variable and the value a function
|
||||||
|
substitutions = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Optional, by default when you use `:ObsidianFollowLink` on a link to an external
|
||||||
|
-- URL it will be ignored but you can customize this behavior here.
|
||||||
|
---@param url string
|
||||||
|
follow_url_func = function(url)
|
||||||
|
-- Open the URL in the default web browser.
|
||||||
|
vim.fn.jobstart({ "open", url }) -- Mac OS
|
||||||
|
-- vim.fn.jobstart({"xdg-open", url}) -- linux
|
||||||
|
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
|
||||||
|
-- vim.ui.open(url) -- need Neovim 0.10.0+
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
|
||||||
|
-- file it will be ignored but you can customize this behavior here.
|
||||||
|
---@param img string
|
||||||
|
follow_img_func = function(img)
|
||||||
|
vim.fn.jobstart({ "qlmanage", "-p", img }) -- Mac OS quick look preview
|
||||||
|
-- vim.fn.jobstart({"xdg-open", url}) -- linux
|
||||||
|
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Optional, set to true if you use the Obsidian Advanced URI plugin.
|
||||||
|
-- https://github.com/Vinzent03/obsidian-advanced-uri
|
||||||
|
use_advanced_uri = false,
|
||||||
|
|
||||||
|
-- Optional, set to true to force ':ObsidianOpen' to bring the app to the foreground.
|
||||||
|
open_app_foreground = false,
|
||||||
|
|
||||||
|
picker = {
|
||||||
|
-- Set your preferred picker. Can be one of 'telescope.nvim', 'fzf-lua', or 'mini.pick'.
|
||||||
|
name = "snacks.nvim",
|
||||||
|
-- Optional, configure key mappings for the picker. These are the defaults.
|
||||||
|
-- Not all pickers support all mappings.
|
||||||
|
note_mappings = {
|
||||||
|
-- Create a new note from your query.
|
||||||
|
new = "<C-x>",
|
||||||
|
-- Insert a link to the selected note.
|
||||||
|
insert_link = "<C-l>",
|
||||||
|
},
|
||||||
|
tag_mappings = {
|
||||||
|
-- Add tag(s) to current note.
|
||||||
|
tag_note = "<C-x>",
|
||||||
|
-- Insert a tag at the current location.
|
||||||
|
insert_tag = "<C-l>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Optional, sort search results by "path", "modified", "accessed", or "created".
|
||||||
|
-- The recommend value is "modified" and `true` for `sort_reversed`, which means, for example,
|
||||||
|
-- that `:ObsidianQuickSwitch` will show the notes sorted by latest modified time
|
||||||
|
sort_by = "modified",
|
||||||
|
sort_reversed = true,
|
||||||
|
|
||||||
|
-- Set the maximum number of lines to read from notes on disk when performing certain searches.
|
||||||
|
search_max_lines = 1000,
|
||||||
|
|
||||||
|
-- Optional, determines how certain commands open notes. The valid options are:
|
||||||
|
-- 1. "current" (the default) - to always open in the current window
|
||||||
|
-- 2. "vsplit" - to open in a vertical split if there's not already a vertical split
|
||||||
|
-- 3. "hsplit" - to open in a horizontal split if there's not already a horizontal split
|
||||||
|
open_notes_in = "current",
|
||||||
|
|
||||||
|
-- Optional, define your own callbacks to further customize behavior.
|
||||||
|
callbacks = {
|
||||||
|
-- Runs at the end of `require("obsidian").setup()`.
|
||||||
|
---@param client obsidian.Client
|
||||||
|
post_setup = function(client) end,
|
||||||
|
|
||||||
|
-- Runs anytime you enter the buffer for a note.
|
||||||
|
---@param client obsidian.Client
|
||||||
|
---@param note obsidian.Note
|
||||||
|
enter_note = function(client, note) end,
|
||||||
|
|
||||||
|
-- Runs anytime you leave the buffer for a note.
|
||||||
|
---@param client obsidian.Client
|
||||||
|
---@param note obsidian.Note
|
||||||
|
leave_note = function(client, note) end,
|
||||||
|
|
||||||
|
-- Runs right before writing the buffer for a note.
|
||||||
|
---@param client obsidian.Client
|
||||||
|
---@param note obsidian.Note
|
||||||
|
pre_write_note = function(client, note) end,
|
||||||
|
|
||||||
|
-- Runs anytime the workspace is set/changed.
|
||||||
|
---@param client obsidian.Client
|
||||||
|
---@param workspace obsidian.Workspace
|
||||||
|
post_set_workspace = function(client, workspace) end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Optional, configure additional syntax highlighting / extmarks.
|
||||||
|
-- This requires you have `conceallevel` set to 1 or 2. See `:help conceallevel` for more details.
|
||||||
|
ui = {
|
||||||
|
enable = true, -- set to false to disable all additional syntax features
|
||||||
|
update_debounce = 200, -- update delay after a text change (in milliseconds)
|
||||||
|
max_file_length = 5000, -- disable UI features for files with more than this many lines
|
||||||
|
-- Define how various check-boxes are displayed
|
||||||
|
checkboxes = {
|
||||||
|
-- NOTE: the 'char' value has to be a single character, and the highlight groups are defined below.
|
||||||
|
[" "] = { char = "", hl_group = "ObsidianTodo" },
|
||||||
|
["x"] = { char = "", hl_group = "ObsidianDone" },
|
||||||
|
[">"] = { char = "", hl_group = "ObsidianRightArrow" },
|
||||||
|
["~"] = { char = "", hl_group = "ObsidianTilde" },
|
||||||
|
["!"] = { char = "", hl_group = "ObsidianImportant" },
|
||||||
|
-- Replace the above with this if you don't have a patched font:
|
||||||
|
-- [" "] = { char = "☐", hl_group = "ObsidianTodo" },
|
||||||
|
-- ["x"] = { char = "✔", hl_group = "ObsidianDone" },
|
||||||
|
|
||||||
|
-- You can also add more custom ones...
|
||||||
|
},
|
||||||
|
-- Use bullet marks for non-checkbox lists.
|
||||||
|
bullets = { char = "•", hl_group = "ObsidianBullet" },
|
||||||
|
external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" },
|
||||||
|
-- Replace the above with this if you don't have a patched font:
|
||||||
|
-- external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" },
|
||||||
|
reference_text = { hl_group = "ObsidianRefText" },
|
||||||
|
highlight_text = { hl_group = "ObsidianHighlightText" },
|
||||||
|
tags = { hl_group = "ObsidianTag" },
|
||||||
|
block_ids = { hl_group = "ObsidianBlockID" },
|
||||||
|
hl_groups = {
|
||||||
|
-- The options are passed directly to `vim.api.nvim_set_hl()`. See `:help nvim_set_hl`.
|
||||||
|
ObsidianTodo = { bold = true, fg = "#f78c6c" },
|
||||||
|
ObsidianDone = { bold = true, fg = "#89ddff" },
|
||||||
|
ObsidianRightArrow = { bold = true, fg = "#f78c6c" },
|
||||||
|
ObsidianTilde = { bold = true, fg = "#ff5370" },
|
||||||
|
ObsidianImportant = { bold = true, fg = "#d73128" },
|
||||||
|
ObsidianBullet = { bold = true, fg = "#89ddff" },
|
||||||
|
ObsidianRefText = { underline = true, fg = "#c792ea" },
|
||||||
|
ObsidianExtLinkIcon = { fg = "#c792ea" },
|
||||||
|
ObsidianTag = { italic = true, fg = "#89ddff" },
|
||||||
|
ObsidianBlockID = { italic = true, fg = "#89ddff" },
|
||||||
|
ObsidianHighlightText = { bg = "#75662e" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Specify how to handle attachments.
|
||||||
|
attachments = {
|
||||||
|
-- The default folder to place images in via `:ObsidianPasteImg`.
|
||||||
|
-- If this is a relative path it will be interpreted as relative to the vault root.
|
||||||
|
-- You can always override this per image by passing a full path to the command instead of just a filename.
|
||||||
|
img_folder = "assets/imgs", -- This is the default
|
||||||
|
|
||||||
|
-- Optional, customize the default name or prefix when pasting images via `:ObsidianPasteImg`.
|
||||||
|
---@return string
|
||||||
|
img_name_func = function()
|
||||||
|
-- Prefix image names with timestamp.
|
||||||
|
return string.format("%s-", os.time())
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- A function that determines the text to insert in the note when pasting an image.
|
||||||
|
-- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file.
|
||||||
|
-- This is the default implementation.
|
||||||
|
---@param client obsidian.Client
|
||||||
|
---@param path obsidian.Path the absolute path to the image file
|
||||||
|
---@return string
|
||||||
|
img_text_func = function(client, path)
|
||||||
|
path = client:vault_relative_path(path) or path
|
||||||
|
return string.format("", path.name, path)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- see below for full list of options 👇
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
return { "akinsho/toggleterm.nvim", version = "*" }
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
"cdelledonne/vim-cmake",
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 566 KiB |
|
Before Width: | Height: | Size: 602 KiB |
|
Before Width: | Height: | Size: 307 KiB |
|
Before Width: | Height: | Size: 650 KiB |
|
Before Width: | Height: | Size: 269 KiB |
|
Before Width: | Height: | Size: 578 KiB |
|
Before Width: | Height: | Size: 606 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 4
|
||||||
|
column_width = 120
|
||||||
|
|
||||||