Compare commits

..

43 Commits

Author SHA1 Message Date
9f04e1e20d fix: merged 2023-10-12 11:49:27 +02:00
edff9b1a25 feat(starter): added Lazy Extras to mini.starter 2023-10-12 11:20:46 +02:00
38d2c8aab0 feat(extras): added extra for symbols-outline.nvim 2023-10-12 11:14:44 +02:00
50a358bc1e feat(config): better kind filter default for lua to deal with luals weirdness 2023-10-12 11:14:23 +02:00
b1d456cda7 fix(extras): make sure we use priorities to import extras in correct order 2023-10-12 11:14:02 +02:00
b9f3cada8a fix(plugin): show warning of removed core plugin when trying to load them without having the extra 2023-10-12 10:36:15 +02:00
777be2fabd fix(plugin): add nvim-treesitter-context rename warning 2023-10-12 10:35:47 +02:00
5c5e7c65c7 fix(dap): copy config before overriding args 2023-10-12 10:18:50 +02:00
5b51df3f39 refactor(nlua): cleanup 2023-10-12 09:43:24 +02:00
204be37843 feat(inject): util method to get upvalue 2023-10-12 09:42:48 +02:00
f98c4a26b3 fix(nlua): make nlua dap work with regular continue. Fixes #1666 2023-10-12 09:42:31 +02:00
94de32c598 fix(aerial): keymap 2023-10-12 07:30:40 +02:00
118ca3309d feat(mini.starter): adding mini.starter to lualine disabled files (#1667) 2023-10-12 07:28:49 +02:00
8597c2085f feat(ui): show optional plugins in a different color 2023-10-12 00:20:32 +02:00
c38c3bf407 feat: added aerial extra with integrations for edgy, telescope and lualine 2023-10-12 00:11:33 +02:00
f535fb6891 feat(treesitter): add nvim-treesitter-context by default 2023-10-12 00:11:12 +02:00
cb6832d8ad perf(lualine): get rid of lualine's weird lualine_require 2023-10-12 00:09:38 +02:00
c555e17e48 feat(config): make kind filter configurable for telescope/aerial/... 2023-10-12 00:09:04 +02:00
20d36ccd84 feat(treesitter): install nvim-ts-autotag by default 2023-10-11 22:39:24 +02:00
13366c6488 style(config): mini.align icons 2023-10-11 22:38:38 +02:00
d6bc320f20 feat(util): inject module 2023-10-11 22:38:10 +02:00
7bbd48caa0 feat(root): cached pretty path function for statuslines 2023-10-11 22:37:28 +02:00
761171a872 feat(navic): moved navic to extras 2023-10-11 22:36:45 +02:00
092b1fd802 fix(root): only use workspace folders that contain the buffer 2023-10-11 18:38:29 +02:00
d2d5d9f53c feat(dashboard): added LazyExtras shortcut to dashboard/alpha 2023-10-11 18:10:04 +02:00
38b530d33d feat(ui): added :LazyExtras to manage enabled extras in LazyVim 2023-10-11 17:48:40 +02:00
739409cd4b feat(config): load/save some data in lazyvim.json 2023-10-11 17:47:16 +02:00
058089d0d6 fix(notify): set default zindex=100 2023-10-11 17:39:46 +02:00
03c5aa71f3 ci: let release-please manage the version in the config file 2023-10-11 15:25:29 +02:00
0f0a81c175 fix(neo-tree): during init check global argslist instead of window-local 2023-10-11 14:56:55 +02:00
286a6fb8ae feat(config): use lazy's new custom events (Event.mappings) for a better LazyFile 2023-10-11 14:56:55 +02:00
b72a5c2dfa fix(lualine): when opening nvim with a file, show an empty statusline till lualine loads 2023-10-11 14:56:55 +02:00
704e85183b fix(format): always show formatter status even when no sources available 2023-10-11 14:56:54 +02:00
b5495eb38a feat(root): allow custom functions as part of vim.g.root_spec 2023-10-11 14:56:54 +02:00
27ceb433a9 fix(plugin): enable lazy_file 2023-10-11 14:56:54 +02:00
171a843edf feat(root): customizable root detection and :LazyRoot command 2023-10-11 14:56:54 +02:00
5538ab2d64 fix(ui): dont show left signs on virtual line numbers (wrap). Fixes #1654 2023-10-11 14:56:54 +02:00
65874d161a feat(starter)!: dashboard.nvim is now the default starter. To keep using alpha.nvim, enable the extra. 2023-10-11 14:56:54 +02:00
90a8200e7c feat!: make conform.nvim and nvim-lint the default formatters/linters 2023-10-11 14:56:54 +02:00
1599edd10a perf(plugin): move all lazy.nvim related code to lazyvim.util.plugin 2023-10-11 14:56:54 +02:00
eac18246d4 feat(format): new LazyVim formatter with integrations for lsp/none-ls/conform/eslint/... 2023-10-11 14:56:54 +02:00
aa0e4f52e4 perf(util): split lazyvim.util in smaller separate modules 2023-10-11 14:56:54 +02:00
b304db9236 Revert "fix(config): disable LazyFile till v10.0"
This reverts commit ee7a401388.
2023-10-11 14:56:29 +02:00
100 changed files with 1321 additions and 5037 deletions

View File

@ -11,7 +11,7 @@ jobs:
os: [ubuntu-latest] os: [ubuntu-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: Install Neovim - name: Install Neovim
shell: bash shell: bash
run: | run: |
@ -31,16 +31,16 @@ jobs:
needs: tests needs: tests
if: ${{ github.ref == 'refs/heads/main' }} if: ${{ github.ref == 'refs/heads/main' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: panvimdoc - name: panvimdoc
uses: kdheepak/panvimdoc@main uses: kdheepak/panvimdoc@main
with: with:
vimdoc: LazyVim vimdoc: LazyVim
version: "Neovim >= 0.9.0" version: "Neovim >= 0.8.0"
demojify: true demojify: true
treesitter: true treesitter: true
- name: Push changes - name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5 uses: stefanzweifel/git-auto-commit-action@v4
with: with:
commit_message: "chore(build): auto-generate vimdoc" commit_message: "chore(build): auto-generate vimdoc"
commit_user_name: "github-actions[bot]" commit_user_name: "github-actions[bot]"
@ -54,14 +54,14 @@ jobs:
- tests - tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: google-github-actions/release-please-action@v4 - uses: google-github-actions/release-please-action@v3
id: release id: release
with: with:
release-type: simple release-type: simple
package-name: LazyVim package-name: LazyVim
extra-files: | extra-files: |
lua/lazyvim/config/init.lua lua/lazyvim/config/init.lua
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: tag stable versions - name: tag stable versions
if: ${{ steps.release.outputs.release_created }} if: ${{ steps.release.outputs.release_created }}
run: | run: |

File diff suppressed because it is too large Load Diff

150
NEWS.md
View File

@ -1,150 +0,0 @@
# What's new?
## 11.x
- `mini.ai` is back as a default plugin! Removing it was a mistake.
It's a great plugin that enhances the native text objects.
- `:LazyExtras` now has multiple new sections:
- **Enabled**: extras that are currently enabled
- **Recommended Languages**: language extras recommended for the current buffer / directory
- **Recommended Plugins**: extras that are recommended for most users
- **Plugins**: other plugin extras
- **Languages**: other language extras
- new option `vim.g.deprecation_warnings` to disable deprecation warnings
Defaults to `false`. To disable, set it to `true` in your `options.lua`
- `vim-illuminate` move to extras
Document highlights now use native lsp functionality by default
Since Neovim 0.10 has been released, I've been working on a new version of **LazyVim**
that is fully compatible with all the latest Neovim features.
Additionally, some core plugins have been moved to extras.
- `native snippets` are now the default on Neovim 0.10
Older versions of Neovim will use the new `luasnip` extra.
- `native comments` are now the default on Neovim 0.10
Older versions of Neovim will use the new `mini-comment` extra.
`nvim-ts-context-commentstring` has been integrated in the native comments.
- `inlay hints` have been in **LazyVim** for a while, but are now
enabled by default. To disable them:
```lua
{
"nvim-lspconfig",
opts = {
inlay_hints = { enabled = false },
}
}
```
- plugins moved to extras:
- `mini.surround`
- `mini.indentscope` scopes are now also highlighted with `indent-blankline`
- `nvim-treesitter-context`
## 10.x
- added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md)
This is a plugin similar to gitsigns but with a neat diff overlay
that can be toggled with `<leader>go`.
- **trouble.nvim** has been rewritten from scratch and is now in beta.
I've added a new extra for it (`trouble-v3`) for those of you who want to try it out.
You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev)
- The **lazygit** integration now configures:
- the theme based on the colorscheme
- nerd font icons (v3)
- editor preset is set to `nvim-remote` for better interop with Neovim
- The option `vim.g.lazygit_theme` was renamed to `vim.g.lazygit_config`
- **lazygit** now automatically uses the colors of your current colorscheme.
This is enabled by default. To disable, add the below to your `options.lua`:
```lua
vim.g.lazygit_config = false
```
- Added support for `basedpyright` to the **python** extra.
Enable in your `options.lua` with:
```lua
vim.g.lazyvim_python_lsp = "basedpyright"
```
Be aware that `basedpyright` is still in development and
may not work exactly the same as `pyright`.
- User extras under `lua/plugins/extras` can now also be managed
with **LazyExtras**
- `nvim-ts-autotag` is now included by default
- `nvim-treesitter-context` is now included by default
- Added extra for `symbols-outline.nvim`
- Added extra for `aerial.nvim`
- `nvim-navic` has been removed. If you want to keep using `nvim-navic`,
you can enable the **editor.navic** extra
- New `:LazyExtras` command for managing **LazyVim** extras
- Improved **formatting**:
- **LazyVim** can now work with multiple formatters. Types:
- **primary**: only one primary formatter can be active at a time.
_(conform, none-ls, LSP)_
- **secondary**: multiple secondary formatters can be active _(eslint, ...)_
- **LazyVim** automatically selects the primary formatter based on the
current available sources and priorities.
- New `:LazyFormat` command for formatting the current selection or buffer
- New `:LazyFormatInfo` command for displaying the active formatters
for the current buffer
- Auto-formatting can be disabled with:
```lua
vim.g.autoformat = false -- globally
vim.b.autoformat = false -- buffer-local
```
- `none-ls.nvim` is no longer installed by default
- `conform.nvim` is now the default formatter
- `nvim-lint` is now the default linter
- If you want to keep using `none-ls.nvim`,
you can enable the **lsp.none-ls** extra
- `dashboard.nvim` is the new default dashboard plugin
- If you want to keep using `alpha.nvim`, you can enable the **ui.alpha** extra
- Improved **root detection**:
- New `:LazyRoot` command that shows info about the root dir detection
- Configurable with `vim.g.root_spec`
```lua
-- LazyVim root dir detection
-- Each entry can be:
-- * the name of a detector function like `lsp` or `cwd`
-- * a pattern or array of patterns like `.git` or `lua`.
-- * a function with signature `function(buf) -> string|string[]`
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
-- To disable root detection set to just "cwd"
vim.g.root_spec = { "cwd" }
```

View File

@ -5,11 +5,11 @@
<hr> <hr>
<h4 align="center"> <h4 align="center">
<a href="https://lazyvim.github.io/installation">Installieren</a> <a href="https://lazyvim.github.io/installation">Install</a>
· ·
<a href="https://lazyvim.github.io/configuration">Konfigurieren</a> <a href="https://lazyvim.github.io/configuration">Configure</a>
· ·
<a href="https://lazyvim.github.io">Dokumentation</a> <a href="https://lazyvim.github.io">Docs</a>
</h4> </h4>
<div align="center"><p> <div align="center"><p>
@ -36,8 +36,8 @@
</a> </a>
</div> </div>
LazyVim ist ein Neovim-Setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim). LazyVim ist ein Neovim setup aufgebaut auf [💤 lazy.nvim](https://github.com/folke/lazy.nvim).
Es erleichtert das Anpassen und Erweitern von Ihrer Konfiguration. Es erleichter das Anpassen und erweitern von Ihrer Konfiguration.
Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus Anstatt von vorne anzufangen oder eine vorgefertigte Distro zu verwenden, gibt LazyVim das beste aus
beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen beiden Welten - die Flexibilität Ihre Konfiguration zu verändern und einzustellen wie Sie es wollen
und die Einfachheit von einem vorgefertigten Setup. und die Einfachheit von einem vorgefertigten Setup.
@ -52,7 +52,7 @@ und die Einfachheit von einem vorgefertigten Setup.
- 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim) - 💤 Passe deine Konfiguration einfach an und erweitere diese mit [lazy.nvim](https://github.com/folke/lazy.nvim)
- 🚀 Extrem schnell - 🚀 Extrem schnell
- 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps - 🧹 Logische Voreinstellungen für optionen, autocmds und keymaps
- 📦 Kommt mit einem Haufen vorkonfigurierter, ready-to-use Plugins - 📦 Kommt mit einem Haufen vor Konfigurierten, ready to use Plugins
## ⚡️ Vorraussetzungen ## ⚡️ Vorraussetzungen
@ -108,15 +108,15 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
</details> </details>
## 📂 Dateistruktur ## 📂 File Structure
Die Dateien unter `config` werden automatisch und zur richtigen Zeit geladen, The files under config will be automatically loaded at the appropriate time,
sodass ein manuelles `require` nicht nötig ist. so you don't need to require those files manually.
**LazyVim** bringt Konfigurationsdatein mit, die **_vor_** Ihren eigenen geladen werden - **LazyVim** comes with a set of default config files that will be loaded
siehe [hier](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config) **_before_** your own. See [here](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
Sie können eigene Plugins unter `lua/plugins/` hinzufügen. Alle Dateien innerhalb
dieses Ordners werden automatisch mit [lazy.nvim](https://github.com/folke/lazy.nvim) You can add your custom plugin specs under `lua/plugins/`. All files there
geladen. will be automatically loaded by [lazy.nvim](https://github.com/folke/lazy.nvim)
<pre> <pre>
~/.config/nvim ~/.config/nvim
@ -133,6 +133,6 @@ geladen.
└── init.toml └── init.toml
</pre> </pre>
## ⚙️ Konfiguration ## ⚙️ Configuration
Siehe [Dokumentation](https://lazyvim.github.io). Refer to the [docs](https://lazyvim.github.io)

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 18 *LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 October 11
============================================================================== ==============================================================================
Table of Contents *LazyVim-table-of-contents* Table of Contents *LazyVim-table-of-contents*
@ -8,7 +8,6 @@ Table of Contents *LazyVim-table-of-contents*
- Getting Started |LazyVim-getting-started| - Getting Started |LazyVim-getting-started|
- File Structure |LazyVim-file-structure| - File Structure |LazyVim-file-structure|
- Configuration |LazyVim-configuration| - Configuration |LazyVim-configuration|
1. Links |LazyVim-links|
Install Install
· ·

View File

@ -7,11 +7,7 @@ end
-- Check if we need to reload the file when it changed -- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
group = augroup("checktime"), group = augroup("checktime"),
callback = function() command = "checktime",
if vim.o.buftype ~= "nofile" then
vim.cmd("checktime")
end
end,
}) })
-- Highlight on yank -- Highlight on yank
@ -57,8 +53,10 @@ vim.api.nvim_create_autocmd("FileType", {
"PlenaryTestPopup", "PlenaryTestPopup",
"help", "help",
"lspinfo", "lspinfo",
"man",
"notify", "notify",
"qf", "qf",
"query",
"spectre_panel", "spectre_panel",
"startuptime", "startuptime",
"tsplayground", "tsplayground",
@ -73,15 +71,6 @@ vim.api.nvim_create_autocmd("FileType", {
end, end,
}) })
-- make it easier to close man-files when opened inline
vim.api.nvim_create_autocmd("FileType", {
group = augroup("man_unlisted"),
pattern = { "man" },
callback = function(event)
vim.bo[event.buf].buflisted = false
end,
})
-- wrap and check for spell in text filetypes -- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
group = augroup("wrap_spell"), group = augroup("wrap_spell"),
@ -92,23 +81,14 @@ vim.api.nvim_create_autocmd("FileType", {
end, end,
}) })
-- Fix conceallevel for json files
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup("json_conceal"),
pattern = { "json", "jsonc", "json5" },
callback = function()
vim.opt_local.conceallevel = 0
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist -- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ "BufWritePre" }, { vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"), group = augroup("auto_create_dir"),
callback = function(event) callback = function(event)
if event.match:match("^%w%w+:[\\/][\\/]") then if event.match:match("^%w%w+://") then
return return
end end
local file = vim.uv.fs_realpath(event.match) or event.match local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end, end,
}) })

