Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
4d596cf4b4 | |||
86dc548ff9 | |||
fc2eae5faf | |||
4df9392cb8 | |||
b873f9a7e7 | |||
59615281f8 | |||
f198eef6e5 | |||
9c31004365 | |||
0bb1da6d57 | |||
2786fdb6e2 | |||
a07db1a723 | |||
0352f944c3 | |||
33557ae68b | |||
6dcf5d7159 | |||
5c5ae903c9 | |||
af9553135d | |||
704c29110d | |||
1db2af267e | |||
1c5a330b6b | |||
b8407f4b12 | |||
8235126a32 | |||
767d873f93 | |||
ffce089a9f | |||
7a1414b5e5 | |||
bb289f4345 | |||
bbd5c8a771 | |||
07a046867d | |||
ad3e2b6354 | |||
c0b623c332 | |||
deb9fd85b1 | |||
86b2c23e2a | |||
e50b43544f | |||
3ac62a4364 | |||
1d7b9a1a61 | |||
0819f9396e | |||
5e485d39b4 | |||
a7eca05609 | |||
c1e8e3c80d | |||
b98b048ec6 | |||
5df382765b | |||
ea266e7326 | |||
0137a110c1 | |||
fbf881f80b | |||
c22db72435 | |||
06071dd452 | |||
dcab30f242 | |||
17a1b846f0 | |||
86904d2fb1 | |||
309d189448 |
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "13.1.0"
|
||||
".": "13.5.2"
|
||||
}
|
||||
|
105
CHANGELOG.md
105
CHANGELOG.md
@ -1,5 +1,110 @@
|
||||
# Changelog
|
||||
|
||||
## [13.5.2](https://github.com/LazyVim/LazyVim/compare/v13.5.1...v13.5.2) (2024-11-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **keymaps:** `gitbrowse` also in Visual mode ([#4818](https://github.com/LazyVim/LazyVim/issues/4818)) ([86dc548](https://github.com/LazyVim/LazyVim/commit/86dc548ff9564a37524c2f9259eeb8603a70d5d5))
|
||||
|
||||
## [13.5.1](https://github.com/LazyVim/LazyVim/compare/v13.5.0...v13.5.1) (2024-11-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **copilot:** work-around to get copilot working again on nightly ([5961528](https://github.com/LazyVim/LazyVim/commit/59615281f80f68fb91a9e428835c8164a6a6f99f))
|
||||
* **extras:** add blink.cmp integration for SQL extra ([#4833](https://github.com/LazyVim/LazyVim/issues/4833)) ([0bb1da6](https://github.com/LazyVim/LazyVim/commit/0bb1da6d57a32495ed4159f8933d074674066d20))
|
||||
* **snacks:** alignment of header ([4df9392](https://github.com/LazyVim/LazyVim/commit/4df9392cb8c597193411b668d49a3882941e816b))
|
||||
* **snacks:** cleaner way to adjust keys preset ([9c31004](https://github.com/LazyVim/LazyVim/commit/9c310043657fc11db0946ca4a328f29941b72b02))
|
||||
* **snacks:** make sure early notifications show up in noice ([b873f9a](https://github.com/LazyVim/LazyVim/commit/b873f9a7e7ca77f329b40b17741ee244520a1306))
|
||||
|
||||
## [13.5.0](https://github.com/LazyVim/LazyVim/compare/v13.4.0...v13.5.0) (2024-11-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **copilot-chat:** remove call to nvim-cmp integration ([#4822](https://github.com/LazyVim/LazyVim/issues/4822)) ([af95531](https://github.com/LazyVim/LazyVim/commit/af9553135da3c42ff83824db0f9dfaaa9ad5973f))
|
||||
* **snacks:** use `snacks.dashboard` as the default dashboard. moved `dashboard-nvim` to extras ([#4832](https://github.com/LazyVim/LazyVim/issues/4832)) ([a07db1a](https://github.com/LazyVim/LazyVim/commit/a07db1a72334bf6550683d5f9132d806febed1cd))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lualine:** dont show statusline on snacks_dashboard ([33557ae](https://github.com/LazyVim/LazyVim/commit/33557ae68b76954df0288603f39b3f0181bada52))
|
||||
* **tabnine:** dont call CmpTabnineHub in build. Fixes [#4828](https://github.com/LazyVim/LazyVim/issues/4828) ([6dcf5d7](https://github.com/LazyVim/LazyVim/commit/6dcf5d7159d13a21d3148779b5b80048573fcdf1))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **ui:** never show folds on dashboards ([0352f94](https://github.com/LazyVim/LazyVim/commit/0352f944c34a3aa8a949102a2fe2ded7a1da3cd0))
|
||||
|
||||
## [13.4.0](https://github.com/LazyVim/LazyVim/compare/v13.3.1...v13.4.0) (2024-11-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **blink:** auto-enable catppuccin integration ([#4799](https://github.com/LazyVim/LazyVim/issues/4799)) ([ffce089](https://github.com/LazyVim/LazyVim/commit/ffce089a9f1268ff73c7de7c4f45e1a366dc4d34))
|
||||
* **copilot-chat:** remove deprecated options ([#4802](https://github.com/LazyVim/LazyVim/issues/4802)) ([7a1414b](https://github.com/LazyVim/LazyVim/commit/7a1414b5e5950bde34b9bdc0dbc3dd20109f2ac9))
|
||||
* **dial:** support vue filetype ([#4785](https://github.com/LazyVim/LazyVim/issues/4785)) ([8235126](https://github.com/LazyVim/LazyVim/commit/8235126a321eaae093f319398ffec5949f1ab8be))
|
||||
* **extras:** add biome formatter ([#4448](https://github.com/LazyVim/LazyVim/issues/4448)) ([b8407f4](https://github.com/LazyVim/LazyVim/commit/b8407f4b128891c3bdf35a2c403ba23d1e01f3ff))
|
||||
* **vscode:** automatically enable the vscode extra when running in vscode ([1c5a330](https://github.com/LazyVim/LazyVim/commit/1c5a330b6be8007088d84361fee5d2b08771598c))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **terminal:** set shellcmdflags for powershell to recommended values. Closes [#4805](https://github.com/LazyVim/LazyVim/issues/4805) ([1db2af2](https://github.com/LazyVim/LazyVim/commit/1db2af267eeb9046550ac29bd543f3b3021cdd7b))
|
||||
|
||||
## [13.3.1](https://github.com/LazyVim/LazyVim/compare/v13.3.0...v13.3.1) (2024-11-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **copilot:** don't enable blink when using copilot when blink is not installed. Fixes [#4795](https://github.com/LazyVim/LazyVim/issues/4795) ([07a0468](https://github.com/LazyVim/LazyVim/commit/07a046867dc3407b30801e539ab026fb7c180e7b))
|
||||
|
||||
## [13.3.0](https://github.com/LazyVim/LazyVim/compare/v13.2.0...v13.3.0) (2024-11-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **copilot:** added support for blink.cmp source ([a7eca05](https://github.com/LazyVim/LazyVim/commit/a7eca056096486b20ce37b20979c0d712e49fe76))
|
||||
* **extras:** add supermaven ([#3491](https://github.com/LazyVim/LazyVim/issues/3491)) ([c1e8e3c](https://github.com/LazyVim/LazyVim/commit/c1e8e3c80d1d9d44e3795022b3f7d2703abccec6))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dial.nvim:** added boolean and logical toggles to default group. Fixes [#4515](https://github.com/LazyVim/LazyVim/issues/4515) ([5e485d3](https://github.com/LazyVim/LazyVim/commit/5e485d39b4cc5aca1aedae4d441fb2bfb3bfbf67))
|
||||
* **fzf:** decouple `defaults` from `opts` to easy switch profiles ([#4190](https://github.com/LazyVim/LazyVim/issues/4190)) ([0819f93](https://github.com/LazyVim/LazyVim/commit/0819f9396e94a4188522b6739ade3d6024d2b8a7))
|
||||
* **lsp:** wrap signature_help ([#4791](https://github.com/LazyVim/LazyVim/issues/4791)) ([deb9fd8](https://github.com/LazyVim/LazyVim/commit/deb9fd85b150e50053e127f94f3df6273a9f5faf))
|
||||
* **lualine:** dynamically fetch the color used in lualine ([#4788](https://github.com/LazyVim/LazyVim/issues/4788)) ([e50b435](https://github.com/LazyVim/LazyVim/commit/e50b43544f1261d140bc391a9a1de6e3923b490d))
|
||||
* **lualine:** normalize paths before calculating pretty path. Fixes [#4763](https://github.com/LazyVim/LazyVim/issues/4763) ([ea266e7](https://github.com/LazyVim/LazyVim/commit/ea266e73265e32183acbec0bd39f8108e213770f))
|
||||
* **snacks:** explicitely enable snakcs plugins ([c0b623c](https://github.com/LazyVim/LazyVim/commit/c0b623c332b42b3d75e78e06fa1912417bfca71f))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **treesitter:** better foldtext and foldexpr ([1d7b9a1](https://github.com/LazyVim/LazyVim/commit/1d7b9a1a61596a61019d5d84be9ed679d90c4a38))
|
||||
|
||||
## [13.2.0](https://github.com/LazyVim/LazyVim/compare/v13.1.0...v13.2.0) (2024-11-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ai:** better completion/suggestions of AI engines ([#4752](https://github.com/LazyVim/LazyVim/issues/4752)) ([fbf881f](https://github.com/LazyVim/LazyVim/commit/fbf881f80b8f0fb2d9e4bc69d04f66323b25c4b9))
|
||||
* **ai:** move ai related extras from `coding` to `ai` ([#4751](https://github.com/LazyVim/LazyVim/issues/4751)) ([86904d2](https://github.com/LazyVim/LazyVim/commit/86904d2fb1ef406386b2dad43f42756e09b28182))
|
||||
* **keymaps:** leader-bo to close other buffers ([24665fc](https://github.com/LazyVim/LazyVim/commit/24665fc73651970e5a1e20a63d6031bd99b97637))
|
||||
* **rest:** add more keymaps to util.rest ([#4467](https://github.com/LazyVim/LazyVim/issues/4467)) ([c22db72](https://github.com/LazyVim/LazyVim/commit/c22db724351bc7a05c56046c48d23a2be8efe71b))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extras:** fix alpha-nvim non-string keycodes ([#4735](https://github.com/LazyVim/LazyVim/issues/4735)) ([9c9e650](https://github.com/LazyVim/LazyVim/commit/9c9e650530dcd211afd5a8b7f5e3e33e44abd11b))
|
||||
* **snacks:** allow overriding `statuscolumn` through `options.lua` ([17a1b84](https://github.com/LazyVim/LazyVim/commit/17a1b846f08db62e3a93c76426db4017ad3cc2eb))
|
||||
* **vscode:** added snacks.nvim to allowed plugins for vscode. Fixes [#4757](https://github.com/LazyVim/LazyVim/issues/4757) ([06071dd](https://github.com/LazyVim/LazyVim/commit/06071dd452baf1e9b8b5aab140553c4f51fa522e))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **ui:** only enable treesitter folds if the buffer has treesitter highlighting ([b9dae57](https://github.com/LazyVim/LazyVim/commit/b9dae579612ccf1cd749150ff1603ff6dffc2610))
|
||||
|
||||
## [13.1.0](https://github.com/LazyVim/LazyVim/compare/v13.0.0...v13.1.0) (2024-11-09)
|
||||
|
||||
|
||||
|
7
NEWS.md
7
NEWS.md
@ -2,6 +2,13 @@
|
||||
|
||||
## 13.x
|
||||
|
||||
- **LazyVim** now uses `Snacks.dashboard` as the default dashboard.
|
||||
Check the [docs](https://github.com/folke/snacks.nvim/blob/main/docs/dashboard.md),
|
||||
for more information and examples.
|
||||
|
||||
- A new [dashboard-nvim](https://github.com/nvimdev/dashboard-nvim) extra
|
||||
is available for those who prefer the old dashboard.
|
||||
|
||||
- Big new release with a lot of changes and improvements!
|
||||
|
||||
- The biggest change is the move of a bunch of core features to
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim Last change: 2024 November 09
|
||||
*LazyVim.txt* For Neovim Last change: 2024 November 19
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
||||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "13.1.0" -- x-release-please-version
|
||||
M.version = "13.5.2" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
@ -88,6 +88,7 @@ local defaults = {
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
Supermaven = " ",
|
||||
TabNine = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
|
@ -139,7 +139,7 @@ if vim.fn.executable("lazygit") == 1 then
|
||||
map("n", "<leader>gg", function() Snacks.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||
map("n", "<leader>gG", function() Snacks.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||
map("n", "<leader>gb", function() Snacks.git.blame_line() end, { desc = "Git Blame Line" })
|
||||
map("n", "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse" })
|
||||
map({ "n", "x" }, "<leader>gB", function() Snacks.gitbrowse() end, { desc = "Git Browse" })
|
||||
map("n", "<leader>gf", function() Snacks.lazygit.log_file() end, { desc = "Lazygit Current File History" })
|
||||
map("n", "<leader>gl", function() Snacks.lazygit.log({ cwd = LazyVim.root.git() }) end, { desc = "Lazygit Log" })
|
||||
map("n", "<leader>gL", function() Snacks.lazygit.log() end, { desc = "Lazygit Log (cwd)" })
|
||||
@ -180,3 +180,13 @@ map("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
|
||||
map("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
|
||||
map("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
|
||||
map("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
|
||||
|
||||
-- native snippets. only needed on < 0.11, as 0.11 creates these by default
|
||||
if vim.fn.has("nvim-0.11") == 0 then
|
||||
map("s", "<Tab>", function()
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
||||
end, { expr = true, desc = "Jump Next" })
|
||||
map({ "i", "s" }, "<S-Tab>", function()
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
|
||||
end, { expr = true, desc = "Jump Previous" })
|
||||
end
|
||||
|
@ -11,6 +11,10 @@ vim.g.autoformat = true
|
||||
-- enabled with `:LazyExtras`
|
||||
vim.g.lazyvim_picker = "auto"
|
||||
|
||||
-- if the completion engine supports the AI source,
|
||||
-- use that instead of inline suggestions
|
||||
vim.g.ai_cmp = true
|
||||
|
||||
-- LazyVim root dir detection
|
||||
-- Each entry can be:
|
||||
-- * the name of a detector function like `lsp` or `cwd`
|
||||
@ -85,6 +89,7 @@ opt.spelllang = { "en" }
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitkeep = "screen"
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.statuscolumn = [[%!v:lua.require'snacks.statuscolumn'.get()]]
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = vim.g.vscode and 1000 or 300 -- Lower than default (1000) to quickly trigger which-key
|
||||
|
@ -43,6 +43,9 @@ return {
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
["<tab>"] = function(fallback)
|
||||
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
@ -72,9 +75,10 @@ return {
|
||||
end,
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = {
|
||||
-- only show ghost text when we show ai completions
|
||||
ghost_text = vim.g.ai_cmp and {
|
||||
hl_group = "CmpGhostText",
|
||||
},
|
||||
} or false,
|
||||
},
|
||||
sorting = defaults.sorting,
|
||||
}
|
||||
@ -105,17 +109,6 @@ return {
|
||||
table.insert(opts.sources, { name = "snippets" })
|
||||
end
|
||||
end,
|
||||
init = function()
|
||||
-- Neovim enabled snippet navigation mappings by default in v0.11
|
||||
if vim.fn.has("nvim-0.11") == 0 then
|
||||
vim.keymap.set({ "i", "s" }, "<Tab>", function()
|
||||
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
|
||||
end, { expr = true, silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
|
||||
end, { expr = true, silent = true })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- auto pairs
|
||||
|
@ -1,18 +1,42 @@
|
||||
return {
|
||||
|
||||
-- codeium
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
cmd = "Codeium",
|
||||
build = ":Codeium Auth",
|
||||
opts = {
|
||||
enable_cmp_source = vim.g.ai_cmp,
|
||||
virtual_text = {
|
||||
enabled = not vim.g.ai_cmp,
|
||||
key_bindings = {
|
||||
accept = false, -- handled by nvim-cmp / blink.cmp
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add ai_accept action
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
opts = function()
|
||||
LazyVim.cmp.actions.ai_accept = function()
|
||||
if require("codeium.virtual_text").get_current_completion_item() then
|
||||
LazyVim.create_undo()
|
||||
vim.api.nvim_input(require("codeium.virtual_text").accept())
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- codeium cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
-- codeium
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
cmd = "Codeium",
|
||||
build = ":Codeium Auth",
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
optional = true,
|
||||
dependencies = { "codeium.nvim" },
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "codeium",
|
||||
@ -30,4 +54,18 @@ return {
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium"))
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
opts = {
|
||||
sources = {
|
||||
compat = vim.g.ai_cmp and { "codeium" } or nil,
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"codeium.nvim",
|
||||
vim.g.ai_cmp and "saghen/blink.compat" or nil,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -24,16 +24,11 @@ return {
|
||||
user = user:sub(1, 1):upper() .. user:sub(2)
|
||||
return {
|
||||
auto_insert_mode = true,
|
||||
show_help = true,
|
||||
question_header = " " .. user .. " ",
|
||||
answer_header = " Copilot ",
|
||||
window = {
|
||||
width = 0.4,
|
||||
},
|
||||
selection = function(source)
|
||||
local select = require("CopilotChat.select")
|
||||
return select.visual(source) or select.buffer(source)
|
||||
end,
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
@ -66,16 +61,11 @@ return {
|
||||
desc = "Quick Chat (CopilotChat)",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
-- Show help actions with telescope
|
||||
{ "<leader>ad", M.pick("help"), desc = "Diagnostic Help (CopilotChat)", mode = { "n", "v" } },
|
||||
-- Show prompts actions with telescope
|
||||
{ "<leader>ap", M.pick("prompt"), desc = "Prompt Actions (CopilotChat)", mode = { "n", "v" } },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local chat = require("CopilotChat")
|
||||
if pcall(require, "cmp") then
|
||||
require("CopilotChat.integrations.cmp").setup()
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
pattern = "copilot-chat",
|
||||
|
@ -5,119 +5,127 @@ return {
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
build = ":Copilot auth",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
suggestion = { enabled = false },
|
||||
suggestion = {
|
||||
enabled = not vim.g.ai_cmp,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = false, -- handled by nvim-cmp / blink.cmp
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
},
|
||||
},
|
||||
panel = { enabled = false },
|
||||
filetypes = {
|
||||
markdown = true,
|
||||
help = true,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("copilot").setup(opts)
|
||||
-- HACK: work-around for https://github.com/neovim/neovim/issues/31262
|
||||
local Util = require("copilot.util")
|
||||
local language_for_file_type = Util.language_for_file_type
|
||||
Util.language_for_file_type = function(ft)
|
||||
return language_for_file_type(ft or "")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- add ai_accept action
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
opts = function()
|
||||
LazyVim.cmp.actions.ai_accept = function()
|
||||
if require("copilot.suggestion").is_visible() then
|
||||
LazyVim.create_undo()
|
||||
require("copilot.suggestion").accept()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- lualine
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local colors = {
|
||||
[""] = LazyVim.ui.fg("Special"),
|
||||
["Normal"] = LazyVim.ui.fg("Special"),
|
||||
["Warning"] = LazyVim.ui.fg("DiagnosticError"),
|
||||
["InProgress"] = LazyVim.ui.fg("DiagnosticWarn"),
|
||||
}
|
||||
table.insert(opts.sections.lualine_x, 2, {
|
||||
function()
|
||||
local icon = LazyVim.config.icons.kinds.Copilot
|
||||
local status = require("copilot.api").status.data
|
||||
return icon .. (status.message or "")
|
||||
end,
|
||||
cond = function()
|
||||
if not package.loaded["copilot"] then
|
||||
return
|
||||
table.insert(
|
||||
opts.sections.lualine_x,
|
||||
2,
|
||||
LazyVim.lualine.status(LazyVim.config.icons.kinds.Copilot, function()
|
||||
local clients = package.loaded["copilot"] and LazyVim.lsp.get_clients({ name = "copilot", bufnr = 0 }) or {}
|
||||
if #clients > 0 then
|
||||
local status = require("copilot.api").status.data.status
|
||||
return (status == "InProgress" and "pending") or (status == "Warning" and "error") or "ok"
|
||||
end
|
||||
local ok, clients = pcall(LazyVim.lsp.get_clients, { name = "copilot", bufnr = 0 })
|
||||
if not ok then
|
||||
return false
|
||||
end
|
||||
return ok and #clients > 0
|
||||
end,
|
||||
color = function()
|
||||
if not package.loaded["copilot"] then
|
||||
return
|
||||
end
|
||||
local status = require("copilot.api").status.data
|
||||
return colors[status.status] or colors[""]
|
||||
end,
|
||||
})
|
||||
end)
|
||||
)
|
||||
end,
|
||||
},
|
||||
|
||||
-- copilot cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
dependencies = {
|
||||
optional = true,
|
||||
dependencies = { -- this will only be evaluated if nvim-cmp is enabled
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
dependencies = "copilot.lua",
|
||||
enabled = vim.g.ai_cmp, -- only enable if wanted
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local copilot_cmp = require("copilot_cmp")
|
||||
copilot_cmp.setup(opts)
|
||||
-- attach cmp source whenever copilot attaches
|
||||
-- fixes lazy-loading issues with the copilot cmp source
|
||||
LazyVim.lsp.on_attach(function(client)
|
||||
LazyVim.lsp.on_attach(function()
|
||||
copilot_cmp._on_insert_enter({})
|
||||
end, "copilot")
|
||||
end,
|
||||
},
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "copilot",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
specs = {
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = { accept = false },
|
||||
specs = {
|
||||
{
|
||||
"nvim-cmp",
|
||||
optional = true,
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "copilot",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
windows = {
|
||||
ghost_text = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
keymap = {
|
||||
["<Tab>"] = {
|
||||
function(cmp)
|
||||
if cmp.is_in_snippet() then
|
||||
return cmp.accept()
|
||||
elseif require("copilot.suggestion").is_visible() then
|
||||
LazyVim.create_undo()
|
||||
require("copilot.suggestion").accept()
|
||||
return true
|
||||
else
|
||||
return cmp.select_and_accept()
|
||||
end
|
||||
end,
|
||||
"snippet_forward",
|
||||
"fallback",
|
||||
},
|
||||
|
||||
-- blink.cmp
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"giuxtaposition/blink-cmp-copilot",
|
||||
enabled = vim.g.ai_cmp, -- only enable if needed
|
||||
specs = {
|
||||
{
|
||||
"blink.cmp",
|
||||
optional = true,
|
||||
opts = {
|
||||
sources = {
|
||||
providers = {
|
||||
copilot = { name = "copilot", module = "blink-cmp-copilot" },
|
||||
},
|
||||
completion = {
|
||||
enabled_providers = { "copilot" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
107
lua/lazyvim/plugins/extras/ai/supermaven.lua
Normal file
107
lua/lazyvim/plugins/extras/ai/supermaven.lua
Normal file
@ -0,0 +1,107 @@
|
||||
return {
|
||||
{
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
opts = {
|
||||
keymaps = {
|
||||
accept_suggestion = nil, -- handled by nvim-cmp / blink.cmp
|
||||
},
|
||||
disable_inline_completion = vim.g.ai_cmp,
|
||||
},
|
||||
},
|
||||
|
||||
-- add ai_accept action
|
||||
{
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
opts = function()
|
||||
require("supermaven-nvim.completion_preview").suggestion_group = "SupermavenSuggestion"
|
||||
LazyVim.cmp.actions.ai_accept = function()
|
||||
local suggestion = require("supermaven-nvim.completion_preview")
|
||||
if suggestion.has_suggestion() then
|
||||
LazyVim.create_undo()
|
||||
vim.schedule(function()
|
||||
suggestion.on_accept_suggestion()
|
||||
end)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- cmp integration
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
optional = true,
|
||||
dependencies = { "supermaven-nvim" },
|
||||
opts = function(_, opts)
|
||||
if vim.g.ai_cmp then
|
||||
table.insert(opts.sources, 1, {
|
||||
name = "supermaven",
|
||||
group_index = 1,
|
||||
priority = 100,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- blink.cmp integration
|
||||
--
|
||||
-- FIXME: this currently doesn't work properly
|
||||
-- {
|
||||
-- "saghen/blink.cmp",
|
||||
-- optional = true,
|
||||
-- opts = {
|
||||
-- sources = {
|
||||
-- compat = vim.g.ai_cmp and { "supermaven" } or nil,
|
||||
-- },
|
||||
-- },
|
||||
-- dependencies = {
|
||||
-- "supermaven-nvim",
|
||||
-- vim.g.ai_cmp and "saghen/blink.compat" or nil,
|
||||
-- },
|
||||
-- },
|
||||
--
|
||||
-- Disabble cmp integration for now
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
opts = {
|
||||
windows = { ghost_text = { enabled = false } },
|
||||
},
|
||||
dependencies = {
|
||||
{
|
||||
"supermaven-nvim",
|
||||
opts = {
|
||||
disable_inline_completion = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("supermaven"))
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.routes, {
|
||||
{
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
any = {
|
||||
{ find = "Starting Supermaven" },
|
||||
{ find = "Supermaven Free Tier" },
|
||||
},
|
||||
},
|
||||
skip = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
@ -8,7 +8,6 @@ return {
|
||||
"tzachar/cmp-tabnine",
|
||||
build = {
|
||||
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
|
||||
":CmpTabnineHub",
|
||||
},
|
||||
dependencies = "hrsh7th/nvim-cmp",
|
||||
opts = {
|
||||
|
@ -1,3 +1,10 @@
|
||||
if lazyvim_docs then
|
||||
-- set to `true` to follow the main branch
|
||||
-- you need to have a working rust toolchain to build the plugin
|
||||
-- in this case.
|
||||
vim.g.lazyvim_blink_main = false
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
@ -5,8 +12,12 @@ return {
|
||||
},
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
version = "*",
|
||||
opts_extend = { "sources.completion.enabled_providers" },
|
||||
version = not vim.g.lazyvim_blink_main and "*",
|
||||
build = vim.g.lazyvim_blink_main and "cargo build --release",
|
||||
opts_extend = {
|
||||
"sources.completion.enabled_providers",
|
||||
"sources.compat",
|
||||
},
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
-- add blink.compat to dependencies
|
||||
@ -35,7 +46,7 @@ return {
|
||||
auto_show = true,
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
enabled = vim.g.ai_cmp,
|
||||
},
|
||||
},
|
||||
|
||||
@ -45,6 +56,9 @@ return {
|
||||
-- experimental signature help support
|
||||
-- trigger = { signature_help = { enabled = true } }
|
||||
sources = {
|
||||
-- adding any nvim-cmp sources here will enable them
|
||||
-- with blink.compat
|
||||
compat = {},
|
||||
completion = {
|
||||
-- remember to enable your providers here
|
||||
enabled_providers = { "lsp", "path", "snippets", "buffer" },
|
||||
@ -53,8 +67,28 @@ return {
|
||||
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<Tab>"] = {
|
||||
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
|
||||
"fallback",
|
||||
},
|
||||
},
|
||||
},
|
||||
---@param opts blink.cmp.Config | { sources: { compat: string[] } }
|
||||
config = function(_, opts)
|
||||
-- setup compat sources
|
||||
local enabled = opts.sources.completion.enabled_providers
|
||||
for _, source in ipairs(opts.sources.compat or {}) do
|
||||
opts.sources.providers[source] = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{ name = source, module = "blink.compat.source" },
|
||||
opts.sources.providers[source] or {}
|
||||
)
|
||||
if type(enabled) == "table" and not vim.tbl_contains(enabled, source) then
|
||||
table.insert(enabled, source)
|
||||
end
|
||||
end
|
||||
require("blink.cmp").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- add icons
|
||||
@ -87,4 +121,12 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
-- catppuccin support
|
||||
{
|
||||
"catppuccin",
|
||||
optional = true,
|
||||
opts = {
|
||||
integrations = { blink_cmp = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -1,4 +1,8 @@
|
||||
return {
|
||||
-- disable builtin snippet support
|
||||
{ "garymjr/nvim-snippets", enabled = false },
|
||||
|
||||
-- add luasnip
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
lazy = true,
|
||||
@ -12,43 +16,56 @@ return {
|
||||
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",
|
||||
},
|
||||
},
|
||||
|
||||
-- add snippet_forward action
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
opts = function()
|
||||
LazyVim.cmp.actions.snippet_forward = function()
|
||||
if require("luasnip").jumpable(1) then
|
||||
require("luasnip").jump(1)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- nvim-cmp integration
|
||||
{
|
||||
"nvim-cmp",
|
||||
optional = true,
|
||||
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,
|
||||
-- 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" } },
|
||||
},
|
||||
},
|
||||
|
||||
-- blink.cmp integration
|
||||
{
|
||||
"garymjr/nvim-snippets",
|
||||
enabled = false,
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
opts = {
|
||||
accept = {
|
||||
expand_snippet = function(...)
|
||||
return require("luasnip").lsp_expand(...)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -98,7 +98,10 @@ return {
|
||||
return {
|
||||
dials_by_ft = {
|
||||
css = "css",
|
||||
vue = "vue",
|
||||
javascript = "typescript",
|
||||
typescript = "typescript",
|
||||
typescriptreact = "typescript",
|
||||
javascriptreact = "typescript",
|
||||
json = "json",
|
||||
lua = "lua",
|
||||
@ -106,8 +109,6 @@ return {
|
||||
python = "python",
|
||||
sass = "css",
|
||||
scss = "css",
|
||||
typescript = "typescript",
|
||||
typescriptreact = "typescript",
|
||||
yaml = "yaml",
|
||||
},
|
||||
groups = {
|
||||
@ -118,6 +119,17 @@ return {
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
capitalized_boolean,
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
logical_alias,
|
||||
},
|
||||
vue = {
|
||||
augend.integer.alias.decimal_int, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
logical_alias,
|
||||
augend.constant.new({ elements = { "let", "const" } }),
|
||||
augend.hexcolor.new({ case = "lower" }),
|
||||
augend.hexcolor.new({ case = "upper" }),
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal_int, -- nonnegative and negative decimal number
|
||||
|
@ -74,18 +74,6 @@ return {
|
||||
config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"]
|
||||
config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "toggle-root-dir")
|
||||
|
||||
-- use the same prompt for all
|
||||
local defaults = require("fzf-lua.profiles.default-title")
|
||||
local function fix(t)
|
||||
t.prompt = t.prompt ~= nil and " " or nil
|
||||
for _, v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
fix(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
fix(defaults)
|
||||
|
||||
local img_previewer ---@type string[]?
|
||||
for _, v in ipairs({
|
||||
{ cmd = "ueberzug", args = {} },
|
||||
@ -98,7 +86,8 @@ return {
|
||||
end
|
||||
end
|
||||
|
||||
return vim.tbl_deep_extend("force", defaults, {
|
||||
return {
|
||||
"default-title",
|
||||
fzf_colors = true,
|
||||
fzf_opts = {
|
||||
["--no-scrollbar"] = true,
|
||||
@ -186,9 +175,24 @@ return {
|
||||
previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
if opts[1] == "default-title" then
|
||||
-- use the same prompt for all pickers for profile `default-title` and
|
||||
-- profiles that use `default-title` as base profile
|
||||
local function fix(t)
|
||||
t.prompt = t.prompt ~= nil and " " or nil
|
||||
for _, v in pairs(t) do
|
||||
if type(v) == "table" then
|
||||
fix(v)
|
||||
end
|
||||
end
|
||||
return t
|
||||
end
|
||||
opts = vim.tbl_deep_extend("force", fix(require("fzf-lua.profiles.default-title")), opts)
|
||||
opts[1] = nil
|
||||
end
|
||||
require("fzf-lua").setup(opts)
|
||||
end,
|
||||
init = function()
|
||||
|
59
lua/lazyvim/plugins/extras/formatting/biome.lua
Normal file
59
lua/lazyvim/plugins/extras/formatting/biome.lua
Normal file
@ -0,0 +1,59 @@
|
||||
---@diagnostic disable: inject-field
|
||||
if lazyvim_docs then
|
||||
-- Enable this option to avoid conflicts with Prettier.
|
||||
vim.g.lazyvim_prettier_needs_config = true
|
||||
end
|
||||
|
||||
-- https://biomejs.dev/internals/language-support/
|
||||
local supported = {
|
||||
"astro",
|
||||
"css",
|
||||
"graphql",
|
||||
-- "html",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"json",
|
||||
"jsonc",
|
||||
-- "markdown",
|
||||
"svelte",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
-- "yaml",
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = { ensure_installed = { "biome" } },
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
---@param opts ConformOpts
|
||||
opts = function(_, opts)
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
for _, ft in ipairs(supported) do
|
||||
opts.formatters_by_ft[ft] = opts.formatters_by_ft[ft] or {}
|
||||
table.insert(opts.formatters_by_ft[ft], "biome")
|
||||
end
|
||||
|
||||
opts.formatters = opts.formatters or {}
|
||||
opts.formatters.biome = {
|
||||
require_cwd = true,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- none-ls support
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, nls.builtins.formatting.biome)
|
||||
end,
|
||||
},
|
||||
}
|
@ -122,6 +122,25 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- blink.cmp integration
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
opts = {
|
||||
sources = {
|
||||
completion = {
|
||||
enabled_providers = { "dadbod" },
|
||||
},
|
||||
providers = {
|
||||
dadbod = { name = "Dadbod", module = "vim_dadbod_completion.blink" },
|
||||
},
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
},
|
||||
},
|
||||
|
||||
-- Linters & formatters
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
|
@ -1,7 +1,6 @@
|
||||
return {
|
||||
|
||||
{ "nvimdev/dashboard-nvim", enabled = false },
|
||||
{ "echasnovski/mini.starter", enabled = false },
|
||||
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
|
||||
-- Dashboard. This runs when neovim starts, and is what displays
|
||||
-- the "LAZYVIM" banner.
|
||||
{
|
||||
|
68
lua/lazyvim/plugins/extras/ui/dashboard-nvim.lua
Normal file
68
lua/lazyvim/plugins/extras/ui/dashboard-nvim.lua
Normal file
@ -0,0 +1,68 @@
|
||||
return {
|
||||
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
|
||||
opts = function()
|
||||
local logo = [[
|
||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
||||
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
||||
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
||||
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||
]]
|
||||
|
||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
hide = {
|
||||
-- this is taken care of by lualine
|
||||
-- enabling this messes up the actual laststatus setting after loading a file
|
||||
statusline = false,
|
||||
},
|
||||
config = {
|
||||
header = vim.split(logo, "\n"),
|
||||
-- stylua: ignore
|
||||
center = {
|
||||
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" },
|
||||
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" },
|
||||
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = " ", key = "g" },
|
||||
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" },
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = " ", key = "q" },
|
||||
},
|
||||
footer = function()
|
||||
local stats = require("lazy").stats()
|
||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
for _, button in ipairs(opts.config.center) do
|
||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||
button.key_format = " %s"
|
||||
end
|
||||
|
||||
-- open dashboard after closing lazy
|
||||
if vim.o.filetype == "lazy" then
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
pattern = tostring(vim.api.nvim_get_current_win()),
|
||||
once = true,
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
}
|
@ -1,8 +1,7 @@
|
||||
-- start screen
|
||||
return {
|
||||
-- disable alpha
|
||||
{ "goolord/alpha-nvim", enabled = false },
|
||||
{ "nvimdev/dashboard-nvim", enabled = false },
|
||||
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
|
||||
|
||||
-- enable mini.starter
|
||||
{
|
||||
|
@ -152,6 +152,9 @@ return {
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if not vim.tbl_get(opts, "config", "center") then
|
||||
return
|
||||
end
|
||||
local projects = {
|
||||
action = pick,
|
||||
desc = " Projects",
|
||||
@ -165,4 +168,17 @@ return {
|
||||
table.insert(opts.config.center, 3, projects)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.dashboard.preset.keys, 3, {
|
||||
action = pick,
|
||||
desc = "Projects",
|
||||
icon = " ",
|
||||
key = "p",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -9,10 +9,23 @@ return {
|
||||
ft = "http",
|
||||
keys = {
|
||||
{ "<leader>R", "", desc = "+Rest", ft = "http" },
|
||||
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request", ft = "http" },
|
||||
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body", ft = "http" },
|
||||
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request", ft = "http" },
|
||||
{ "<leader>Rb", "<cmd>lua require('kulala').scratchpad()<cr>", desc = "Open scratchpad", ft = "http" },
|
||||
{ "<leader>Rc", "<cmd>lua require('kulala').copy()<cr>", desc = "Copy as cURL", ft = "http" },
|
||||
{ "<leader>RC", "<cmd>lua require('kulala').from_curl()<cr>", desc = "Paste from curl", ft = "http" },
|
||||
{
|
||||
"<leader>Rg",
|
||||
"<cmd>lua require('kulala').download_graphql_schema()<cr>",
|
||||
desc = "Download GraphQL schema",
|
||||
ft = "http",
|
||||
},
|
||||
{ "<leader>Ri", "<cmd>lua require('kulala').inspect()<cr>", desc = "Inspect current request", ft = "http" },
|
||||
{ "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", desc = "Jump to next request", ft = "http" },
|
||||
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request", ft = "http" },
|
||||
{ "<leader>Rq", "<cmd>lua require('kulala').close()<cr>", desc = "Close window", ft = "http" },
|
||||
{ "<leader>Rr", "<cmd>lua require('kulala').replay()<cr>", desc = "Replay the last request", ft = "http" },
|
||||
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request", ft = "http" },
|
||||
{ "<leader>RS", "<cmd>lua require('kulala').show_stats()<cr>", desc = "Show stats", ft = "http" },
|
||||
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body", ft = "http" },
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
|
@ -3,6 +3,7 @@ if not vim.g.vscode then
|
||||
end
|
||||
|
||||
local enabled = {
|
||||
"LazyVim",
|
||||
"dial.nvim",
|
||||
"flit.nvim",
|
||||
"lazy.nvim",
|
||||
@ -15,10 +16,10 @@ local enabled = {
|
||||
"nvim-treesitter",
|
||||
"nvim-treesitter-textobjects",
|
||||
"nvim-ts-context-commentstring",
|
||||
"snacks.nvim",
|
||||
"ts-comments.nvim",
|
||||
"vim-repeat",
|
||||
"yanky.nvim",
|
||||
"LazyVim",
|
||||
}
|
||||
|
||||
local Config = require("lazy.core.config")
|
||||
|
@ -30,7 +30,10 @@ return {
|
||||
opts = function()
|
||||
---@type snacks.Config
|
||||
return {
|
||||
toggle = { map = LazyVim.safe_keymap_set },
|
||||
bigfile = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
statuscolumn = { enabled = false }, -- we set this in options.lua
|
||||
terminal = {
|
||||
win = {
|
||||
keys = {
|
||||
@ -41,6 +44,8 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
toggle = { map = LazyVim.safe_keymap_set },
|
||||
words = { enabled = true },
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
@ -52,5 +57,14 @@ return {
|
||||
desc = "Dismiss All Notifications",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local notify = vim.notify
|
||||
require("snacks").setup(opts)
|
||||
-- HACK: restore vim.notify after snacks setup and let noice.nvim take over
|
||||
-- this is needed to have early notifications show up in noice history
|
||||
if LazyVim.has("noice.nvim") then
|
||||
vim.notify = notify
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ function M.get()
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "K", function() return vim.lsp.buf.hover() end, desc = "Hover" },
|
||||
{ "gK", function() return vim.lsp.buf.signature_help() end, desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<c-k>", function() return vim.lsp.buf.signature_help() end, mode = "i", desc = "Signature Help", has = "signatureHelp" },
|
||||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
|
||||
{ "<leader>cc", vim.lsp.codelens.run, desc = "Run Codelens", mode = { "n", "v" }, has = "codeLens" },
|
||||
{ "<leader>cC", vim.lsp.codelens.refresh, desc = "Refresh & Display Codelens", mode = { "n" }, has = "codeLens" },
|
||||
|
@ -84,7 +84,7 @@ return {
|
||||
options = {
|
||||
theme = "auto",
|
||||
globalstatus = vim.o.laststatus == 3,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter" } },
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter", "snacks_dashboard" } },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
@ -307,68 +307,33 @@ return {
|
||||
{ "MunifTanjim/nui.nvim", lazy = true },
|
||||
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
|
||||
opts = function()
|
||||
local logo = [[
|
||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
||||
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
||||
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
||||
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||
]]
|
||||
|
||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
hide = {
|
||||
-- this is taken care of by lualine
|
||||
-- enabling this messes up the actual laststatus setting after loading a file
|
||||
statusline = false,
|
||||
},
|
||||
config = {
|
||||
header = vim.split(logo, "\n"),
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
dashboard = {
|
||||
preset = {
|
||||
header = [[
|
||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
||||
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
||||
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
||||
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||
]],
|
||||
-- stylua: ignore
|
||||
center = {
|
||||
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" },
|
||||
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" },
|
||||
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = " ", key = "g" },
|
||||
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" },
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = " ", key = "q" },
|
||||
---@type snacks.dashboard.Item[]
|
||||
keys = {
|
||||
{ icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
|
||||
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
||||
{ icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
|
||||
{ icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
|
||||
{ icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
|
||||
{ icon = " ", key = "s", desc = "Restore Session", section = "session" },
|
||||
{ icon = " ", key = "x", desc = "Lazy Extras", action = ":LazyExtras" },
|
||||
{ icon = " ", key = "l", desc = "Lazy", action = ":Lazy" },
|
||||
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||
},
|
||||
footer = function()
|
||||
local stats = require("lazy").stats()
|
||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
for _, button in ipairs(opts.config.center) do
|
||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||
button.key_format = " %s"
|
||||
end
|
||||
|
||||
-- open dashboard after closing lazy
|
||||
if vim.o.filetype == "lazy" then
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
pattern = tostring(vim.api.nvim_get_current_win()),
|
||||
once = true,
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -27,6 +27,9 @@ LazyVim.plugin.save_core()
|
||||
if vim.tbl_contains(compat, v) then
|
||||
table.insert(extras, 1, "lazyvim.plugins.compat.nvim-" .. v)
|
||||
end
|
||||
if vim.g.vscode then
|
||||
table.insert(extras, 1, "lazyvim.plugins.extras.vscode")
|
||||
end
|
||||
|
||||
table.sort(extras, function(a, b)
|
||||
local pa = prios[a] or 50
|
||||
|
@ -1,6 +1,36 @@
|
||||
---@class lazyvim.util.cmp
|
||||
local M = {}
|
||||
|
||||
---@alias lazyvim.util.cmp.Action fun():boolean?
|
||||
---@type table<string, lazyvim.util.cmp.Action>
|
||||
M.actions = {
|
||||
-- Native Snippets
|
||||
snippet_forward = function()
|
||||
if vim.snippet.active({ direction = 1 }) then
|
||||
vim.schedule(function()
|
||||
vim.snippet.jump(1)
|
||||
end)
|
||||
return true
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
---@param actions string[]
|
||||
---@param fallback? string|fun()
|
||||
function M.map(actions, fallback)
|
||||
return function()
|
||||
for _, name in ipairs(actions) do
|
||||
if M.actions[name] then
|
||||
local ret = M.actions[name]()
|
||||
if ret then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return type(fallback) == "function" and fallback() or fallback
|
||||
end
|
||||
end
|
||||
|
||||
---@alias Placeholder {n:number, text:string}
|
||||
|
||||
---@param snippet string
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user