Merge branch 'main' into main

This commit is contained in:
Nybkox 2024-07-09 15:17:00 +02:00 committed by GitHub
commit 565ef6ac0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 486 additions and 217 deletions

View file

@ -1,3 +1,3 @@
{ {
".": "12.22.1" ".": "12.27.0"
} }

View file

@ -6,7 +6,7 @@ body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
**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. **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.
- type: checkboxes - type: checkboxes
attributes: attributes:
label: Did you check docs and existing issues? label: Did you check docs and existing issues?

View file

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

View file

@ -1,15 +1,19 @@
## What is this PR for? ## Description
<!-- Describe the big picture of your changes to communicate to the maintainers <!-- Describe the big picture of your changes to communicate to the maintainers
why we should accept this pull request. --> why we should accept this pull request. -->
## Does this PR fix an existing issue? ## Related Issue(s)
<!-- <!--
If this PR fixes any issues, please link to the issue here. 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 ## Checklist
- [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.

View file

@ -1,11 +1,6 @@
# 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 version: 2
updates: updates:
- package-ecosystem: "github-actions" # See documentation for possible values - package-ecosystem: "github-actions"
directory: "/" # Location of package manifests directory: "/"
schedule: schedule:
interval: "weekly" interval: "weekly"

View file

@ -1,78 +1,14 @@
name: CI name: CI
on: on:
push: push:
branches: [main, master]
pull_request: pull_request:
jobs: jobs:
stylua: ci:
name: Stylua Formatting uses: folke/github/.github/workflows/ci.yml@main
runs-on: ubuntu-latest secrets: inherit
steps: with:
- uses: actions/checkout@v4 plugin: LazyVim
- uses: JohnnyMorganz/stylua-action@v4 repo: LazyVim/LazyVim
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
tests:
runs-on: ubuntu-latest
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' && github.repository_owner == 'LazyVim' }}
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' && github.repository_owner == 'LazyVim' }}
needs:
- docs
- tests
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
- 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,12 +1,8 @@
name: "Pull Request Labeler" name: "PR Labeler"
on: on:
- pull_request_target - pull_request_target
jobs: jobs:
labeler: labeler:
permissions: uses: folke/github/.github/workflows/labeler.yml@main
contents: read secrets: inherit
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5

View file

@ -1,4 +1,4 @@
name: "Lint PR" name: PR Title
on: on:
pull_request_target: pull_request_target:
@ -6,36 +6,13 @@ on:
- opened - opened
- edited - edited
- synchronize - synchronize
- reopened
- ready_for_review
permissions: permissions:
pull-requests: read pull-requests: read
jobs: jobs:
main: pr-title:
name: Validate PR title uses: folke/github/.github/workflows/pr.yml@main
runs-on: ubuntu-latest secrets: inherit
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,27 +1,10 @@
name: Close stale issues and PRs name: Stale Issues & PRs
on: on:
workflow_dispatch:
schedule: schedule:
- cron: "30 1 * * *" - cron: "30 1 * * *"
jobs: jobs:
stale: ci:
runs-on: ubuntu-latest uses: folke/github/.github/workflows/stale.yml@main
steps: secrets: inherit
- 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 Normal file
View file

@ -0,0 +1,12 @@
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
View file

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

View file

@ -1,5 +1,94 @@
# Changelog # Changelog
## [12.27.0](https://github.com/LazyVim/LazyVim/compare/v12.26.2...v12.27.0) (2024-07-07)
### Features
* **icons:** provide language specific icons in extras ([#3931](https://github.com/LazyVim/LazyVim/issues/3931)) ([aa418a2](https://github.com/LazyVim/LazyVim/commit/aa418a2147f52fbe3225aced3a0e7638cf15ea78))
* **java:** allow overriding test config ([#3891](https://github.com/LazyVim/LazyVim/issues/3891)) ([8b2eacb](https://github.com/LazyVim/LazyVim/commit/8b2eacb6ac2a8df3c9eaba69fbce34abc3666ec1))
### Bug Fixes
* **fzf-lua:** move register_select to lazy init ([33e1da5](https://github.com/LazyVim/LazyVim/commit/33e1da585d8709bcf6c076e80a73b55ef70a9443))
* **lazygit:** improve git browse ([#3941](https://github.com/LazyVim/LazyVim/issues/3941)) ([28805d1](https://github.com/LazyVim/LazyVim/commit/28805d1a4c09b8dccbac8db4f7c6576a29abbd40))
## [12.26.2](https://github.com/LazyVim/LazyVim/compare/v12.26.1...v12.26.2) (2024-07-07)
### Bug Fixes
* **lualine:** check that trouble is installed ([d108169](https://github.com/LazyVim/LazyVim/commit/d108169e951fff8c65ed8dea89b058717cc48da5))
## [12.26.1](https://github.com/LazyVim/LazyVim/compare/v12.26.0...v12.26.1) (2024-07-06)
### Bug Fixes
* **lualine:** use the new ministarter file type to disable in mini.starter ([#3929](https://github.com/LazyVim/LazyVim/issues/3929)) ([330d2e4](https://github.com/LazyVim/LazyVim/commit/330d2e470b79eb31f884685b331d5d255776de90))
* **mini.starter:** lazyvim startuptime in mini.starter ([#3935](https://github.com/LazyVim/LazyVim/issues/3935)) ([5f952bb](https://github.com/LazyVim/LazyVim/commit/5f952bb9d6927bdc6a4411dc6b1002fa47b3371d))
## [12.26.0](https://github.com/LazyVim/LazyVim/compare/v12.25.0...v12.26.0) (2024-07-05)
### Features
* **dial:** yaml support ([f64bbd2](https://github.com/LazyVim/LazyVim/commit/f64bbd29fb279ba672ce1fc9a79b06ecc4237c87))
* **util:** rest-client ([#3915](https://github.com/LazyVim/LazyVim/issues/3915)) ([76b41cd](https://github.com/LazyVim/LazyVim/commit/76b41cdec421668dd8078e43184674c783554044))
* **vue:** enabled hybrid mode to avoid 2 typescript lsp running at same time ([#3908](https://github.com/LazyVim/LazyVim/issues/3908)) ([4b0f720](https://github.com/LazyVim/LazyVim/commit/4b0f720457fbbf624406a540b42e9ad7f2e50a77))
### Bug Fixes
* **dial:** move date related augends to default group ([#3927](https://github.com/LazyVim/LazyVim/issues/3927)) ([4192d95](https://github.com/LazyVim/LazyVim/commit/4192d9578d1946deba76efd1a0ec36e4ba0e1bbf))
* **outline:** use the correct symbols and filter config format ([#3924](https://github.com/LazyVim/LazyVim/issues/3924)) ([502dac1](https://github.com/LazyVim/LazyVim/commit/502dac1d9aed71aaa9be8c08a4312622742d47f3))
* **project:** properly close window after changing directory ([#3919](https://github.com/LazyVim/LazyVim/issues/3919)) ([51e99df](https://github.com/LazyVim/LazyVim/commit/51e99dfba104af54947dcb960f277d739db4280c))
## [12.25.0](https://github.com/LazyVim/LazyVim/compare/v12.24.0...v12.25.0) (2024-07-04)
### Features
* **erlang:** add Erlang language ([#3911](https://github.com/LazyVim/LazyVim/issues/3911)) ([9c7d3dc](https://github.com/LazyVim/LazyVim/commit/9c7d3dc75e4ecafe8a6dd6ee8fef0bd7711550ac))
* **fzf-lua:** preview keymaps for git ([#3904](https://github.com/LazyVim/LazyVim/issues/3904)) ([d5f3d39](https://github.com/LazyVim/LazyVim/commit/d5f3d395f490a252125044d0918267eb18298532))
* **ui:** use `mini.icons` instead of `nvim-wev-devicons` ([#3899](https://github.com/LazyVim/LazyVim/issues/3899)) ([045faec](https://github.com/LazyVim/LazyVim/commit/045faec0351ff9a38fda1af9b06bd7f948e84d28))
### Bug Fixes
* **fzf:** make sure `vim.ui.select` works when fzf is not loaded yet ([9acadc7](https://github.com/LazyVim/LazyVim/commit/9acadc7ec289966cf8f4f6c37c348f286ed73ffe))
## [12.24.0](https://github.com/LazyVim/LazyVim/compare/v12.23.0...v12.24.0) (2024-07-03)
### Features
* **options:** jumpoptions=view ([fe3d0da](https://github.com/LazyVim/LazyVim/commit/fe3d0da5087ecadfee8922fa363d3e84c0ba3461))
### Bug Fixes
* **dials:** dials.nvim stopped working after making changes to plugin files ([455557c](https://github.com/LazyVim/LazyVim/commit/455557c1f693c6ced946de2322beceb555161417))
### Performance Improvements
* **fzf:** lazy-load fzf-lua ([b9a8a4a](https://github.com/LazyVim/LazyVim/commit/b9a8a4ad7f39c8ed3f4febb25dabc9ae24110f98))
## [12.23.0](https://github.com/LazyVim/LazyVim/compare/v12.22.1...v12.23.0) (2024-07-03)
### Features
* **cmp:** attempt for dynamic width and trimming between fields ([#3873](https://github.com/LazyVim/LazyVim/issues/3873)) ([78cf6ee](https://github.com/LazyVim/LazyVim/commit/78cf6ee024cbf6a17dc8406555eb131994cd8b63))
### Bug Fixes
* **chezmoi:** missing support for fzf file picker ([#3888](https://github.com/LazyVim/LazyVim/issues/3888)) ([2114a66](https://github.com/LazyVim/LazyVim/commit/2114a6610f6fc6dea2e4937171429252641bd27d))
* **neo-tree:** remove `branch`, since it obstructs updating to latest version ([#3871](https://github.com/LazyVim/LazyVim/issues/3871)) ([d23731c](https://github.com/LazyVim/LazyVim/commit/d23731c50d149769799d90ae8ec4969a79db3628))
## [12.22.1](https://github.com/LazyVim/LazyVim/compare/v12.22.0...v12.22.1) (2024-06-30) ## [12.22.1](https://github.com/LazyVim/LazyVim/compare/v12.22.0...v12.22.1) (2024-06-30)

View file

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 30 *LazyVim.txt* For Neovim Last change: 2024 July 08
============================================================================== ==============================================================================
Table of Contents *LazyVim-table-of-contents* Table of Contents *LazyVim-table-of-contents*

View file

@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions ---@class LazyVimConfig: LazyVimOptions
local M = {} local M = {}
M.version = "12.22.1" -- x-release-please-version M.version = "12.27.0" -- x-release-please-version
LazyVim.config = M LazyVim.config = M
---@class LazyVimOptions ---@class LazyVimOptions
@ -248,16 +248,17 @@ function M.load(name)
end, { msg = "Failed loading " .. mod }) end, { msg = "Failed loading " .. mod })
end end
end end
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
-- always load lazyvim, then user file -- always load lazyvim, then user file
if M.defaults[name] or name == "options" then if M.defaults[name] or name == "options" then
_load("lazyvim.config." .. name) _load("lazyvim.config." .. name)
vim.api.nvim_exec_autocmds("User", { pattern = pattern .. "Defaults", modeline = false })
end end
_load("config." .. name) _load("config." .. name)
if vim.bo.filetype == "lazy" then if vim.bo.filetype == "lazy" then
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here -- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
vim.cmd([[do VimResized]]) vim.cmd([[do VimResized]])
end end
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
vim.api.nvim_exec_autocmds("User", { pattern = pattern, modeline = false }) vim.api.nvim_exec_autocmds("User", { pattern = pattern, modeline = false })
end end

View file

@ -75,6 +75,7 @@ opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep" opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute opt.inccommand = "nosplit" -- preview incremental substitute
opt.jumpoptions = "view"
opt.laststatus = 3 -- global statusline opt.laststatus = 3 -- global statusline
opt.linebreak = true -- Wrap lines at convenient points opt.linebreak = true -- Wrap lines at convenient points
opt.list = true -- Show some invisible characters (tabs... opt.list = true -- Show some invisible characters (tabs...

View file

@ -54,9 +54,18 @@ return {
if icons[item.kind] then if icons[item.kind] then
item.kind = icons[item.kind] .. item.kind item.kind = icons[item.kind] .. item.kind
end end
if entry.context.filetype == "rust" then
item.menu = nil 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 end
return item return item
end, end,
}, },

View file

@ -256,16 +256,18 @@ return {
{ {
"folke/trouble.nvim", "folke/trouble.nvim",
cmd = { "Trouble" }, cmd = { "Trouble" },
opts = {}, opts = {
modes = {
lsp = {
win = { position = "right" },
},
},
},
keys = { keys = {
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" }, { "<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>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
{ "<leader>cs", "<cmd>Trouble symbols toggle focus=false<cr>", desc = "Symbols (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 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>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" }, { "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
{ {

View file

@ -1,6 +1,4 @@
local M = {} local M = {}
---@type table<string, table<string, string[]>>
M.dials_by_ft = {}
---@param increment boolean ---@param increment boolean
---@param g? boolean ---@param g? boolean
@ -9,7 +7,7 @@ function M.dial(increment, g)
-- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22' -- 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 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 func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
local group = M.dials_by_ft[vim.bo.filetype] or "default" local group = vim.g.dials_by_ft[vim.bo.filetype] or "default"
return require("dial.map")[func](group) return require("dial.map")[func](group)
end end
@ -110,21 +108,26 @@ return {
scss = "css", scss = "css",
typescript = "typescript", typescript = "typescript",
typescriptreact = "typescript", typescriptreact = "typescript",
yaml = "yaml",
}, },
groups = { groups = {
default = { default = {
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
ordinal_numbers,
weekdays,
months,
}, },
typescript = { typescript = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.constant.alias.bool, -- boolean value (true <-> false) augend.constant.alias.bool, -- boolean value (true <-> false)
logical_alias, logical_alias,
augend.constant.new({ elements = { "let", "const" } }), augend.constant.new({ elements = { "let", "const" } }),
ordinal_numbers, },
weekdays, yaml = {
months, augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.constant.alias.bool, -- boolean value (true <-> false)
}, },
css = { css = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number augend.integer.alias.decimal, -- nonnegative and negative decimal number
@ -137,9 +140,6 @@ return {
}, },
markdown = { markdown = {
augend.misc.alias.markdown_header, augend.misc.alias.markdown_header,
ordinal_numbers,
weekdays,
months,
}, },
json = { json = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number augend.integer.alias.decimal, -- nonnegative and negative decimal number
@ -153,23 +153,17 @@ return {
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
cyclic = true, -- "or" is incremented into "and". cyclic = true, -- "or" is incremented into "and".
}), }),
ordinal_numbers,
weekdays,
months,
}, },
python = { python = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number augend.integer.alias.decimal, -- nonnegative and negative decimal number
capitalized_boolean, capitalized_boolean,
logical_alias, logical_alias,
ordinal_numbers,
weekdays,
months,
}, },
}, },
} }
end, end,
config = function(_, opts) config = function(_, opts)
require("dial.config").augends:register_group(opts.groups) require("dial.config").augends:register_group(opts.groups)
M.dials_by_ft = opts.dials_by_ft vim.g.dials_by_ft = opts.dials_by_ft
end, end,
} }

View file

@ -43,7 +43,7 @@ return {
recommended = true, recommended = true,
{ {
"ibhagwan/fzf-lua", "ibhagwan/fzf-lua",
event = "VeryLazy", cmd = "FzfLua",
opts = function(_, opts) opts = function(_, opts)
local config = require("fzf-lua.config") local config = require("fzf-lua.config")
local actions = require("fzf-lua.actions") local actions = require("fzf-lua.actions")
@ -53,6 +53,8 @@ return {
config.defaults.keymap.fzf["ctrl-u"] = "half-page-up" config.defaults.keymap.fzf["ctrl-u"] = "half-page-up"
config.defaults.keymap.fzf["ctrl-d"] = "half-page-down" config.defaults.keymap.fzf["ctrl-d"] = "half-page-down"
config.defaults.keymap.fzf["ctrl-x"] = "jump" 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-f>"] = "preview-page-down"
config.defaults.keymap.builtin["<c-b>"] = "preview-page-up" config.defaults.keymap.builtin["<c-b>"] = "preview-page-up"
@ -188,7 +190,16 @@ return {
end, end,
config = function(_, opts) config = function(_, opts)
require("fzf-lua").setup(opts) require("fzf-lua").setup(opts)
require("fzf-lua").register_ui_select(opts.ui_select or nil) 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)
end, end,
keys = { keys = {
{ "<c-j>", "<c-j>", ft = "fzf", mode = "t", nowait = true }, { "<c-j>", "<c-j>", ft = "fzf", mode = "t", nowait = true },

View file

@ -14,28 +14,21 @@ return {
opts = function() opts = function()
local defaults = require("outline.config").defaults local defaults = require("outline.config").defaults
local opts = { local opts = {
symbols = {}, symbols = {
symbol_blacklist = {}, icons = {},
filter = LazyVim.config.kind_filter,
},
keymaps = { keymaps = {
up_and_jump = "<up>", up_and_jump = "<up>",
down_and_jump = "<down>", down_and_jump = "<down>",
}, },
} }
local filter = LazyVim.config.kind_filter
if type(filter) == "table" then for kind, symbol in pairs(defaults.symbols.icons) do
filter = filter.default opts.symbols.icons[kind] = {
if type(filter) == "table" then icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
for kind, symbol in pairs(defaults.symbols) do hl = symbol.hl,
opts.symbols[kind] = { }
icon = LazyVim.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 end
return opts return opts
end, end,

View file

@ -0,0 +1,20 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "erlang" },
root = { "rebar.config", "erlang.mk" },
})
end,
{
"neovim/nvim-lspconfig",
opts = {
servers = {
erlangls = {},
},
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "erlang" } },
},
}

View file

@ -137,4 +137,17 @@ return {
}, },
}, },
}, },
-- Filetype icons
{
"echasnovski/mini.icons",
opts = {
file = {
[".go-version"] = { glyph = "", hl = "MiniIconsBlue" },
},
filetype = {
gotmpl = { glyph = "󰟓", hl = "MiniIconsGrey" },
},
},
},
} }

View file

@ -225,8 +225,18 @@ return {
-- custom keymaps for Java test runner (not yet compatible with neotest) -- custom keymaps for Java test runner (not yet compatible with neotest)
wk.register({ wk.register({
["<leader>t"] = { name = "+test" }, ["<leader>t"] = { name = "+test" },
["<leader>tt"] = { require("jdtls.dap").test_class, "Run All Test" }, ["<leader>tt"] = {
["<leader>tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" }, function()
require("jdtls.dap").test_class({ config_overrides = opts.test.config_overrides })
end,
"Run All Test",
},
["<leader>tr"] = {
function()
require("jdtls.dap").test_nearest_method({ config_overrides = opts.test.config_overrides })
end,
"Run Nearest Test",
},
["<leader>tT"] = { require("jdtls.dap").pick_test, "Run Test" }, ["<leader>tT"] = { require("jdtls.dap").pick_test, "Run Test" },
}, { mode = "n", buffer = args.buf }) }, { mode = "n", buffer = args.buf })
end end

View file

@ -248,4 +248,22 @@ return {
end end
end, end,
}, },
-- Filetype icons
{
"echasnovski/mini.icons",
opts = {
file = {
[".eslintrc.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" },
[".node-version"] = { glyph = "", hl = "MiniIconsGreen" },
[".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" },
[".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" },
["eslint.config.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" },
["package.json"] = { glyph = "", hl = "MiniIconsGreen" },
["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" },
["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" },
["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" },
},
},
},
} }

View file

@ -22,7 +22,7 @@ return {
volar = { volar = {
init_options = { init_options = {
vue = { vue = {
hybridMode = false, hybridMode = true,
}, },
}, },
}, },

View file

@ -69,7 +69,7 @@ return {
local pad_footer = string.rep(" ", 8) local pad_footer = string.rep(" ", 8)
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
-- INFO: based on @echasnovski's recommendation (thanks a lot!!!) -- INFO: based on @echasnovski's recommendation (thanks a lot!!!)
if vim.bo[ev.buf].filetype == "starter" then if vim.bo[ev.buf].filetype == "ministarter" then
pcall(starter.refresh) pcall(starter.refresh)
end end
end, end,

View file

@ -1,3 +1,27 @@
local pick_chezmoi = function()
if LazyVim.pick.picker.name == "telescope" then
require("telescope").extensions.chezmoi.find_files()
elseif LazyVim.pick.picker.name == "fzf" then
local fzf_lua = require("fzf-lua")
local results = require("chezmoi.commands").list()
local chezmoi = require("chezmoi.commands")
local opts = {
fzf_opts = {},
fzf_colors = true,
actions = {
["default"] = function(selected)
chezmoi.edit({
targets = { "~/" .. selected[1] },
args = { "--watch" },
})
end,
},
}
fzf_lua.fzf_exec(results, opts)
end
end
return { return {
{ {
-- highlighting for chezmoi files template files -- highlighting for chezmoi files template files
@ -12,9 +36,7 @@ return {
keys = { keys = {
{ {
"<leader>sz", "<leader>sz",
function() pick_chezmoi,
require("telescope").extensions.chezmoi.find_files()
end,
desc = "Chezmoi", desc = "Chezmoi",
}, },
}, },
@ -47,7 +69,7 @@ return {
optional = true, optional = true,
opts = function(_, opts) opts = function(_, opts)
local projects = { local projects = {
action = "Telescope chezmoi find_files", action = pick_chezmoi,
desc = " Config", desc = " Config",
icon = "", icon = "",
key = "c", key = "c",
@ -66,4 +88,24 @@ return {
table.insert(opts.config.center, 5, projects) table.insert(opts.config.center, 5, projects)
end, end,
}, },
-- Filetype icons
{
"echasnovski/mini.icons",
opts = {
file = {
[".chezmoiignore"] = { glyph = "", hl = "MiniIconsGrey" },
[".chezmoiremove"] = { glyph = "", hl = "MiniIconsGrey" },
[".chezmoiroot"] = { glyph = "", hl = "MiniIconsGrey" },
[".chezmoiversion"] = { glyph = "", hl = "MiniIconsGrey" },
["bash.tmpl"] = { glyph = "", hl = "MiniIconsGrey" },
["json.tmpl"] = { glyph = "", hl = "MiniIconsGrey" },
["ps1.tmpl"] = { glyph = "󰨊", hl = "MiniIconsGrey" },
["sh.tmpl"] = { glyph = "", hl = "MiniIconsGrey" },
["toml.tmpl"] = { glyph = "", hl = "MiniIconsGrey" },
["yaml.tmpl"] = { glyph = "", hl = "MiniIconsGrey" },
["zsh.tmpl"] = { glyph = "", hl = "MiniIconsGrey" },
},
},
},
} }

View file

@ -62,7 +62,7 @@ pick = function()
local path = selected[1] local path = selected[1]
local ok = project.set_pwd(path) local ok = project.set_pwd(path)
if ok then if ok then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true) vim.api.nvim_win_close(0, false)
LazyVim.info("Change project dir to " .. path) LazyVim.info("Change project dir to " .. path)
end end
end, end,

View file

@ -0,0 +1,25 @@
vim.filetype.add({
extension = {
["http"] = "http",
},
})
return {
{
"mistweaverco/kulala.nvim",
ft = "http",
keys = {
{ "<leader>R", "", desc = "+Rest" },
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request" },
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body" },
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request" },
{ "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", desc = "Jump to next request" },
},
opts = {},
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "http", "graphql" },
},
},
}

View file

@ -30,7 +30,7 @@ end
-- Add some vscode specific keymaps -- Add some vscode specific keymaps
vim.api.nvim_create_autocmd("User", { vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimKeymaps", pattern = "LazyVimKeymapsDefaults",
callback = function() callback = function()
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>") vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
vim.keymap.set("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]]) vim.keymap.set("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])

View file

@ -120,7 +120,7 @@ return {
options = { options = {
theme = "auto", theme = "auto",
globalstatus = vim.o.laststatus == 3, globalstatus = vim.o.laststatus == 3,
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } }, disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter" } },
}, },
sections = { sections = {
lualine_a = { "mode" }, lualine_a = { "mode" },
@ -198,7 +198,7 @@ return {
} }
-- do not add trouble symbols if aerial is enabled -- do not add trouble symbols if aerial is enabled
if vim.g.trouble_lualine then if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then
local trouble = require("trouble") local trouble = require("trouble")
local symbols = trouble.statusline local symbols = trouble.statusline
and trouble.statusline({ and trouble.statusline({
@ -303,7 +303,25 @@ return {
}, },
-- icons -- icons
{ "nvim-tree/nvim-web-devicons", lazy = true }, {
"echasnovski/mini.icons",
lazy = true,
opts = {
file = {
[".keep"] = { glyph = "󰊢", hl = "MiniIconsGrey" },
["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" },
},
filetype = {
dotenv = { glyph = "", hl = "MiniIconsYellow" },
},
},
init = function()
package.preload["nvim-web-devicons"] = function()
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
},
-- ui components -- ui components
{ "MunifTanjim/nui.nvim", lazy = true }, { "MunifTanjim/nui.nvim", lazy = true },

View file

@ -159,17 +159,43 @@ function M.blame_line(opts)
return require("lazy.util").float_cmd(cmd, opts) return require("lazy.util").float_cmd(cmd, opts)
end end
-- stylua: ignore
M.remote_patterns = {
{ "^(https?://.*)%.git$" , "%1" },
{ "^git@(.+):(.+)%.git$" , "https://%1/%2" },
{ "^git@(.+):(.+)$" , "https://%1/%2" },
{ "^git@(.+)/(.+)$" , "https://%1/%2" },
{ "^ssh://git@(.*)$" , "https://%1" },
{ "ssh%.dev%.azure%.com/v3/(.*)/(.*)$", "dev.azure.com/%1/_git/%2" },
{ "^https://%w*@(.*)" , "https://%1" },
{ "^git@(.*)" , "https://%1" },
{ ":%d+" , "" },
{ "%.git$" , "" },
}
---@param remote string
function M.get_url(remote)
local ret = remote
for _, pattern in ipairs(M.remote_patterns) do
ret = ret:gsub(pattern[1], pattern[2])
end
return ret:find("https://") == 1 and ret or ("https://%s"):format(ret)
end
function M.browse() function M.browse()
local lines = require("lazy.manage.process").exec({ "git", "remote", "-v" }) local lines = require("lazy.manage.process").exec({ "git", "remote", "-v" })
local remotes = {} ---@type {name:string, url:string}[] local remotes = {} ---@type {name:string, url:string}[]
for _, line in ipairs(lines) do for _, line in ipairs(lines) do
local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)") local name, remote = line:match("(%S+)%s+(%S+)%s+%(fetch%)")
if name and url then if name and remote then
if url:find("git@") == 1 then local url = M.get_url(remote)
url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "") if url then
table.insert(remotes, {
name = name,
url = url,
})
end end
table.insert(remotes, { name = name, url = url })
end end
end end

3
scripts/test Executable file
View file

@ -0,0 +1,3 @@
#!/bin/env bash
nvim -l tests/minit.lua --busted tests -o utfTerminal "$@"

4
selene.toml Normal file
View file

@ -0,0 +1,4 @@
std="vim"
[lints]
mixed_table="allow"

View file

@ -1,5 +1,7 @@
---@module 'luassert' ---@module 'luassert'
local Icons = require("mini.icons")
local Plugin = require("lazy.core.plugin") local Plugin = require("lazy.core.plugin")
_G.LazyVim = require("lazyvim.util") _G.LazyVim = require("lazyvim.util")
@ -98,6 +100,28 @@ describe("Extra", function()
) )
end) end)
end end
-- Icons
local icons = spec.plugins["mini.icons"]
if icons then
local icon_opts = Plugin.values(icons, "opts", false) or {}
local cats = { "directory", "file", "extension", "filetype", "lsp", "os" }
for _, cat in ipairs(cats) do
local cat_names = Icons.list(cat)
if icon_opts[cat] then
describe("does not set existing icons for " .. cat, function()
for icon_name in pairs(icon_opts[cat]) do
it(icon_name, function()
assert.is_false(
vim.tbl_contains(cat_names, icon_name),
"Icon " .. icon_name .. " already exists:\n" .. vim.inspect({ Icons.get(cat, icon_name) })
)
end)
end
end)
end
end
end
end) end)
end end
end) end)

View file

@ -4,11 +4,13 @@ vim.env.LAZY_STDPATH = ".tests"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
-- Setup lazy.nvim -- Setup lazy.nvim
require("lazy.minit").busted({ require("lazy.minit").setup({
spec = { spec = {
{ dir = vim.uv.cwd() },
"LazyVim/starter", "LazyVim/starter",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"williamboman/mason.nvim", "williamboman/mason.nvim",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
{ "echasnovski/mini.icons", opts = {} },
}, },
}) })

View file

@ -1,3 +0,0 @@
#!/bin/sh
nvim -l tests/busted.lua tests -o utfTerminal

View file

@ -0,0 +1,42 @@
---@module "luassert"
_G.LazyVim = require("lazyvim.util")
-- stylua: ignore
local git_remotes_cases = {
["https://github.com/LazyVim/LazyVim.git"] = "https://github.com/LazyVim/LazyVim",
["https://github.com/LazyVim/LazyVim"] = "https://github.com/LazyVim/LazyVim",
["git@github.com:LazyVim/LazyVim"] = "https://github.com/LazyVim/LazyVim",
["git@ssh.dev.azure.com:v3/neovim-org/owner/repo"] = "https://dev.azure.com/neovim-org/owner/_git/repo",
["https://folkelemaitre@bitbucket.org/samiulazim/neovim.git"] = "https://bitbucket.org/samiulazim/neovim",
["git@bitbucket.org:samiulazim/neovim.git"] = "https://bitbucket.org/samiulazim/neovim",
["git@gitlab.com:inkscape/inkscape.git"] = "https://gitlab.com/inkscape/inkscape",
["https://gitlab.com/inkscape/inkscape.git"] = "https://gitlab.com/inkscape/inkscape",
["git@github.com:torvalds/linux.git"] = "https://github.com/torvalds/linux",
["https://github.com/torvalds/linux.git"] = "https://github.com/torvalds/linux",
["git@bitbucket.org:team/repo.git"] = "https://bitbucket.org/team/repo",
["https://bitbucket.org/team/repo.git"] = "https://bitbucket.org/team/repo",
["git@gitlab.com:example-group/example-project.git"] = "https://gitlab.com/example-group/example-project",
["https://gitlab.com/example-group/example-project.git"] = "https://gitlab.com/example-group/example-project",
["git@ssh.dev.azure.com:v3/org/project/repo"] = "https://dev.azure.com/org/project/_git/repo",
["https://username@dev.azure.com/org/project/_git/repo"] = "https://dev.azure.com/org/project/_git/repo",
["ssh://git@ghe.example.com:2222/org/repo.git"] = "https://ghe.example.com/org/repo",
["https://ghe.example.com/org/repo.git"] = "https://ghe.example.com/org/repo",
["git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo"] = "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo",
["https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo"] = "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo",
["ssh://git@source.developers.google.com:2022/p/project/r/repo"] = "https://source.developers.google.com/p/project/r/repo",
["https://source.developers.google.com/p/project/r/repo"] = "https://source.developers.google.com/p/project/r/repo",
["git@git.sr.ht:~user/repo"] = "https://git.sr.ht/~user/repo",
["https://git.sr.ht/~user/repo"] = "https://git.sr.ht/~user/repo",
["git@git.sr.ht:~user/another-repo"] = "https://git.sr.ht/~user/another-repo",
["https://git.sr.ht/~user/another-repo"] = "https://git.sr.ht/~user/another-repo",
}
describe("util.lazygit", function()
for remote, expected in pairs(git_remotes_cases) do
it("should parse git remote " .. remote, function()
local url = LazyVim.lazygit.get_url(remote)
assert.are.equal(expected, url)
end)
end
end)

21
vim.toml Normal file
View file

@ -0,0 +1,21 @@
[selene]
base = "lua51"
name = "vim"
[vim]
any = true
[jit]
any = true
[assert]
any = true
[describe]
any = true
[it]
any = true
[before_each.args]
any = true