View File

@ -1,10 +1,9 @@
_G.LazyVim = require("lazyvim.util") local Util = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions ---@class LazyVimConfig: LazyVimOptions
local M = {} local M = {}
M.version = "10.21.1" -- x-release-please-version M.version = "10.0.0" -- x-release-please-version
LazyVim.config = M
---@class LazyVimOptions ---@class LazyVimOptions
local defaults = { local defaults = {
@ -20,13 +19,6 @@ local defaults = {
-- lazyvim.config.options can't be configured here since that's loaded before lazyvim setup -- lazyvim.config.options can't be configured here since that's loaded before lazyvim setup
-- if you want to disable loading options, add `package.loaded["lazyvim.config.options"] = true` to the top of your init.lua -- if you want to disable loading options, add `package.loaded["lazyvim.config.options"] = true` to the top of your init.lua
}, },
news = {
-- When enabled, NEWS.md will be shown when changed.
-- This only contains big new features and breaking changes.
lazyvim = true,
-- Same but for Neovim's news.txt
neovim = false,
},
-- icons used by other plugins -- icons used by other plugins
-- stylua: ignore -- stylua: ignore
icons = { icons = {
@ -85,7 +77,6 @@ local defaults = {
Snippet = "", Snippet = "",
String = "", String = "",
Struct = "󰆼 ", Struct = "󰆼 ",
TabNine = "󰏚 ",
Text = "", Text = "",
TypeParameter = "", TypeParameter = "",
Unit = "", Unit = "",
@ -93,7 +84,7 @@ local defaults = {
Variable = "󰀫 ", Variable = "󰀫 ",
}, },
}, },
---@type table<string, string[]|boolean>? ---@type table<string, string[]>?
kind_filter = { kind_filter = {
default = { default = {
"Class", "Class",
@ -110,8 +101,6 @@ local defaults = {
"Struct", "Struct",
"Trait", "Trait",
}, },
markdown = false,
help = false,
-- you can specify a different filter for each filetype -- you can specify a different filter for each filetype
lua = { lua = {
"Class", "Class",
@ -132,10 +121,8 @@ local defaults = {
} }
M.json = { M.json = {
version = 4,
data = { data = {
version = nil, ---@type string? version = nil, ---@type string?
news = {}, ---@type table<string, string>
extras = {}, ---@type string[] extras = {}, ---@type string[]
}, },
} }
@ -149,13 +136,19 @@ function M.json.load()
local ok, json = pcall(vim.json.decode, data, { luanil = { object = true, array = true } }) local ok, json = pcall(vim.json.decode, data, { luanil = { object = true, array = true } })
if ok then if ok then
M.json.data = vim.tbl_deep_extend("force", M.json.data, json or {}) M.json.data = vim.tbl_deep_extend("force", M.json.data, json or {})
if M.json.data.version ~= M.json.version then
LazyVim.json.migrate()
end
end end
end end
end end
function M.json.save()
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
local f = io.open(path, "w")
if f then
f:write(vim.json.encode(M.json.data))
f:close()
end
end
---@type LazyVimOptions ---@type LazyVimOptions
local options local options
@ -179,23 +172,22 @@ function M.setup(opts)
end end
M.load("keymaps") M.load("keymaps")
LazyVim.format.setup() Util.warn("This branch has been merged on main. Please update your config.")
LazyVim.news.setup()
LazyVim.root.setup() Util.format.setup()
vim.api.nvim_create_user_command("LazyRoot", function()
Util.root.info()
end, { desc = "LazyVim roots for the current buffer" })
vim.api.nvim_create_user_command("LazyExtras", function() vim.api.nvim_create_user_command("LazyExtras", function()
LazyVim.extras.show() Util.extras.show()
end, { desc = "Manage LazyVim extras" }) end, { desc = "Manage LazyVim extras" })
vim.api.nvim_create_user_command("LazyHealth", function()
vim.cmd([[Lazy! load all]])
vim.cmd([[checkhealth]])
end, { desc = "Load all plugins and run :checkhealth" })
end, end,
}) })
LazyVim.track("colorscheme") Util.track("colorscheme")
LazyVim.try(function() Util.try(function()
if type(M.colorscheme) == "function" then if type(M.colorscheme) == "function" then
M.colorscheme() M.colorscheme()
else else
@ -204,11 +196,11 @@ function M.setup(opts)
end, { end, {
msg = "Could not load your colorscheme", msg = "Could not load your colorscheme",
on_error = function(msg) on_error = function(msg)
LazyVim.error(msg) Util.error(msg)
vim.cmd.colorscheme("habamax") vim.cmd.colorscheme("habamax")
end, end,
}) })
LazyVim.track() Util.track()
end end
---@param buf? number ---@param buf? number
@ -219,21 +211,14 @@ function M.get_kind_filter(buf)
if M.kind_filter == false then if M.kind_filter == false then
return return
end end
if M.kind_filter[ft] == false then return M.kind_filter[ft] or M.kind_filter.default
return
end
if type(M.kind_filter[ft]) == "table" then
return M.kind_filter[ft]
end
---@diagnostic disable-next-line: return-type-mismatch
return type(M.kind_filter) == "table" and type(M.kind_filter.default) == "table" and M.kind_filter.default or nil
end end
---@param name "autocmds" | "options" | "keymaps" ---@param name "autocmds" | "options" | "keymaps"
function M.load(name) function M.load(name)
local function _load(mod) local function _load(mod)
if require("lazy.core.cache").find(mod)[1] then if require("lazy.core.cache").find(mod)[1] then
LazyVim.try(function() Util.try(function()
require(mod) require(mod)
end, { msg = "Failed loading " .. mod }) end, { msg = "Failed loading " .. mod })
end end
@ -263,23 +248,19 @@ function M.init()
end end
package.preload["lazyvim.plugins.lsp.format"] = function() package.preload["lazyvim.plugins.lsp.format"] = function()
LazyVim.deprecate([[require("lazyvim.plugins.lsp.format")]], [[LazyVim.format]]) Util.deprecate([[require("lazyvim.plugins.lsp.format")]], [[require("lazyvim.util").format]])
return LazyVim.format return Util.format
end end
-- delay notifications till vim.notify was replaced or after 500ms -- delay notifications till vim.notify was replaced or after 500ms
LazyVim.lazy_notify() require("lazyvim.util").lazy_notify()
-- load options here, before lazy init while sourcing plugin modules -- load options here, before lazy init while sourcing plugin modules
-- this is needed to make sure options will be correctly applied -- this is needed to make sure options will be correctly applied
-- after installing missing plugins -- after installing missing plugins
M.load("options") M.load("options")
if vim.g.deprecation_warnings == false then Util.plugin.setup()
vim.deprecate = function() end
end
LazyVim.plugin.setup()
M.json.load() M.json.load()
end end

View File

@ -1,47 +1,51 @@
-- This file is automatically loaded by lazyvim.config.init -- This file is automatically loaded by lazyvim.config.init
local Util = require("lazyvim.util")
-- DO NOT USE `LazyVim.safe_keymap_set` IN YOUR OWN CONFIG!! -- DO NOT USE THIS IN YOU OWN CONFIG!!
-- use `vim.keymap.set` instead -- use `vim.keymap.set` instead
local map = LazyVim.safe_keymap_set local map = Util.safe_keymap_set
-- better up/down -- better up/down
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true }) map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
map({ "n", "x" }, "<Down>", "v:count == 0 ? 'gj' : 'j'", { desc = "Down", expr = true, silent = true }) map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { desc = "Up", expr = true, silent = true })
-- Move to window using the <ctrl> hjkl keys -- Move to window using the <ctrl> hjkl keys
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true }) map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true }) map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window", remap = true }) map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window", remap = true }) map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
-- Resize window using <ctrl> arrow keys -- Resize window using <ctrl> arrow keys
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase Window Height" }) map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease Window Height" }) map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Width" }) map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" }) map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
-- Move Lines -- Move Lines
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" }) map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" }) map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move up" })
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" }) map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" })
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" }) map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" })
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" }) map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Up" }) map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
-- buffers -- buffers
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" }) if Util.has("bufferline.nvim") then
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next Buffer" }) map("n", "<S-h>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev Buffer" }) map("n", "<S-l>", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next Buffer" }) map("n", "[b", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
map("n", "]b", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
else
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
end
map("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" }) map("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
map("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" }) map("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
map("n", "<leader>bd", LazyVim.ui.bufremove, { desc = "Delete Buffer" })
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
-- Clear search with <esc> -- Clear search with <esc>
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and Clear hlsearch" }) map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
-- Clear search, diff update and redraw -- Clear search, diff update and redraw
-- taken from runtime/lua/_editor.lua -- taken from runtime/lua/_editor.lua
@ -49,16 +53,16 @@ map(
"n", "n",
"<leader>ur", "<leader>ur",
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>", "<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
{ desc = "Redraw / Clear hlsearch / Diff Update" } { desc = "Redraw / clear hlsearch / diff update" }
) )
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n -- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next Search Result" }) map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" }) map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" }) map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev Search Result" }) map("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" }) map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" }) map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
-- Add undo break-points -- Add undo break-points
map("i", ",", ",<c-g>u") map("i", ",", ",<c-g>u")
@ -66,7 +70,7 @@ map("i", ".", ".<c-g>u")
map("i", ";", ";<c-g>u") map("i", ";", ";<c-g>u")
-- save file -- save file
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save File" }) map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
--keywordprg --keywordprg
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" }) map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
@ -84,91 +88,68 @@ map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" }) map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" }) map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" }) if not Util.has("trouble.nvim") then
map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" }) map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
end
-- formatting -- formatting
map({ "n", "v" }, "<leader>cf", function() map({ "n", "v" }, "<leader>cf", function()
LazyVim.format({ force = true }) Util.format({ force = true })
end, { desc = "Format" }) end, { desc = "Format" })
-- diagnostic
local diagnostic_goto = function(next, severity)
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
severity = severity and vim.diagnostic.severity[severity] or nil
return function()
go({ severity = severity })
end
end
map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" })
map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" })
map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" })
map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" })
map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" })
map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
-- stylua: ignore start -- stylua: ignore start
-- toggle options -- toggle options
map("n", "<leader>uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" }) map("n", "<leader>uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" })
map("n", "<leader>uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" }) map("n", "<leader>uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" })
map("n", "<leader>us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" }) map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
map("n", "<leader>uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" }) map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
map("n", "<leader>uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" }) map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
map("n", "<leader>ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" }) map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" }) map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3 local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
map("n", "<leader>uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" }) map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then if vim.lsp.inlay_hint then
map( "n", "<leader>uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" }) map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
end end
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
map("n", "<leader>ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" })
-- lazygit -- lazygit
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" }) map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
map("n", "<leader>gf", function()
local git_path = vim.api.nvim_buf_get_name(0)
LazyVim.lazygit({args = { "-f", vim.trim(git_path) }})
end, { desc = "Lazygit Current File History" })
-- quit -- quit
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" }) map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
-- highlights under cursor -- highlights under cursor
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" }) map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
-- LazyVim Changelog -- LazyVim Changelog
map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" }) map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
-- floating terminal -- floating terminal
local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (Root Dir)" }) map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
map("n", "<leader>fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" }) map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
map("n", "<c-/>", lazyterm, { desc = "Terminal (Root Dir)" }) map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" }) map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
-- Terminal Mappings -- Terminal Mappings
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" }) map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to Left Window" }) map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window" })
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to Lower Window" }) map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window" })
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to Upper Window" }) map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to Right Window" }) map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" }) map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" }) map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
-- windows -- windows
map("n", "<leader>ww", "<C-W>p", { desc = "Other Window", remap = true }) map("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true }) map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
map("n", "<leader>w-", "<C-W>s", { desc = "Split Window Below", remap = true }) map("n", "<leader>w-", "<C-W>s", { desc = "Split window below", remap = true })
map("n", "<leader>w|", "<C-W>v", { desc = "Split Window Right", remap = true }) map("n", "<leader>w|", "<C-W>v", { desc = "Split window right", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true }) map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true }) map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
-- tabs -- tabs
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" }) map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })

