Compare commits

..

19 Commits

Author SHA1 Message Date
2b3bd6c013 fix: disable telescope 2024-06-10 21:57:28 +02:00
31c40573db feat: added ctrl-f and ctrl-b to scroll the preview window 2024-06-10 21:55:40 +02:00
9cc5d3df50 fix: fix path formatting for grep 2024-06-10 20:59:42 +02:00
6761d8efc8 chore: cleanup 2024-06-10 20:44:43 +02:00
0d05715411 feat: consistent prompt symbols for all pickers 2024-06-10 20:44:32 +02:00
dd5a5fb4cd feat: use ctrl-r to toggle between rootdir/cwd 2024-06-10 20:44:13 +02:00
9f98b0a01e chore: remove fzf_colors code since PR has been merged 2024-06-10 20:43:40 +02:00
b74db85447 feat(fzf-lua): added support for todo-comments 2024-06-10 18:10:13 +02:00
c155b2e965 feat: added symbols filter 2024-06-10 17:31:26 +02:00
6a07e6522a refactor: temp code for better fzf_colors 2024-06-10 17:10:37 +02:00
26254487fb feat: added toggle for hidden/ignore 2024-06-10 17:10:07 +02:00
f9697cbf17 feat: root-dir toggle 2024-06-10 17:09:43 +02:00
7eac9a854b refactor: trouble 2024-06-10 17:09:33 +02:00
4947802191 feat: fzf_colors based on Neovim colorscheme 2024-06-10 14:23:18 +02:00
60d472a569 fix: fzf smart open 2024-06-10 06:40:43 +02:00
252197f659 Update lua/lazyvim/plugins/extras/editor/fzf.lua
Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com>
2024-06-09 23:27:22 +02:00
e29ad4a14e refactor: LazyVim.pick 2024-06-09 23:13:53 +02:00
1b34b481c8 feat: added trouble integration 2024-06-09 23:13:53 +02:00
bedeb66fa9 feat(extras): added fzf-lua 2024-06-09 23:13:53 +02:00
129 changed files with 2475 additions and 4674 deletions

View File

@ -1,7 +0,0 @@
root = true
[*]
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8

View File

@ -1,3 +0,0 @@
{
".": "13.5.0"
}

View File

