Compare commits
8 Commits
v12.28.0
...
pickers_re
Author | SHA1 | Date | |
---|---|---|---|
8c3f9fd497 | |||
f608564517 | |||
3b0810c003 | |||
ef0d55e651 | |||
1f97b9d120 | |||
db8e0f7d35 | |||
ff223e7347 | |||
b2b6ff0738 |
3
.github/.release-please-manifest.json
vendored
3
.github/.release-please-manifest.json
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
".": "12.28.0"
|
||||
}
|
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -6,7 +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?
|
||||
@ -75,7 +75,7 @@ body:
|
||||
-- install plugins
|
||||
local plugins = {
|
||||
"folke/tokyonight.nvim",
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
"folke/LazyVim",
|
||||
-- add any other plugins here
|
||||
}
|
||||
require("lazy").setup(plugins, {
|
||||
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -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
|
||||
|
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,19 +1,15 @@
|
||||
## Description
|
||||
## What is this PR for?
|
||||
|
||||
<!-- Describe the big picture of your changes to communicate to the maintainers
|
||||
why we should accept this pull request. -->
|
||||
|
||||
## Related Issue(s)
|
||||
## Does this PR fix an existing issue?
|
||||
|
||||
<!--
|
||||
If this PR fixes any issues, please link to the issue here.
|
||||
- Fixes #<issue_number>
|
||||
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.
|
||||
|
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
@ -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"
|
||||
|
9
.github/release-please-config.json
vendored
9
.github/release-please-config.json
vendored
@ -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"]
|
||||
}
|
||||
}
|
||||
}
|
83
.github/workflows/ci.yml
vendored
83
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
10
.github/workflows/labeler.yml
vendored
10
.github/workflows/labeler.yml
vendored
@ -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
|
||||
|
35
.github/workflows/pr.yml
vendored
35
.github/workflows/pr.yml
vendored
@ -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
|
||||
|
25
.github/workflows/stale.yml
vendored
25
.github/workflows/stale.yml
vendored
@ -1,10 +1,27 @@
|
||||
name: Stale Issues & PRs
|
||||
name: Close stale issues and PRs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
uses: folke/github/.github/workflows/stale.yml@main
|
||||
secrets: inherit
|
||||
stale:
|
||||
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."
|
||||
|
12
.github/workflows/update.yml
vendored
12
.github/workflows/update.yml
vendored
@ -1,12 +0,0 @@
|
||||
name: Update Repo
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Run every hour
|
||||
- cron: "0 * * * *"
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
uses: folke/github/.github/workflows/update.yml@main
|
||||
secrets: inherit
|
15
.gitignore
vendored
15
.gitignore
vendored
@ -1,9 +1,8 @@
|
||||
*.log
|
||||
/.repro
|
||||
/.tests
|
||||
/build
|
||||
/debug
|
||||
/doc/tags
|
||||
foo.*
|
||||
node_modules
|
||||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
|
332
CHANGELOG.md
332
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -113,10 +113,6 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
|
||||
|
||||
[](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 下的文件会在适当的时候自动加载,所以你不需要手动引入这些文件。
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim Last change: 2024 July 12
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 12
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -67,7 +67,6 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
"neotest-summary",
|
||||
"neotest-output-panel",
|
||||
"dbout",
|
||||
"gitsigns.blame",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
@ -87,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
|
||||
@ -114,29 +113,3 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*"] = {
|
||||
function(path, buf)
|
||||
return vim.bo[buf]
|
||||
and vim.bo[buf].filetype ~= "bigfile"
|
||||
and path
|
||||
and vim.fn.getfsize(path) > vim.g.bigfile_size
|
||||
and "bigfile"
|
||||
or nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = augroup("bigfile"),
|
||||
pattern = "bigfile",
|
||||
callback = function(ev)
|
||||
vim.b.minianimate_disable = true
|
||||
vim.schedule(function()
|
||||
vim.bo[ev.buf].syntax = vim.filetype.match({ buf = ev.buf }) or ""
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
||||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "12.28.0" -- x-release-please-version
|
||||
M.version = "10.21.1" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
@ -136,7 +136,6 @@ local defaults = {
|
||||
|
||||
M.json = {
|
||||
version = 6,
|
||||
path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json",
|
||||
data = {
|
||||
version = nil, ---@type string?
|
||||
news = {}, ---@type table<string, string>
|
||||
@ -145,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()
|
||||
@ -248,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
|
||||
|
||||
|
@ -5,12 +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"
|
||||
|
||||
-- LazyVim root dir detection
|
||||
-- Each entry can be:
|
||||
-- * the name of a detector function like `lsp` or `cwd`
|
||||
@ -40,12 +34,6 @@ vim.g.lazyvim_statuscolumn = {
|
||||
-- Hide deprecation warnings
|
||||
vim.g.deprecation_warnings = false
|
||||
|
||||
-- Set filetype to `bigfile` for files larger than 1.5 MB
|
||||
-- Only vim syntax will be enabled (with the correct filetype)
|
||||
-- LSP, treesitter and other ft plugins will be disabled.
|
||||
-- mini.animate will also be disabled.
|
||||
vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB
|
||||
|
||||
-- Show the current document symbols location from Trouble in lualine
|
||||
vim.g.trouble_lualine = true
|
||||
|
||||
@ -75,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...
|
||||
|
@ -23,19 +23,19 @@ 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-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()
|
||||
@ -49,23 +49,11 @@ 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,
|
||||
},
|
||||
@ -77,7 +65,32 @@ return {
|
||||
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
|
||||
@ -115,7 +128,7 @@ return {
|
||||
{
|
||||
"<S-Tab>",
|
||||
function()
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<S-Tab>"
|
||||
return vim.snippet.active({ direction = -1 }) and "<cmd>lua vim.snippet.jump(-1)<cr>" or "<Tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
@ -129,16 +142,9 @@ 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 = {
|
||||
{
|
||||
@ -154,9 +160,6 @@ return {
|
||||
desc = "Toggle Auto Pairs",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
LazyVim.mini.pairs(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
-- comments
|
||||
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
@ -1,8 +1,12 @@
|
||||
local have_make = vim.fn.executable("make") == 1
|
||||
local have_cmake = vim.fn.executable("cmake") == 1
|
||||
|
||||
return {
|
||||
|
||||
-- file explorer
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
cmd = "Neotree",
|
||||
keys = {
|
||||
{
|
||||
@ -59,7 +63,7 @@ return {
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
sources = { "filesystem", "buffers", "git_status" },
|
||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||
filesystem = {
|
||||
bind_to_cwd = false,
|
||||
@ -162,47 +166,32 @@ return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts_extend = { "spec" },
|
||||
opts = {
|
||||
defaults = {},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
{ "<leader><tab>", group = "tabs" },
|
||||
{ "<leader>b", group = "buffer" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>f", group = "file/find" },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>gh", group = "hunks" },
|
||||
{ "<leader>q", group = "quit/session" },
|
||||
{ "<leader>s", group = "search" },
|
||||
{ "<leader>u", group = "ui" },
|
||||
{ "<leader>w", group = "windows" },
|
||||
{ "<leader>x", group = "diagnostics/quickfix" },
|
||||
{ "[", group = "prev" },
|
||||
{ "]", group = "next" },
|
||||
{ "g", group = "goto" },
|
||||
{ "gs", group = "surround" },
|
||||
{ "z", group = "fold" },
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
plugins = { spelling = true },
|
||||
defaults = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gs"] = { name = "+surround" },
|
||||
["z"] = { name = "+fold" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
wk.setup(opts)
|
||||
if not vim.tbl_isempty(opts.defaults) then
|
||||
LazyVim.warn("which-key: opts.defaults is deprecated. Please use opts.spec instead.")
|
||||
wk.register(opts.defaults)
|
||||
end
|
||||
wk.register(opts.defaults)
|
||||
end,
|
||||
},
|
||||
|
||||
@ -221,13 +210,6 @@ return {
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
},
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
@ -236,20 +218,8 @@ return {
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "]h", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "]c", bang = true })
|
||||
else
|
||||
gs.nav_hunk("next")
|
||||
end
|
||||
end, "Next Hunk")
|
||||
map("n", "[h", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "[c", bang = true })
|
||||
else
|
||||
gs.nav_hunk("prev")
|
||||
end
|
||||
end, "Prev Hunk")
|
||||
map("n", "]h", function() gs.nav_hunk("next") end, "Next Hunk")
|
||||
map("n", "[h", function() gs.nav_hunk("prev") end, "Prev Hunk")
|
||||
map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
|
||||
map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
|
||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
@ -259,7 +229,6 @@ return {
|
||||
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
|
||||
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||
map("n", "<leader>ghB", function() gs.blame() end, "Blame Buffer")
|
||||
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
||||
@ -270,19 +239,17 @@ return {
|
||||
-- better diagnostics list and others
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "Trouble" },
|
||||
opts = {
|
||||
modes = {
|
||||
lsp = {
|
||||
win = { position = "right" },
|
||||
},
|
||||
},
|
||||
},
|
||||
cmd = { "TroubleToggle", "Trouble" },
|
||||
opts = { use_diagnostic_signs = true },
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
|
||||
{ "<leader>cs", "<cmd>Trouble symbols toggle<cr>", desc = "Symbols (Trouble)" },
|
||||
{ "<leader>cS", "<cmd>Trouble lsp toggle<cr>", desc = "LSP references/definitions/... (Trouble)" },
|
||||
{ "<leader>cs", "<cmd>Trouble symbols toggle focus=false<cr>", desc = "Symbols (Trouble)" },
|
||||
{
|
||||
"<leader>cS",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP references/definitions/... (Trouble)",
|
||||
},
|
||||
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{
|
||||
@ -337,13 +304,13 @@ return {
|
||||
{
|
||||
import = "lazyvim.plugins.extras.editor.fzf",
|
||||
enabled = function()
|
||||
return LazyVim.pick.want() == "fzf"
|
||||
return LazyVim.has_extra("editor.fzf")
|
||||
end,
|
||||
},
|
||||
{
|
||||
import = "lazyvim.plugins.extras.editor.telescope",
|
||||
enabled = function()
|
||||
return LazyVim.pick.want() == "telescope"
|
||||
return not LazyVim.has_extra("editor.fzf")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ return {
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{ "<c-s>", "<CR>", ft = "copilot-chat", desc = "Submit Prompt", remap = true },
|
||||
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
||||
{
|
||||
"<leader>aa",
|
||||
|
@ -27,7 +27,7 @@ return {
|
||||
}
|
||||
table.insert(opts.sections.lualine_x, 2, {
|
||||
function()
|
||||
local icon = LazyVim.config.icons.kinds.Copilot
|
||||
local icon = require("lazyvim.config").icons.kinds.Copilot
|
||||
local status = require("copilot.api").status.data
|
||||
return icon .. (status.message or "")
|
||||
end,
|
||||
|
@ -42,7 +42,7 @@ return {
|
||||
optional = true,
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local icon = LazyVim.config.icons.kinds.TabNine
|
||||
local icon = require("lazyvim.config").icons.kinds.TabNine
|
||||
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("cmp_tabnine", icon))
|
||||
end,
|
||||
},
|
||||
|
@ -17,7 +17,33 @@ return {
|
||||
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",
|
||||
|
||||
dependencies = {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
|
||||
-- fancy UI for the debugger
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = { "nvim-neotest/nvim-nio" },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
|
||||
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup(opts)
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- virtual text for the debugger
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
@ -48,14 +74,10 @@ return {
|
||||
},
|
||||
|
||||
config = function()
|
||||
-- load mason-nvim-dap here, after all adapters have been setup
|
||||
if LazyVim.has("mason-nvim-dap.nvim") then
|
||||
require("mason-nvim-dap").setup(LazyVim.opts("mason-nvim-dap.nvim"))
|
||||
end
|
||||
|
||||
local Config = require("lazyvim.config")
|
||||
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
|
||||
|
||||
for name, sign in pairs(LazyVim.config.icons.dap) do
|
||||
for name, sign in pairs(Config.icons.dap) do
|
||||
sign = type(sign) == "table" and sign or { sign }
|
||||
vim.fn.sign_define(
|
||||
"Dap" .. name,
|
||||
@ -72,32 +94,6 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- fancy UI for the debugger
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = { "nvim-neotest/nvim-nio" },
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
|
||||
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
|
||||
},
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup(opts)
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- mason.nvim integration
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
@ -118,7 +114,5 @@ return {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
},
|
||||
},
|
||||
-- mason-nvim-dap is loaded when nvim-dap loads
|
||||
config = function() end,
|
||||
},
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
local Config = require("lazyvim.config")
|
||||
|
||||
return {
|
||||
desc = "Aerial Symbol Browser",
|
||||
{
|
||||
"stevearc/aerial.nvim",
|
||||
event = "LazyFile",
|
||||
opts = function()
|
||||
local icons = vim.deepcopy(LazyVim.config.icons.kinds)
|
||||
local icons = vim.deepcopy(Config.icons.kinds)
|
||||
|
||||
-- HACK: fix lua's weird choice for `Package` for control
|
||||
-- structures like if/else/for/etc.
|
||||
@ -12,8 +14,8 @@ return {
|
||||
|
||||
---@type table<string, string[]>|false
|
||||
local filter_kind = false
|
||||
if LazyVim.config.kind_filter then
|
||||
filter_kind = assert(vim.deepcopy(LazyVim.config.kind_filter))
|
||||
if Config.kind_filter then
|
||||
filter_kind = assert(vim.deepcopy(Config.kind_filter))
|
||||
filter_kind._ = filter_kind.default
|
||||
filter_kind.default = nil
|
||||
end
|
||||
|
@ -1,4 +1,6 @@
|
||||
local M = {}
|
||||
---@type table<string, table<string, string[]>>
|
||||
M.dials_by_ft = {}
|
||||
|
||||
---@param increment boolean
|
||||
---@param g? boolean
|
||||
@ -7,7 +9,7 @@ function M.dial(increment, g)
|
||||
-- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22'
|
||||
local is_visual = mode == "v" or mode == "V" or mode == "\22"
|
||||
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
|
||||
local group = vim.g.dials_by_ft[vim.bo.filetype] or "default"
|
||||
local group = M.dials_by_ft[vim.bo.filetype] or "default"
|
||||
return require("dial.map")[func](group)
|
||||
end
|
||||
|
||||
@ -108,26 +110,21 @@ return {
|
||||
scss = "css",
|
||||
typescript = "typescript",
|
||||
typescriptreact = "typescript",
|
||||
yaml = "yaml",
|
||||
},
|
||||
groups = {
|
||||
default = {
|
||||
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
|
||||
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
|
||||
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
logical_alias,
|
||||
augend.constant.new({ elements = { "let", "const" } }),
|
||||
},
|
||||
yaml = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
css = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
@ -140,6 +137,9 @@ return {
|
||||
},
|
||||
markdown = {
|
||||
augend.misc.alias.markdown_header,
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
json = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
@ -153,17 +153,23 @@ return {
|
||||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
cyclic = true, -- "or" is incremented into "and".
|
||||
}),
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
python = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
capitalized_boolean,
|
||||
logical_alias,
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("dial.config").augends:register_group(opts.groups)
|
||||
vim.g.dials_by_ft = opts.dials_by_ft
|
||||
M.dials_by_ft = opts.dials_by_ft
|
||||
end,
|
||||
}
|
||||
|
@ -1,9 +1,3 @@
|
||||
if lazyvim_docs then
|
||||
-- In case you don't want to use `:LazyExtras`,
|
||||
-- then you need to set the option below.
|
||||
vim.g.lazyvim_picker = "fzf"
|
||||
end
|
||||
|
||||
---@class FzfLuaOpts: lazyvim.util.pick.Opts
|
||||
---@field cmd string?
|
||||
|
||||
@ -30,7 +24,7 @@ end
|
||||
|
||||
local function symbols_filter(entry, ctx)
|
||||
if ctx.symbols_filter == nil then
|
||||
ctx.symbols_filter = LazyVim.config.get_kind_filter(ctx.bufnr) or false
|
||||
ctx.symbols_filter = require("lazyvim.config").get_kind_filter(ctx.bufnr) or false
|
||||
end
|
||||
if ctx.symbols_filter == false then
|
||||
return true
|
||||
@ -43,7 +37,7 @@ return {
|
||||
recommended = true,
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
cmd = "FzfLua",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local config = require("fzf-lua.config")
|
||||
local actions = require("fzf-lua.actions")
|
||||
@ -53,15 +47,11 @@ return {
|
||||
config.defaults.keymap.fzf["ctrl-u"] = "half-page-up"
|
||||
config.defaults.keymap.fzf["ctrl-d"] = "half-page-down"
|
||||
config.defaults.keymap.fzf["ctrl-x"] = "jump"
|
||||
config.defaults.keymap.fzf["ctrl-f"] = "preview-page-down"
|
||||
config.defaults.keymap.fzf["ctrl-b"] = "preview-page-up"
|
||||
config.defaults.keymap.builtin["<c-f>"] = "preview-page-down"
|
||||
config.defaults.keymap.builtin["<c-b>"] = "preview-page-up"
|
||||
|
||||
-- Trouble
|
||||
if LazyVim.has("trouble.nvim") then
|
||||
config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open
|
||||
end
|
||||
config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open
|
||||
|
||||
-- Toggle root dir / cwd
|
||||
config.defaults.actions.files["ctrl-r"] = function(_, ctx)
|
||||
@ -86,19 +76,7 @@ return {
|
||||
end
|
||||
fix(defaults)
|
||||
|
||||
local img_previewer ---@type string[]?
|
||||
for _, v in ipairs({
|
||||
{ cmd = "ueberzug", args = {} },
|
||||
{ cmd = "chafa", args = { "{file}", "--format=symbols" } },
|
||||
{ cmd = "viu", args = { "-b" } },
|
||||
}) do
|
||||
if vim.fn.executable(v.cmd) == 1 then
|
||||
img_previewer = vim.list_extend({ v.cmd }, v.args)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
return vim.tbl_deep_extend("force", defaults, {
|
||||
return vim.tbl_deep_extend("force", opts, defaults, {
|
||||
fzf_colors = true,
|
||||
fzf_opts = {
|
||||
["--no-scrollbar"] = true,
|
||||
@ -107,46 +85,20 @@ return {
|
||||
-- formatter = "path.filename_first",
|
||||
formatter = "path.dirname_first",
|
||||
},
|
||||
previewers = {
|
||||
builtin = {
|
||||
extensions = {
|
||||
["png"] = img_previewer,
|
||||
["jpg"] = img_previewer,
|
||||
["jpeg"] = img_previewer,
|
||||
["gif"] = img_previewer,
|
||||
["webp"] = img_previewer,
|
||||
},
|
||||
ueberzug_scaler = "fit_contain",
|
||||
},
|
||||
},
|
||||
-- Custom LazyVim option to configure vim.ui.select
|
||||
ui_select = function(fzf_opts, items)
|
||||
local title = vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", ""))
|
||||
local width, height ---@type number?, number?
|
||||
if fzf_opts.kind ~= "codeaction" then
|
||||
width, height = 0.5, math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5)
|
||||
end
|
||||
return vim.tbl_deep_extend("force", fzf_opts, {
|
||||
prompt = " ",
|
||||
winopts = {
|
||||
title = " " .. vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", "")) .. " ",
|
||||
title = " " .. title .. " ",
|
||||
title_pos = "center",
|
||||
},
|
||||
}, fzf_opts.kind == "codeaction" and {
|
||||
winopts = {
|
||||
layout = "vertical",
|
||||
-- height is number of items minus 15 lines for the preview, with a max of 80% screen height
|
||||
height = math.floor(math.min(vim.o.lines * 0.8 - 16, #items + 2) + 0.5) + 16,
|
||||
width = 0.5,
|
||||
preview = not vim.tbl_isempty(LazyVim.lsp.get_clients({ bufnr = 0, name = "vtsls" })) and {
|
||||
layout = "vertical",
|
||||
vertical = "down:15,border-top",
|
||||
hidden = "hidden",
|
||||
} or {
|
||||
layout = "vertical",
|
||||
vertical = "down:15,border-top",
|
||||
},
|
||||
},
|
||||
} or {
|
||||
winopts = {
|
||||
width = 0.5,
|
||||
-- height is number of items, with a max of 80% screen height
|
||||
height = math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5),
|
||||
width = width,
|
||||
height = height,
|
||||
},
|
||||
})
|
||||
end,
|
||||
@ -190,20 +142,12 @@ return {
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("fzf-lua").setup(opts)
|
||||
end,
|
||||
init = function()
|
||||
LazyVim.on_very_lazy(function()
|
||||
vim.ui.select = function(...)
|
||||
require("lazy").load({ plugins = { "fzf-lua" } })
|
||||
local opts = LazyVim.opts("fzf-lua") or {}
|
||||
require("fzf-lua").register_ui_select(opts.ui_select or nil)
|
||||
return vim.ui.select(...)
|
||||
end
|
||||
end)
|
||||
require("fzf-lua").register_ui_select(opts.ui_select or nil)
|
||||
end,
|
||||
keys = {
|
||||
{ "<c-j>", "<c-j>", ft = "fzf", mode = "t", nowait = true },
|
||||
{ "<c-k>", "<c-k>", ft = "fzf", mode = "t", nowait = true },
|
||||
{ "<esc>", "<cmd>close<cr>", ft = "fzf", mode = "t", nowait = true },
|
||||
{ "<c-j>", "<Down>", ft = "fzf", mode = "t", nowait = true },
|
||||
{ "<c-k>", "<Up>", ft = "fzf", mode = "t", nowait = true },
|
||||
{
|
||||
"<leader>,",
|
||||
"<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>",
|
||||
|
@ -18,7 +18,7 @@ return {
|
||||
separator = " ",
|
||||
highlight = true,
|
||||
depth_limit = 5,
|
||||
icons = LazyVim.config.icons.kinds,
|
||||
icons = require("lazyvim.config").icons.kinds,
|
||||
lazy_update_context = true,
|
||||
}
|
||||
end,
|
||||
|
@ -12,23 +12,27 @@ return {
|
||||
keys = { { "<leader>cs", "<cmd>Outline<cr>", desc = "Toggle Outline" } },
|
||||
cmd = "Outline",
|
||||
opts = function()
|
||||
local Config = require("lazyvim.config")
|
||||
local defaults = require("outline.config").defaults
|
||||
local opts = {
|
||||
symbols = {
|
||||
icons = {},
|
||||
filter = vim.deepcopy(LazyVim.config.kind_filter),
|
||||
},
|
||||
keymaps = {
|
||||
up_and_jump = "<up>",
|
||||
down_and_jump = "<down>",
|
||||
},
|
||||
symbols = {},
|
||||
symbol_blacklist = {},
|
||||
}
|
||||
local filter = Config.kind_filter
|
||||
|
||||
for kind, symbol in pairs(defaults.symbols.icons) do
|
||||
opts.symbols.icons[kind] = {
|
||||
icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
|
||||
hl = symbol.hl,
|
||||
}
|
||||
if type(filter) == "table" then
|
||||
filter = filter.default
|
||||
if type(filter) == "table" then
|
||||
for kind, symbol in pairs(defaults.symbols) do
|
||||
opts.symbols[kind] = {
|
||||
icon = Config.icons.kinds[kind] or symbol.icon,
|
||||
hl = symbol.hl,
|
||||
}
|
||||
if not vim.tbl_contains(filter, kind) then
|
||||
table.insert(opts.symbol_blacklist, kind)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user