View File

@ -2,7 +2,7 @@
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = "\\" vim.g.maplocalleader = "\\"
-- LazyVim auto format -- Enable LazyVim auto format
vim.g.autoformat = true vim.g.autoformat = true
-- LazyVim root dir detection -- LazyVim root dir detection
@ -12,43 +12,15 @@ vim.g.autoformat = true
-- * a function with signature `function(buf) -> string|string[]` -- * a function with signature `function(buf) -> string|string[]`
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
-- LazyVim automatically configures lazygit:
-- * theme, based on the active colorscheme.
-- * editorPreset to nvim-remote
-- * enables nerd font icons
-- Set to false to disable.
vim.g.lazygit_config = true
-- Optionally setup the terminal to use
-- This sets `vim.o.shell` and does some additional configuration for:
-- * pwsh
-- * powershell
-- LazyVim.terminal.setup("pwsh")
-- Hide deprecation warnings
vim.g.deprecation_warnings = false
local opt = vim.opt local opt = vim.opt
opt.autowrite = true -- Enable auto write opt.autowrite = true -- Enable auto write
-- only set clipboard if not in ssh, to make sure the OSC 52 opt.clipboard = "unnamedplus" -- Sync with system clipboard
-- integration works automatically. Requires Neovim >= 0.10.0
opt.clipboard = vim.env.SSH_TTY and "" or "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect" opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions opt.conceallevel = 3 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs opt.expandtab = true -- Use spaces instead of tabs
opt.fillchars = {
foldopen = "",
foldclose = "",
fold = " ",
foldsep = " ",
diff = "",
eob = " ",
}
opt.foldlevel = 99
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
opt.formatoptions = "jcroqlnt" -- tcqj opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m" opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep" opt.grepprg = "rg --vimgrep"
@ -62,7 +34,7 @@ opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 4 -- Lines of context opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" } opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" }
opt.shiftround = true -- Round indent opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append({ W = true, I = true, c = true, C = true }) opt.shortmess:append({ W = true, I = true, c = true, C = true })
@ -75,10 +47,9 @@ opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current opt.splitbelow = true -- Put new windows below current
opt.splitkeep = "screen" opt.splitkeep = "screen"
opt.splitright = true -- Put new windows right of current opt.splitright = true -- Put new windows right of current
opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
opt.tabstop = 2 -- Number of spaces tabs count for opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support opt.termguicolors = true -- True color support
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key opt.timeoutlen = 300
opt.undofile = true opt.undofile = true
opt.undolevels = 10000 opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold opt.updatetime = 200 -- Save swap file and trigger CursorHold
@ -86,15 +57,34 @@ opt.virtualedit = "block" -- Allow cursor to move where there is no text in visu
opt.wildmode = "longest:full,full" -- Command-line completion mode opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap opt.wrap = false -- Disable line wrap
opt.fillchars = {
foldopen = "",
foldclose = "",
-- fold = "⸱",
fold = " ",
foldsep = " ",
diff = "",
eob = " ",
}
if vim.fn.has("nvim-0.10") == 1 then if vim.fn.has("nvim-0.10") == 1 then
opt.smoothscroll = true opt.smoothscroll = true
opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" end
opt.foldmethod = "expr"
opt.foldtext = "" -- Folding
vim.opt.foldlevel = 99
vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
if vim.fn.has("nvim-0.9.0") == 1 then
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
end
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
if vim.fn.has("nvim-0.10") == 1 then
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
else else
opt.foldmethod = "indent" vim.opt.foldmethod = "indent"
opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
end end
-- Fix markdown indentation settings -- Fix markdown indentation settings