@ -6,10 +6,7 @@ body:
- type: markdown
attributes:
value: |
**Before** reporting an issue, make sure to read the [documentation](https://github.com/LazyVim/LazyVim)
and search [existing issues](https://github.com/LazyVim/LazyVim/issues).
Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/LazyVim/LazyVim/discussions) and will be closed.
**Before** reporting an issue, make sure to read the [documentation](https://github.com/folke/LazyVim) and search [existing issues](https://github.com/folke/LazyVim/issues). Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/folke/LazyVim/discussions) and will be closed.
- type: checkboxes
attributes:
label: Did you check docs and existing issues?
@ -17,8 +14,6 @@ body:
options:
- label: I have read all the LazyVim docs
required: true
- label: I have updated the plugin to the latest version before submitting this issue
required: true
- label: I have searched the existing issues of LazyVim
required: true
- label: I have searched the existing issues of plugins related to this issue
@ -62,15 +57,33 @@ body:
label: Repro
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
value: |
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
require("lazy.minit").repro({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- add any other plugins here
},
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/LazyVim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
render: lua
vim.cmd.colorscheme("tokyonight")
-- add anything else here
render: Lua
validations:
required: false

View File

@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
- name: Ask a question or start a discussion
url: https://github.com/LazyVim/LazyVim/discussions
about: Use Github discussions instead

View File

@ -1,19 +0,0 @@
## Description
<!-- Describe the big picture of your changes to communicate to the maintainers
why we should accept this pull request. -->
## Related Issue(s)
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
## Checklist
- [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.

View File

@ -1,6 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View File

@ -1,9 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "simple",
"extra-files": ["lua/lazyvim/config/init.lua"]
}
}
}

View File

@ -1,14 +1,81 @@
name: CI
on:
push:
branches: [main, master]
pull_request:
jobs:
ci:
uses: folke/github/.github/workflows/ci.yml@main
secrets: inherit
with:
plugin: LazyVim
repo: LazyVim/LazyVim
stylua:
name: Stylua Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
tests:
strategy:
matrix:
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Neovim
shell: bash
run: |
mkdir -p /tmp/nvim
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
cd /tmp/nvim
chmod a+x ./nvim.appimage
./nvim.appimage --appimage-extract
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
- name: Run Tests
run: |
nvim --version
[ ! -d tests ] && exit 0
./tests/run
docs:
runs-on: ubuntu-latest
needs: tests
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- name: panvimdoc
uses: kdheepak/panvimdoc@main
with:
vimdoc: LazyVim
version: "Neovim >= 0.9.0"
demojify: true
treesitter: true
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(build): auto-generate vimdoc"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
release:
name: release
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- docs
- tests
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: simple
- uses: actions/checkout@v4
- name: tag stable versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
git tag -d stable || true
git push origin :stable || true
git tag -a stable -m "Last Stable Release"
git push origin stable

View File

@ -1,8 +1,12 @@
name: "PR Labeler"
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
labeler:
uses: folke/github/.github/workflows/labeler.yml@main
secrets: inherit
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5

View File

@ -1,4 +1,4 @@
name: PR Title
name: "Lint PR"
on:
pull_request_target:
@ -6,13 +6,36 @@ on:
- opened
- edited
- synchronize
- reopened
- ready_for_review
permissions:
pull-requests: read
jobs:
pr-title:
uses: folke/github/.github/workflows/pr.yml@main
secrets: inherit
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: true
subjectPattern: ^(?![A-Z]).+$
scopes: |
.+
types: |
build
chore
ci
docs
feat
fix
merge
perf
refactor
revert
style
test
wip
ignoreLabels: |
autorelease: pending

View File

@ -1,11 +1,27 @@
name: Stale Issues & PRs
name: Close stale issues and PRs
on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
uses: folke/github/.github/workflows/stale.yml@main
secrets: inherit
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
operations-per-run: 300
# default stale time
days-before-stale: 30
days-before-close: 7
# never stale pull requests
# days-before-pr-stale: -1
days-before-pr-close: -1
# exclude issues with certain labels
exempt-issue-labels: pinned,wip,security,notice
# never stale issues attached to a milestone
# exempt-all-milestones: true
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days."
stale-pr-message: "This PR is stale because it has been open 60 days with no activity."
close-issue-message: "This issue was closed because it has been stalled for 7 days with no activity."

View File

@ -1,13 +0,0 @@
name: Update Repo
on:
workflow_dispatch:
schedule:
# Run every hour
- cron: "0 * * * *"
jobs:
update:
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
uses: folke/github/.github/workflows/update.yml@main
secrets: inherit

15
.gitignore vendored
View File

@ -1,9 +1,8 @@
*.log
/.repro
/.tests
/build
/debug
/doc/tags
foo.*
node_modules
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
# Contributing to LazyVim
## General Guidelines
- Avoid using Vim plugins whenever possible.
- If an extra requires a Vim plugin, explain why in the PR description.
- Ensure all configurations are overridable by the user, using Lazy's specs.
- Tag specs as `optional` if they should only be enabled when the user has them installed.
- Implement proper lazy-loading for every plugin added in an extra.
- Understand how Lazy's dependencies work. For Lua dependencies, do not specify
them in the `dependencies` field. Instead, add them as a separate spec with `lazy=true`.
## Contributing an Extra Plugin
- The plugin should be well-known and require significant configuration.
- Simple specs containing just the plugin with some options will not be accepted.
## Contributing an Extra Language
- You should be familiar with the language you are adding.
- You should have experience with the language's ecosystem, including formatters,
linters, and LSP servers.
- The extra should include the setup most widely used by the community.
- Include Tree-sitter parsers that are not yet the default.
- Include the most widely used LSP server setup.
- Avoid the need for LSP wrapper packages whenever possible.
- Only add a formatter if it is typically used by the community instead of the LSP formatter.
- Only add extra linters if the community typically uses them instead of just the LSP linters.
- Every language extra requires a `recommended` section as part of the extra.
Check lspconfig server configurations for the proper filetypes and root directories.
Refer to other extras for creating the `recommended` section.

27
NEWS.md
View File

@ -1,34 +1,7 @@
# What's new?
## 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
[snacks.nvim](https://github.com/folke/snacks.nvim) and fully
integrating it into **LazyVim**.
- I highly suggest having a look at the **snacks.nvim** documentation
to see all the new features and improvements. Most important changes:
- `Snacks.notifier` for notifications instead of `nvim-notify`
- `Snacks.terminal` is similar to `lazyterm`, but has more features
and creates bottom splits by default (similar to the `edgy` integrating)
## 12.x
- **Markdown Extra**: [headlines.nvim](https://github.com/lukas-reineke/headlines.nvim) has been removed in favor of [markdown.nvim](https://github.com/MeanderingProgrammer/markdown.nvim)
to spice up your markdown files.
- [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim).
**grug-far.nvim** has a great UI and feels more intuitive to use.
- This **news** is now also available on the website at [https://www.lazyvim.org/news](https://www.lazyvim.org/news)
- **prettier** extra now works for all prettier supported filetypes

View File

@ -113,10 +113,6 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM)
[@dusty-phillips](https://github.com/dusty-phillips) 正在编写一本名为
[LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes)
的书,该书可在线免费获得。
## 📂 文件结构
config 下的文件会在适当的时候自动加载,所以你不需要手动引入这些文件。

View File

@ -115,7 +115,7 @@ There's a great video created by [@elijahmanor](https://github.com/elijahmanor)
[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM)
[@dusty-phillips](https://github.com/dusty-phillips) wrote a comprehensive book called
[@dusty-phillips](https://github.com/dusty-phillips) is working on a book called
[LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes)
available for free online.

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim Last change: 2024 November 18
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 09
==============================================================================
Table of Contents *LazyVim-table-of-contents*
@ -102,8 +102,8 @@ Theres a great video created by @elijahmanor
<https://www.youtube.com/watch?v=N93cTbtLCIM>
@dusty-phillips <https://github.com/dusty-phillips> wrote a comprehensive book
called LazyVim for Ambitious Developers
@dusty-phillips <https://github.com/dusty-phillips> is working on a book called
LazyVim for Ambitious Developers
<https://lazyvim-ambitious-devs.phillips.codes> available for free online.

View File

@ -18,7 +18,7 @@ vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup("highlight_yank"),
callback = function()
(vim.hl or vim.highlight).on_yank()
vim.highlight.on_yank()
end,
})
@ -55,34 +55,22 @@ vim.api.nvim_create_autocmd("FileType", {
group = augroup("close_with_q"),
pattern = {
"PlenaryTestPopup",
"checkhealth",
"dbout",
"gitsigns-blame",
"grug-far",
"help",
"lspinfo",
"neotest-output",
"neotest-output-panel",
"neotest-summary",
"notify",
"qf",
"snacks_win",
"spectre_panel",
"startuptime",
"tsplayground",
"neotest-output",
"checkhealth",
"neotest-summary",
"neotest-output-panel",
"dbout",
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.schedule(function()
vim.keymap.set("n", "q", function()
vim.cmd("close")
pcall(vim.api.nvim_buf_delete, event.buf, { force = true })
end, {
buffer = event.buf,
silent = true,
desc = "Quit buffer",
})
end)
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
end,
})
@ -98,7 +86,7 @@ vim.api.nvim_create_autocmd("FileType", {
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", {
group = augroup("wrap_spell"),
pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" },
pattern = { "*.txt", "*.tex", "*.typ", "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true

View File

@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions
local M = {}
M.version = "13.5.0" -- x-release-please-version
M.version = "10.21.1" -- x-release-please-version
LazyVim.config = M
---@class LazyVimOptions
@ -88,7 +88,6 @@ local defaults = {
Snippet = "",
String = "",
Struct = "󰆼 ",
Supermaven = "",
TabNine = "󰏚 ",
Text = "",
TypeParameter = "",
@ -136,8 +135,7 @@ local defaults = {
}
M.json = {
version = 7,
path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json",
version = 6,
data = {
version = nil, ---@type string?
news = {}, ---@type table<string, string>
@ -146,7 +144,8 @@ M.json = {
}
function M.json.load()
local f = io.open(M.json.path, "r")
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
local f = io.open(path, "r")
if f then
local data = f:read("*a")
f:close()
@ -162,7 +161,6 @@ end
---@type LazyVimOptions
local options
local lazy_clipboard
---@param opts? LazyVimOptions
function M.setup(opts)
@ -183,9 +181,6 @@ function M.setup(opts)
M.load("autocmds")
end
M.load("keymaps")
if lazy_clipboard ~= nil then
vim.opt.clipboard = lazy_clipboard
end
LazyVim.format.setup()
LazyVim.news.setup()
@ -253,17 +248,16 @@ function M.load(name)
end, { msg = "Failed loading " .. mod })
end
end
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
-- always load lazyvim, then user file
if M.defaults[name] or name == "options" then
_load("lazyvim.config." .. name)
vim.api.nvim_exec_autocmds("User", { pattern = pattern .. "Defaults", modeline = false })
end
_load("config." .. name)
if vim.bo.filetype == "lazy" then
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
vim.cmd([[do VimResized]])
end
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
vim.api.nvim_exec_autocmds("User", { pattern = pattern, modeline = false })
end
@ -290,9 +284,6 @@ function M.init()
-- this is needed to make sure options will be correctly applied
-- after installing missing plugins
M.load("options")
-- defer built-in clipboard handling: "xsel" and "pbcopy" can be slow
lazy_clipboard = vim.opt.clipboard
vim.opt.clipboard = ""
if vim.g.deprecation_warnings == false then
vim.deprecate = function() end

View File

@ -23,12 +23,12 @@ map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Wi
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
-- Move Lines
map("n", "<A-j>", "<cmd>execute 'move .+' . v:count1<cr>==", { desc = "Move Down" })
map("n", "<A-k>", "<cmd>execute 'move .-' . (v:count1 + 1)<cr>==", { desc = "Move Up" })
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
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-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
map("v", "<A-j>", ":<C-u>execute \"'<,'>move '>+\" . v:count1<cr>gv=gv", { desc = "Move Down" })
map("v", "<A-k>", ":<C-u>execute \"'<,'>move '<-\" . (v:count1 + 1)<cr>gv=gv", { desc = "Move Up" })
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Up" })
-- buffers
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
@ -37,12 +37,7 @@ map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next 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>bd", function()
Snacks.bufdelete()
end, { desc = "Delete Buffer" })
map("n", "<leader>bo", function()
Snacks.bufdelete.other()
end, { desc = "Delete Other Buffers" })
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>
@ -120,30 +115,38 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
-- stylua: ignore start
-- toggle options
LazyVim.format.snacks_toggle():map("<leader>uf")
LazyVim.format.snacks_toggle(true):map("<leader>uF")
Snacks.toggle.option("spell", { name = "Spelling"}):map("<leader>us")
Snacks.toggle.option("wrap", {name = "Wrap"}):map("<leader>uw")
Snacks.toggle.option("relativenumber", { name = "Relative Number"}):map("<leader>uL")
Snacks.toggle.diagnostics():map("<leader>ud")
Snacks.toggle.line_number():map("<leader>ul")
Snacks.toggle.option("conceallevel", {off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2}):map("<leader>uc")
Snacks.toggle.treesitter():map("<leader>uT")
Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background"}):map("<leader>ub")
if vim.lsp.inlay_hint then
Snacks.toggle.inlay_hints():map("<leader>uh")
map("n", "<leader>uf", function() LazyVim.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>us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" })
map("n", "<leader>uw", function() LazyVim.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() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
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" })
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
map( "n", "<leader>uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
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
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", "<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)" })
end
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
map("n", "<leader>gB", LazyVim.lazygit.browse, { desc = "Git Browse" })
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" })
map("n", "<leader>gl", function()
LazyVim.lazygit({ args = { "log" }, cwd = LazyVim.root.git() })
end, { desc = "Lazygit Log" })
map("n", "<leader>gL", function()
LazyVim.lazygit({ args = { "log" } })
end, { desc = "Lazygit Log (cwd)" })
-- quit
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
@ -156,21 +159,29 @@ map("n", "<leader>uI", "<cmd>InspectTree<cr>", { desc = "Inspect Tree" })
map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" })
-- floating terminal
map("n", "<leader>fT", function() Snacks.terminal() end, { desc = "Terminal (cwd)" })
map("n", "<leader>ft", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
map("n", "<c-/>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "Terminal (Root Dir)" })
map("n", "<c-_>", function() Snacks.terminal(nil, { cwd = LazyVim.root() }) end, { desc = "which_key_ignore" })
local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (Root Dir)" })
map("n", "<leader>fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" })
map("n", "<c-/>", lazyterm, { desc = "Terminal (Root Dir)" })
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
-- Terminal Mappings
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-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-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 = "which_key_ignore" })
-- windows
map("n", "<leader>w", "<c-w>", { desc = "Windows", 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>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>-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
LazyVim.ui.maximize():map("<leader>wm")
map("n", "<leader>wm", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" })
-- tabs
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
@ -180,13 +191,3 @@ 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

View File

@ -5,16 +5,6 @@ vim.g.maplocalleader = "\\"
-- LazyVim auto format
vim.g.autoformat = true
-- LazyVim picker to use.
-- Can be one of: telescope, fzf
-- Leave it to "auto" to automatically use the picker
-- 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`
@ -22,21 +12,29 @@ vim.g.ai_cmp = true
-- * a function with signature `function(buf) -> string|string[]`
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
-- Options for the LazyVim statuscolumn
vim.g.lazyvim_statuscolumn = {
folds_open = false, -- show fold sign when fold is open
folds_githl = false, -- highlight fold sign with git sign color
}
-- Optionally setup the terminal to use
-- This sets `vim.o.shell` and does some additional configuration for:
-- * pwsh
-- * powershell
-- LazyVim.terminal.setup("pwsh")
-- Set LSP servers to be ignored when used with `util.root.detectors.lsp`
-- for detecting the LSP root
vim.g.root_lsp_ignore = { "copilot" }
-- Hide deprecation warnings
vim.g.deprecation_warnings = false
-- Show the current document symbols location from Trouble in lualine
-- You can disable this for a buffer by setting `vim.b.trouble_lualine = false`
vim.g.trouble_lualine = true
local opt = vim.opt
@ -65,7 +63,6 @@ opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.jumpoptions = "view"
opt.laststatus = 3 -- global statusline
opt.linebreak = true -- Wrap lines at convenient points
opt.list = true -- Show some invisible characters (tabs...
@ -74,7 +71,6 @@ opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.ruler = false -- Disable the default ruler
opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
opt.shiftround = true -- Round indent
@ -86,10 +82,11 @@ opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift t
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" }
opt.spelloptions:append("noplainbuffer")
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.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
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

View File

@ -23,29 +23,24 @@ return {
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local cmp = require("cmp")
local defaults = require("cmp.config.default")()
local auto_select = true
return {
auto_brackets = {}, -- configure any filetype to auto add brackets
completion = {
completeopt = "menu,menuone,noinsert" .. (auto_select and "" or ",noselect"),
completeopt = "menu,menuone,noinsert",
},
preselect = auto_select and cmp.PreselectMode.Item or cmp.PreselectMode.None,
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = LazyVim.cmp.confirm({ select = auto_select }),
["<C-y>"] = LazyVim.cmp.confirm({ select = true }),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = LazyVim.cmp.confirm(),
["<S-CR>"] = LazyVim.cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<C-CR>"] = function(fallback)
cmp.abort()
fallback()
end,
["<tab>"] = function(fallback)
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
end,
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
@ -54,42 +49,53 @@ return {
{ name = "buffer" },
}),
formatting = {
format = function(entry, item)
local icons = LazyVim.config.icons.kinds
format = function(_, item)
local icons = require("lazyvim.config").icons.kinds
if icons[item.kind] then
item.kind = icons[item.kind] .. item.kind
end
local widths = {
abbr = vim.g.cmp_widths and vim.g.cmp_widths.abbr or 40,
menu = vim.g.cmp_widths and vim.g.cmp_widths.menu or 30,
}
for key, width in pairs(widths) do
if item[key] and vim.fn.strdisplaywidth(item[key]) > width then
item[key] = vim.fn.strcharpart(item[key], 0, width - 1) .. ""
end
end
return item
end,
},
experimental = {
-- only show ghost text when we show ai completions
ghost_text = vim.g.ai_cmp and {
ghost_text = {
hl_group = "CmpGhostText",
} or false,
},
},
sorting = defaults.sorting,
}
end,
main = "lazyvim.util.cmp",
---@param opts cmp.ConfigSchema | {auto_brackets?: string[]}
config = function(_, opts)
for _, source in ipairs(opts.sources) do
source.group_index = source.group_index or 1
end
local parse = require("cmp.utils.snippet").parse
require("cmp.utils.snippet").parse = function(input)
local ok, ret = pcall(parse, input)
if ok then
return ret
end
return LazyVim.cmp.snippet_preview(input)
end
local cmp = require("cmp")
cmp.setup(opts)
cmp.event:on("confirm_done", function(event)
if vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then
LazyVim.cmp.auto_brackets(event.entry)
end
end)
cmp.event:on("menu_opened", function(event)
LazyVim.cmp.add_missing_snippet_docs(event.window)
end)
end,
},
-- snippets
{
"nvim-cmp",
optional = true,
dependencies = {
{
"garymjr/nvim-snippets",
@ -109,6 +115,26 @@ return {
table.insert(opts.sources, { name = "snippets" })
end
end,
keys = {
{
"<Tab>",
function()
return vim.snippet.active({ direction = 1 }) and "<cmd>lua vim.snippet.jump(1)<cr>" or "<Tab>"
end,
expr = true,
silent = true,
mode = { "i", "s" },
},
{
"<S-Tab>",
function()
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<Tab>"
end,
expr = true,
silent = true,
mode = { "i", "s" },
},
},
},
-- auto pairs
@ -116,20 +142,24 @@ return {
"echasnovski/mini.pairs",
event = "VeryLazy",
opts = {
modes = { insert = true, command = true, terminal = false },
-- skip autopair when next character is one of these
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
-- skip autopair when the cursor is inside these treesitter nodes
skip_ts = { "string" },
-- skip autopair when next character is closing pair
-- and there are more closing pairs than opening pairs
skip_unbalanced = true,
-- better deal with markdown code blocks
markdown = true,
mappings = {
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } },
},
},
keys = {
{
"<leader>up",
function()
vim.g.minipairs_disable = not vim.g.minipairs_disable
if vim.g.minipairs_disable then
LazyVim.warn("Disabled auto pairs", { title = "Option" })
else
LazyVim.info("Enabled auto pairs", { title = "Option" })
end
end,
desc = "Toggle Auto Pairs",
},
},
config = function(_, opts)
LazyVim.mini.pairs(opts)
end,
},
-- comments
@ -144,6 +174,9 @@ return {
"echasnovski/mini.ai",
event = "VeryLazy",
opts = function()
LazyVim.on_load("which-key.nvim", function()
vim.schedule(LazyVim.mini.ai_whichkey)
end)
local ai = require("mini.ai")
return {
n_lines = 500,
@ -167,14 +200,6 @@ return {
},
}
end,
config = function(_, opts)
require("mini.ai").setup(opts)
LazyVim.on_load("which-key.nvim", function()
vim.schedule(function()
LazyVim.mini.ai_whichkey(opts)
end)
end)
end,
},
{
@ -185,7 +210,6 @@ return {
library = {
{ path = "luvit-meta/library", words = { "vim%.uv" } },
{ path = "LazyVim", words = { "LazyVim" } },
{ path = "snacks.nvim", words = { "Snacks" } },
{ path = "lazy.nvim", words = { "LazyVim" } },
},
},
@ -195,7 +219,6 @@ return {
-- Add lazydev source to cmp
{
"hrsh7th/nvim-cmp",
optional = true,
opts = function(_, opts)
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
end,

View File

@ -19,7 +19,6 @@ return {
cmp = true,
dashboard = true,
flash = true,
grug_far = true,
gitsigns = true,
headlines = true,
illuminate = true,
@ -50,16 +49,5 @@ return {
which_key = true,
},
},
specs = {
{
"akinsho/bufferline.nvim",
optional = true,
opts = function(_, opts)
if (vim.g.colors_name or ""):find("catppuccin") then
opts.highlights = require("catppuccin.groups.integrations.bufferline").get()
end
end,
},
},
},
}

View File

@ -26,13 +26,4 @@ return {
"neovim/nvim-lspconfig",
dependencies = {},
},
-- dummy import to save core imports
{
import = "foobar",
enabled = function()
LazyVim.plugin.save_core()
return false
end,
},
}

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +0,0 @@
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",
optional = true,
dependencies = { "codeium.nvim" },
opts = function(_, opts)
table.insert(opts.sources, 1, {
name = "codeium",
group_index = 1,
priority = 100,
})
end,
},
{
"nvim-lualine/lualine.nvim",
optional = true,
event = "VeryLazy",
opts = function(_, opts)
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,
},
},
}

View File

@ -1,124 +0,0 @@
return {
recommended = true,
-- copilot
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
event = "InsertEnter",
opts = {
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,
},
},
},
-- 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)
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
end)
)
end,
},
-- copilot cmp source
{
"nvim-cmp",
optional = true,
dependencies = { -- this will only be evaluated if nvim-cmp is enabled
{
"zbirenbaum/copilot-cmp",
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()
copilot_cmp._on_insert_enter({})
end, "copilot")
end,
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,
},
},
},
},
},
-- 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" },
},
},
},
},
},
},
},
},
}

View File

@ -1,107 +0,0 @@
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,
},
}

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