View File

@ -10,9 +10,6 @@ function M.check()
if vim.fn.has("nvim-0.9.0") == 1 then if vim.fn.has("nvim-0.9.0") == 1 then
ok("Using Neovim >= 0.9.0") ok("Using Neovim >= 0.9.0")
if vim.fn.has("nvim-0.10.0") == 0 then
warn("Use Neovim >= 0.10.0 for the best experience")
end
else else
error("Neovim >= 0.9.0 is required") error("Neovim >= 0.9.0 is required")
end end

View File

@ -1,5 +1,3 @@
vim.uv = vim.uv or vim.loop
local M = {} local M = {}
---@param opts? LazyVimConfig ---@param opts? LazyVimConfig

File diff suppressed because it is too large Load Diff

View File

@ -14,19 +14,14 @@ return {
name = "catppuccin", name = "catppuccin",
opts = { opts = {
integrations = { integrations = {
aerial = true,
alpha = true, alpha = true,
cmp = true, cmp = true,
dashboard = true,
flash = true, flash = true,
gitsigns = true, gitsigns = true,
headlines = true,
illuminate = true, illuminate = true,
indent_blankline = { enabled = true }, indent_blankline = { enabled = true },
leap = true,
lsp_trouble = true, lsp_trouble = true,
mason = true, mason = true,
markdown = true,
mini = true, mini = true,
native_lsp = { native_lsp = {
enabled = true, enabled = true,
@ -39,13 +34,12 @@ return {
}, },
navic = { enabled = true, custom_bg = "lualine" }, navic = { enabled = true, custom_bg = "lualine" },
neotest = true, neotest = true,
neotree = true,
noice = true, noice = true,
notify = true, notify = true,
neotree = true,
semantic_tokens = true, semantic_tokens = true,
telescope = true, telescope = true,
treesitter = true, treesitter = true,
treesitter_context = true,
which_key = true, which_key = true,
}, },
}, },

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,43 @@ return {
optional = true, optional = true,
event = "VeryLazy", event = "VeryLazy",
opts = function(_, opts) opts = function(_, opts)
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium")) local started = false
local function status()
if not package.loaded["cmp"] then
return
end
for _, s in ipairs(require("cmp").core.sources) do
if s.name == "codeium" then
if s.source:is_available() then
started = true
else
return started and "error" or nil
end
if s.status == s.SourceStatus.FETCHING then
return "pending"
end
return "ok"
end
end
end
local Util = require("lazyvim.util")
local colors = {
ok = Util.ui.fg("Special"),
error = Util.ui.fg("DiagnosticError"),
pending = Util.ui.fg("DiagnosticWarn"),
}
table.insert(opts.sections.lualine_x, 2, {
function()
return require("lazyvim.config").icons.kinds.Codeium
end,
cond = function()
return status() ~= nil
end,
color = function()
return colors[status()] or colors.ok
end,
})
end, end,
}, },
} }

View File

@ -1,5 +1,5 @@
return { return {
recommended = true,
-- copilot -- copilot
{ {
"zbirenbaum/copilot.lua", "zbirenbaum/copilot.lua",
@ -19,11 +19,12 @@ return {
optional = true, optional = true,
event = "VeryLazy", event = "VeryLazy",
opts = function(_, opts) opts = function(_, opts)
local Util = require("lazyvim.util")
local colors = { local colors = {
[""] = LazyVim.ui.fg("Special"), [""] = Util.ui.fg("Special"),
["Normal"] = LazyVim.ui.fg("Special"), ["Normal"] = Util.ui.fg("Special"),
["Warning"] = LazyVim.ui.fg("DiagnosticError"), ["Warning"] = Util.ui.fg("DiagnosticError"),
["InProgress"] = LazyVim.ui.fg("DiagnosticWarn"), ["InProgress"] = Util.ui.fg("DiagnosticWarn"),
} }
table.insert(opts.sections.lualine_x, 2, { table.insert(opts.sections.lualine_x, 2, {
function() function()
@ -35,7 +36,7 @@ return {
if not package.loaded["copilot"] then if not package.loaded["copilot"] then
return return
end end
local ok, clients = pcall(LazyVim.lsp.get_clients, { name = "copilot", bufnr = 0 }) local ok, clients = pcall(require("lazyvim.util").lsp.get_clients, { name = "copilot", bufnr = 0 })
if not ok then if not ok then
return false return false
end end
@ -65,7 +66,7 @@ return {
copilot_cmp.setup(opts) copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches -- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source -- fixes lazy-loading issues with the copilot cmp source
LazyVim.lsp.on_attach(function(client) require("lazyvim.util").lsp.on_attach(function(client)
if client.name == "copilot" then if client.name == "copilot" then
copilot_cmp._on_insert_enter({}) copilot_cmp._on_insert_enter({})
end end

View File

@ -1,44 +0,0 @@
return {
"L3MON4D3/LuaSnip",
build = (not LazyVim.is_win())
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
dependencies = {
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
{
"nvim-cmp",
dependencies = {
"saadparwaiz1/cmp_luasnip",
},
opts = function(_, opts)
opts.snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
}
table.insert(opts.sources, { name = "luasnip" })
end,
},
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
}

View File

@ -1,13 +0,0 @@
return {
{
"echasnovski/mini.comment",
event = "VeryLazy",
opts = {
options = {
custom_commentstring = function()
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
end,
},
},
},
}

View File

@ -1,36 +0,0 @@
-- Fast and feature-rich surround actions. For text that includes
-- surrounding characters like brackets or quotes, this allows you
-- to select the text inside, change or modify the surrounding characters,
-- and more.
return {
"echasnovski/mini.surround",
recommended = true,
keys = function(_, keys)
-- Populate the keys based on the user's options
local opts = LazyVim.opts("mini.surround")
local mappings = {
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
{ opts.mappings.delete, desc = "Delete Surrounding" },
{ opts.mappings.find, desc = "Find Right Surrounding" },
{ opts.mappings.find_left, desc = "Find Left Surrounding" },
{ opts.mappings.highlight, desc = "Highlight Surrounding" },
{ opts.mappings.replace, desc = "Replace Surrounding" },
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
}
mappings = vim.tbl_filter(function(m)
return m[1] and #m[1] > 0
end, mappings)
return vim.list_extend(mappings, keys)
end,
opts = {
mappings = {
add = "gsa", -- Add surrounding in Normal and Visual modes
delete = "gsd", -- Delete surrounding
find = "gsf", -- Find surrounding (to the right)
find_left = "gsF", -- Find surrounding (to the left)
highlight = "gsh", -- Highlight surrounding
replace = "gsr", -- Replace surrounding
update_n_lines = "gsn", -- Update `n_lines`
},
},
}

View File

@ -1,49 +0,0 @@
return {
-- Tabnine cmp source
{
"nvim-cmp",
dependencies = {
{
"tzachar/cmp-tabnine",
build = {
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
":CmpTabnineHub",
},
dependencies = "hrsh7th/nvim-cmp",
opts = {
max_lines = 1000,
max_num_results = 3,
sort = true,
},
config = function(_, opts)
require("cmp_tabnine.config"):setup(opts)
end,
},
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, 1, {
name = "cmp_tabnine",
group_index = 1,
priority = 100,
})
opts.formatting.format = LazyVim.inject.args(opts.formatting.format, function(entry, item)
-- Hide percentage in the menu
if entry.source.name == "cmp_tabnine" then
item.menu = ""
end
end)
end,
},
-- Show TabNine status in lualine
{
"nvim-lualine/lualine.nvim",
optional = true,
event = "VeryLazy",
opts = function(_, opts)
local icon = require("lazyvim.config").icons.kinds.TabNine
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("cmp_tabnine", icon))
end,
},
}

View File

@ -1,30 +1,32 @@
-- better yank/paste
return { return {
"gbprod/yanky.nvim", -- better yank/paste
recommended = true, {
desc = "Better Yank/Paste", "gbprod/yanky.nvim",
opts = { dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find("Windows") } },
highlight = { timer = 150 }, opts = {
}, highlight = { timer = 250 },
keys = { ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" },
},
keys = {
-- stylua: ignore -- stylua: ignore
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" }, { "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, { "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank text" },
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" }, { "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" },
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" }, { "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" },
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" }, { "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" },
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" }, { "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" },
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" }, { "[y", "<Plug>(YankyCycleForward)", desc = "Cycle forward through yank history" },
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" }, { "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle backward through yank history" },
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, { "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, { "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, { "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" }, { "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" }, { ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" },
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" }, { "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" },
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" }, { ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" },
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" }, { "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" },
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" }, { "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put after applying a filter" },
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" }, { "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put before applying a filter" },
},
}, },
} }

View File

@ -12,15 +12,12 @@ end
return { return {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
recommended = true,
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
dependencies = { dependencies = {
-- fancy UI for the debugger -- fancy UI for the debugger
{ {
"rcarriga/nvim-dap-ui", "rcarriga/nvim-dap-ui",
dependencies = { "nvim-neotest/nvim-nio" },
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, { "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
@ -28,6 +25,8 @@ return {
}, },
opts = {}, opts = {},
config = function(_, opts) config = function(_, opts)
-- setup dap config by VsCode launch.json file
-- require("dap.ext.vscode").load_launchjs()
local dap = require("dap") local dap = require("dap")
local dapui = require("dapui") local dapui = require("dapui")
dapui.setup(opts) dapui.setup(opts)
@ -81,11 +80,6 @@ return {
}, },
}, },
}, },
-- VsCode launch.json parser
{
"folke/neoconf.nvim",
},
}, },
-- stylua: ignore -- stylua: ignore
@ -95,7 +89,7 @@ return {
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" }, { "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" }, { "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" }, { "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" }, { "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" }, { "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dj", function() require("dap").down() end, desc = "Down" }, { "<leader>dj", function() require("dap").down() end, desc = "Down" },
{ "<leader>dk", function() require("dap").up() end, desc = "Up" }, { "<leader>dk", function() require("dap").up() end, desc = "Up" },
@ -120,18 +114,5 @@ return {
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] } { text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
) )
end end
-- setup dap config by VsCode launch.json file
local vscode = require("dap.ext.vscode")
local _filetypes = require("mason-nvim-dap.mappings.filetypes")
local filetypes = vim.tbl_deep_extend("force", _filetypes, {
["node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" },
["pwa-node"] = { "javascriptreact", "typescriptreact", "typescript", "javascript" },
})
local json = require("plenary.json")
vscode.json_decode = function(str)
return vim.json.decode(json.json_strip_comments(str))
end
vscode.load_launchjs(nil, filetypes)
end, end,
} }

View File

@ -1,11 +1,23 @@
local Config = require("lazyvim.config") local Config = require("lazyvim.config")
local Util = require("lazyvim.util")
return { return {
desc = "Aerial Symbol Browser",
{ {
"stevearc/aerial.nvim", "stevearc/aerial.nvim",
event = "LazyFile", event = "LazyFile",
opts = function() opts = function()
---@diagnostic disable-next-line: no-unknown
local lualine = require("lualine.components.aerial")
-- Strip trailing spaces from symbols in statusline
---@param _ any
---@param symbols {icon?:string}[]
lualine.format_status = Util.inject.args(lualine.format_status, function(_, symbols)
for _, s in ipairs(symbols) do
s.icon = s.icon and s.icon:gsub("%s*$", "") or nil
end
end)
local icons = vim.deepcopy(Config.icons.kinds) local icons = vim.deepcopy(Config.icons.kinds)
-- HACK: fix lua's weird choice for `Package` for control -- HACK: fix lua's weird choice for `Package` for control
@ -54,7 +66,7 @@ return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
optional = true, optional = true,
opts = function() opts = function()
LazyVim.on_load("telescope.nvim", function() Util.on_load("telescope.nvim", function()
require("telescope").load_extension("aerial") require("telescope").load_extension("aerial")
end) end)
end, end,
@ -72,11 +84,11 @@ return {
"folke/edgy.nvim", "folke/edgy.nvim",
optional = true, optional = true,
opts = function(_, opts) opts = function(_, opts)
local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy") local edgy_idx = Util.plugin.extra_idx("ui.edgy")
local aerial_idx = LazyVim.plugin.extra_idx("editor.aerial") local aerial_idx = Util.plugin.extra_idx("editor.aerial")
if edgy_idx and edgy_idx > aerial_idx then if edgy_idx and edgy_idx > aerial_idx then
LazyVim.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", { Util.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", {
title = "LazyVim", title = "LazyVim",
}) })
end end
@ -98,8 +110,8 @@ return {
opts = function(_, opts) opts = function(_, opts)
table.insert(opts.sections.lualine_c, { table.insert(opts.sections.lualine_c, {
"aerial", "aerial",
sep = " ", -- separator between symbols -- The separator to be used to separate symbols in status line.
sep_icon = "", -- separator between icon and symbol sep = " ",
-- The number of symbols to render top-down. In order to render only 'N' last -- The number of symbols to render top-down. In order to render only 'N' last
-- symbols, negative numbers may be supplied. For instance, 'depth = -1' can -- symbols, negative numbers may be supplied. For instance, 'depth = -1' can

View File

@ -1,175 +0,0 @@
local M = {}
---@type table<string, table<string, string[]>>
M.dials_by_ft = {}
---@param increment boolean
---@param g? boolean
function M.dial(increment, g)
local mode = vim.fn.mode(true)
-- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22'
local is_visual = mode == "v" or mode == "V" or mode == "\22"
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
local group = M.dials_by_ft[vim.bo.filetype] or "default"
return require("dial.map")[func](group)
end
return {
"monaqa/dial.nvim",
recommended = true,
desc = "Increment and decrement numbers, dates, and more",
-- stylua: ignore
keys = {
{ "<C-a>", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
{ "<C-x>", function() return M.dial(false) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
{ "g<C-a>", function() return M.dial(true, true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
{ "g<C-x>", function() return M.dial(false, true) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
},
opts = function()
local augend = require("dial.augend")
local logical_alias = augend.constant.new({
elements = { "&&", "||" },
word = false,
cyclic = true,
})
local ordinal_numbers = augend.constant.new({
-- elements through which we cycle. When we increment, we go down
-- On decrement we go up
elements = {
"first",
"second",
"third",
"fourth",
"fifth",
"sixth",
"seventh",
"eighth",
"ninth",
"tenth",
},
-- if true, it only matches strings with word boundary. firstDate wouldn't work for example
word = false,
-- do we cycle back and forth (tenth to first on increment, first to tenth on decrement).
-- Otherwise nothing will happen when there are no further values
cyclic = true,
})
local weekdays = augend.constant.new({
elements = {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
},
word = true,
cyclic = true,
})
local months = augend.constant.new({
elements = {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
},
word = true,
cyclic = true,
})
local capitalized_boolean = augend.constant.new({
elements = {
"True",
"False",
},
word = true,
cyclic = true,
})
return {
dials_by_ft = {
css = "css",
javascript = "typescript",
javascriptreact = "typescript",
json = "json",
lua = "lua",
markdown = "markdown",
python = "python",
sass = "css",
scss = "css",
typescript = "typescript",
typescriptreact = "typescript",
},
groups = {
default = {
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
},
typescript = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.constant.alias.bool, -- boolean value (true <-> false)
logical_alias,
augend.constant.new({ elements = { "let", "const" } }),
ordinal_numbers,
weekdays,
months,
},
css = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.hexcolor.new({
case = "lower",
}),
augend.hexcolor.new({
case = "upper",
}),
},
markdown = {
augend.misc.alias.markdown_header,
ordinal_numbers,
weekdays,
months,
},
json = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.semver.alias.semver, -- versioning (v1.1.2)
},
lua = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.constant.alias.bool, -- boolean value (true <-> false)
augend.constant.new({
elements = { "and", "or" },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
cyclic = true, -- "or" is incremented into "and".
}),
ordinal_numbers,
weekdays,
months,
},
python = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
capitalized_boolean,
logical_alias,
ordinal_numbers,
weekdays,
months,
},
},
}
end,
config = function(_, opts)
require("dial.config").augends:register_group(opts.groups)
M.dials_by_ft = opts.dials_by_ft
end,
}

View File

@ -1,42 +0,0 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
opts = {
menu = {
width = vim.api.nvim_win_get_width(0) - 4,
},
settings = {
save_on_toggle = true,
},
},
keys = function()
local keys = {
{
"<leader>H",
function()
require("harpoon"):list():add()
end,
desc = "Harpoon File",
},
{
"<leader>h",
function()
local harpoon = require("harpoon")
harpoon.ui:toggle_quick_menu(harpoon:list())
end,
desc = "Harpoon Quick Menu",
},
}
for i = 1, 5 do
table.insert(keys, {
"<leader>" .. i,
function()
require("harpoon"):list():select(i)
end,
desc = "Harpoon to File " .. i,
})
end
return keys
end,
}

View File

@ -1,45 +0,0 @@
-- Automatically highlights other instances of the word under your cursor.
-- This works with LSP, Treesitter, and regexp matching to find the other
-- instances.
return {
{
"RRethy/vim-illuminate",
event = "LazyFile",
opts = {
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { "lsp" },
},
},
config = function(_, opts)
require("illuminate").configure(opts)
local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
end
map("]]", "next")
map("[[", "prev")
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
callback = function()
local buffer = vim.api.nvim_get_current_buf()
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end,
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
{
"neovim/nvim-lspconfig",
opts = { document_highlight = { enabed = false } },
},
}

View File

@ -20,9 +20,9 @@ return {
"ggandor/leap.nvim", "ggandor/leap.nvim",
enabled = true, enabled = true,
keys = { keys = {
{ "s", mode = { "n", "x", "o" }, desc = "Leap Forward to" }, { "s", mode = { "n", "x", "o" }, desc = "Leap forward to" },
{ "S", mode = { "n", "x", "o" }, desc = "Leap Backward to" }, { "S", mode = { "n", "x", "o" }, desc = "Leap backward to" },
{ "gs", mode = { "n", "x", "o" }, desc = "Leap from Windows" }, { "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" },
}, },
config = function(_, opts) config = function(_, opts)
local leap = require("leap") local leap = require("leap")
@ -38,7 +38,6 @@ return {
-- rename surround mappings from gs to gz to prevent conflict with leap -- rename surround mappings from gs to gz to prevent conflict with leap
{ {
"echasnovski/mini.surround", "echasnovski/mini.surround",
optional = true,
opts = { opts = {
mappings = { mappings = {
add = "gza", -- Add surrounding in Normal and Visual modes add = "gza", -- Add surrounding in Normal and Visual modes
@ -51,15 +50,6 @@ return {
}, },
}, },
}, },
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["gz"] = { name = "+surround" },
},
},
},
-- makes some plugins dot-repeatable like leap -- makes some plugins dot-repeatable like leap
{ "tpope/vim-repeat", event = "VeryLazy" }, { "tpope/vim-repeat", event = "VeryLazy" },

View File

@ -1,54 +0,0 @@
return {
-- disable gitsigns.nvim
{
"lewis6991/gitsigns.nvim",
enabled = false,
},
-- setup mini.diff
{
"echasnovski/mini.diff",
event = "VeryLazy",
keys = {
{
"<leader>go",
function()
require("mini.diff").toggle_overlay(0)
end,
desc = "Toggle mini.diff overlay",
},
},
opts = {
view = {
style = "sign",
signs = {
add = "",
change = "",
delete = "",
},
},
},
},
-- lualine integration
{
"nvim-lualine/lualine.nvim",
opts = function(_, opts)
local x = opts.sections.lualine_x
for _, comp in ipairs(x) do
if comp[1] == "diff" then
comp.source = function()
local summary = vim.b.minidiff_summary
return summary
and {
added = summary.add,
modified = summary.change,
removed = summary.delete,
}
end
break
end
end
end,
},
}

View File

@ -18,12 +18,12 @@ return {
function() function()
require("mini.files").open(vim.api.nvim_buf_get_name(0), true) require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
end, end,
desc = "Open mini.files (Directory of Current File)", desc = "Open mini.files (directory of current file)",
}, },
{ {
"<leader>fM", "<leader>fM",
function() function()
require("mini.files").open(vim.uv.cwd(), true) require("mini.files").open(vim.loop.cwd(), true)
end, end,
desc = "Open mini.files (cwd)", desc = "Open mini.files (cwd)",
}, },
@ -50,14 +50,14 @@ return {
callback = function(args) callback = function(args)
local buf_id = args.data.buf_id local buf_id = args.data.buf_id
-- Tweak left-hand side of mapping to your liking -- Tweak left-hand side of mapping to your liking
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id, desc = "Toggle Hidden Files" }) vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id })
end, end,
}) })
vim.api.nvim_create_autocmd("User", { vim.api.nvim_create_autocmd("User", {
pattern = "MiniFilesActionRename", pattern = "MiniFilesActionRename",
callback = function(event) callback = function(event)
LazyVim.lsp.on_rename(event.data.from, event.data.to) require("lazyvim.util").lsp.on_rename(event.data.from, event.data.to)
end, end,
}) })
end, end,

View File

@ -1,7 +0,0 @@
return {
{
"echasnovski/mini.move",
event = "VeryLazy",
opts = {},
},
}

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