mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'LazyVim:main' into main
This commit is contained in:
commit
450bd4b739
75 changed files with 1780 additions and 687 deletions
7
.editorconfig
Normal file
7
.editorconfig
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
charset = utf-8
|
||||||
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
".": "12.19.1"
|
".": "12.33.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
41
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
41
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -6,7 +6,10 @@ 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?
|
||||||
|
|
@ -14,6 +17,8 @@ body:
|
||||||
options:
|
options:
|
||||||
- label: I have read all the LazyVim docs
|
- label: I have read all the LazyVim docs
|
||||||
required: true
|
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
|
- label: I have searched the existing issues of LazyVim
|
||||||
required: true
|
required: true
|
||||||
- label: I have searched the existing issues of plugins related to this issue
|
- label: I have searched the existing issues of plugins related to this issue
|
||||||
|
|
@ -57,33 +62,15 @@ body:
|
||||||
label: Repro
|
label: Repro
|
||||||
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
|
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
|
||||||
value: |
|
value: |
|
||||||
-- DO NOT change the paths and don't remove the colorscheme
|
vim.env.LAZY_STDPATH = ".repro"
|
||||||
local root = vim.fn.fnamemodify("./.repro", ":p")
|
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
|
||||||
|
|
||||||
-- set stdpaths to use .repro
|
require("lazy.minit").repro({
|
||||||
for _, name in ipairs({ "config", "data", "state", "cache" }) do
|
spec = {
|
||||||
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
end
|
-- add any other plugins here
|
||||||
|
},
|
||||||
-- 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",
|
|
||||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
|
||||||
-- 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:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -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
|
||||||
|
|
|
||||||
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
|
@ -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.
|
||||||
|
|
|
||||||
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
|
|
@ -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"
|
||||||
|
|
|
||||||
84
.github/workflows/ci.yml
vendored
84
.github/workflows/ci.yml
vendored
|
|
@ -1,82 +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:
|
|
||||||
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:
|
|
||||||
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
|
|
||||||
|
|
|
||||||
10
.github/workflows/labeler.yml
vendored
10
.github/workflows/labeler.yml
vendored
|
|
@ -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
|
|
||||||
|
|
|
||||||
35
.github/workflows/pr.yml
vendored
35
.github/workflows/pr.yml
vendored
|
|
@ -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
|
|
||||||
|
|
|
||||||
25
.github/workflows/stale.yml
vendored
25
.github/workflows/stale.yml
vendored
|
|
@ -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
12
.github/workflows/update.yml
vendored
Normal 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
15
.gitignore
vendored
|
|
@ -1,8 +1,9 @@
|
||||||
tt.*
|
|
||||||
.tests
|
|
||||||
doc/tags
|
|
||||||
debug
|
|
||||||
.repro
|
|
||||||
foo.*
|
|
||||||
*.log
|
*.log
|
||||||
data
|
/.repro
|
||||||
|
/.tests
|
||||||
|
/build
|
||||||
|
/debug
|
||||||
|
/doc/tags
|
||||||
|
foo.*
|
||||||
|
node_modules
|
||||||
|
tt.*
|
||||||
|
|
|
||||||
284
CHANGELOG.md
284
CHANGELOG.md
|
|
@ -1,5 +1,289 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [12.33.0](https://github.com/LazyVim/LazyVim/compare/v12.32.0...v12.33.0) (2024-07-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **extras:** improve ruby extra by letting user chose ([#3652](https://github.com/LazyVim/LazyVim/issues/3652)) ([7839498](https://github.com/LazyVim/LazyVim/commit/783949810855556dd12ed2685e62fb37a4c9504d))
|
||||||
|
* **lang:** add Lean 4 support ([#4080](https://github.com/LazyVim/LazyVim/issues/4080)) ([3e29fdf](https://github.com/LazyVim/LazyVim/commit/3e29fdf478383034c48477dd04fd433a7c9327ee))
|
||||||
|
* **lang:** add OCaml ([#4079](https://github.com/LazyVim/LazyVim/issues/4079)) ([a219e10](https://github.com/LazyVim/LazyVim/commit/a219e105b0e86316edfedb57f1fa267a764eab13))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ui:** trouble lualine component ([f9fdb35](https://github.com/LazyVim/LazyVim/commit/f9fdb356f2362e5ae4ef490944b1957b49dc6680))
|
||||||
|
|
||||||
|
## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **edgy:** added support for grug-far.nvim ([b1a4740](https://github.com/LazyVim/LazyVim/commit/b1a47405b9fa5eb9f5222876e81be73206b80792))
|
||||||
|
* **terminal:** clear search highlight when opening a terminal ([#4090](https://github.com/LazyVim/LazyVim/issues/4090)) ([b5290fd](https://github.com/LazyVim/LazyVim/commit/b5290fd92935d2e96fa2249cfd09bdd853972869))
|
||||||
|
* **toggle:** move toggle notifs to toggle function ([c1b76ee](https://github.com/LazyVim/LazyVim/commit/c1b76ee235a2cccff6370ecfca57bdacd5fe6258))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **autcmds:** desc for close_with_q ([d6561fd](https://github.com/LazyVim/LazyVim/commit/d6561fd27c17806ca972cbfc18573ca81d13e346))
|
||||||
|
* **ui:** another typo ([b8bdebe](https://github.com/LazyVim/LazyVim/commit/b8bdebe5be7eba91db23e43575fc1226075f6a56))
|
||||||
|
* **ui:** typo ([4ac249b](https://github.com/LazyVim/LazyVim/commit/4ac249beaae3462d606128ca21db79cb85a8c65b))
|
||||||
|
|
||||||
|
## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **keymaps:** proxy leader-w to ctrl-w ([bab5440](https://github.com/LazyVim/LazyVim/commit/bab54406dc312947e4e03bb728498503c09231ca))
|
||||||
|
* **R:** added new which-key group for new install feature ([#4078](https://github.com/LazyVim/LazyVim/issues/4078)) ([5339aca](https://github.com/LazyVim/LazyVim/commit/5339acacec0996968d64fdbaf9fe8187bfea1b47))
|
||||||
|
* **toggle:** make toggles callable. Fixes [#4081](https://github.com/LazyVim/LazyVim/issues/4081) ([150523b](https://github.com/LazyVim/LazyVim/commit/150523b77b6e848c4135a97a5fd8f6f79a6f4443))
|
||||||
|
* **treesitter-context:** which-key toggle ([#4059](https://github.com/LazyVim/LazyVim/issues/4059)) ([ab01350](https://github.com/LazyVim/LazyVim/commit/ab0135093bc18ccf82325bc8ee14c25230a71786))
|
||||||
|
* **which-key:** dynamic buffer mappings under leader-b ([8d9f2ad](https://github.com/LazyVim/LazyVim/commit/8d9f2ad97ee0d495135380975438ab8a8ae62b14))
|
||||||
|
* **which-key:** dynamic window mappings under leader-w ([66bba78](https://github.com/LazyVim/LazyVim/commit/66bba787b83afdd85b5ee95aa589fbe9fbb95535))
|
||||||
|
* **which-key:** leader-w-space starts hydra mode for window mappings ([865bf15](https://github.com/LazyVim/LazyVim/commit/865bf15f1cf4d4f6a3eda6d7509f94a59752fb36))
|
||||||
|
|
||||||
|
## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **keymaps:** dynamic which-key icons/descriptions for toggles ([#4050](https://github.com/LazyVim/LazyVim/issues/4050)) ([78cf032](https://github.com/LazyVim/LazyVim/commit/78cf0320bfc34050883cde5e7af267184dc60ee9))
|
||||||
|
* **util.mini:** follow the user's mappings instead of hardcoded values ([#4043](https://github.com/LazyVim/LazyVim/issues/4043)) ([8506cb5](https://github.com/LazyVim/LazyVim/commit/8506cb5a98a528651a5557d8e447fa13bd8ac0cb))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **lsp:** lsp keymaps. Fixes [#4051](https://github.com/LazyVim/LazyVim/issues/4051) ([706ec4b](https://github.com/LazyVim/LazyVim/commit/706ec4b6b6be4265cbcfd326d3216f2a29952b55))
|
||||||
|
* **yanky:** enable yank history in visual mode ([#4048](https://github.com/LazyVim/LazyVim/issues/4048)) ([6911327](https://github.com/LazyVim/LazyVim/commit/6911327a5edca85ce3bc71229236494d9af7fafa))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **luasnip:** luasnip wasn't lazyloaded ([#4032](https://github.com/LazyVim/LazyVim/issues/4032)) ([e80ed32](https://github.com/LazyVim/LazyVim/commit/e80ed322a79a8b9857c6ab0ad76545654917ddcb))
|
||||||
|
|
||||||
|
## [12.29.2](https://github.com/LazyVim/LazyVim/compare/v12.29.1...v12.29.2) (2024-07-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **telescope:** better find_command. Fixes [#4031](https://github.com/LazyVim/LazyVim/issues/4031) ([d39cdb0](https://github.com/LazyVim/LazyVim/commit/d39cdb059624b1200f2ef762f30c6e3b74066bc5))
|
||||||
|
|
||||||
|
## [12.29.1](https://github.com/LazyVim/LazyVim/compare/v12.29.0...v12.29.1) (2024-07-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **omnisharp:** don't detach coreclr debug adapter ([#4023](https://github.com/LazyVim/LazyVim/issues/4023)) ([b3e746b](https://github.com/LazyVim/LazyVim/commit/b3e746b637a0d43aa0195cc1ff3d8adf1fedfaf6))
|
||||||
|
* **pick:** get rid of "auto" picker and set better defaults for telescope find_files ([#4024](https://github.com/LazyVim/LazyVim/issues/4024)) ([337e9dd](https://github.com/LazyVim/LazyVim/commit/337e9ddc007d32c624433b5c6f0af6e8697dfcc6))
|
||||||
|
* **tailwind:** additional tailwind completion settings for phoenix projects ([#3961](https://github.com/LazyVim/LazyVim/issues/3961)) ([9bce054](https://github.com/LazyVim/LazyVim/commit/9bce054fafcd631ec133a82ada1ecbbd23ca5510))
|
||||||
|
|
||||||
|
## [12.29.0](https://github.com/LazyVim/LazyVim/compare/v12.28.0...v12.29.0) (2024-07-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **java:** new java mappings format for which-key v3 ([#4013](https://github.com/LazyVim/LazyVim/issues/4013)) ([28a7f81](https://github.com/LazyVim/LazyVim/commit/28a7f8126c1b46b41ca58845ee081b67ce6981f2))
|
||||||
|
* shorter keymap descriptions for mini.ai / yanky ([75ff149](https://github.com/LazyVim/LazyVim/commit/75ff1496bd4209784a4250e59920d24d75a3e3b0))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **flit:** use which-key preset keymap descriptions ([#4000](https://github.com/LazyVim/LazyVim/issues/4000)) ([ca37162](https://github.com/LazyVim/LazyVim/commit/ca37162cb7452dce32cf3f0ad661bcd1245286c0))
|
||||||
|
|
||||||
|
## [12.28.0](https://github.com/LazyVim/LazyVim/compare/v12.27.0...v12.28.0) (2024-07-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* new mappings format for which-key v3. Forgot to push :) ([702471e](https://github.com/LazyVim/LazyVim/commit/702471e454ff552189ab03325dc19d0f7a601704))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **autocmds:** fixed pattern for autocommand to autoenable wrap and spell in text files ([#3975](https://github.com/LazyVim/LazyVim/issues/3975)) ([927031a](https://github.com/LazyVim/LazyVim/commit/927031a2de93f694b032a4df5e6d93fff635a496))
|
||||||
|
* **java:** fix `config_overrides` for tests ([#3968](https://github.com/LazyVim/LazyVim/issues/3968)) ([b481b64](https://github.com/LazyVim/LazyVim/commit/b481b644ddf9f02470ec50264e63c6dd69d444f8))
|
||||||
|
* **outline:** use new object for `symbols.filter` ([#4006](https://github.com/LazyVim/LazyVim/issues/4006)) ([db234ef](https://github.com/LazyVim/LazyVim/commit/db234ef9cbbb1b7b0efa8e3af5c446b965e7c07a))
|
||||||
|
* **php:** `php_cs_fixer` is the correct name ([#3991](https://github.com/LazyVim/LazyVim/issues/3991)) ([8bfd9a5](https://github.com/LazyVim/LazyVim/commit/8bfd9a50a71d8b8147f7d742e8d0f05ee6cba888))
|
||||||
|
* **vscode:** allow overriding default vscode keymaps. Fixes [#3950](https://github.com/LazyVim/LazyVim/issues/3950) ([6765052](https://github.com/LazyVim/LazyVim/commit/67650528e47a57fb687bce2d7bb61fb4f1af8f63))
|
||||||
|
|
||||||
|
## [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)
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **markdown:** only run markdownlint-cli2 formatter when there are markdownlint diagnostics for the buffer ([8a6875a](https://github.com/LazyVim/LazyVim/commit/8a6875ab3bc79d5890cf0a65e3ef602c1567fa90))
|
||||||
|
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* feat(neo-tree): more sane defaults for gitignore and hidden files ([2bfcd05](https://github.com/LazyVim/LazyVim/commit/2bfcd05c621f74b4d735b14b43804a901f17d416))
|
||||||
|
|
||||||
|
## [12.22.0](https://github.com/LazyVim/LazyVim/compare/v12.21.1...v12.22.0) (2024-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* allow a custom path for `lazyvim.json`. Fixes [#3856](https://github.com/LazyVim/LazyVim/issues/3856) ([131187c](https://github.com/LazyVim/LazyVim/commit/131187c092cc42768e0a48a3668e91d009a213a0))
|
||||||
|
* **cmp:** disable `item.menu` for Rust filetypes ([#3858](https://github.com/LazyVim/LazyVim/issues/3858)) ([ee44b21](https://github.com/LazyVim/LazyVim/commit/ee44b2189827e6a34530ad8b55f214a0a809c045))
|
||||||
|
* **neo-tree:** more sane defaults for gitignore and hidden files ([85405d6](https://github.com/LazyVim/LazyVim/commit/85405d65348cac72343d081a81addfb5c8d43743))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **lsp:** prevent setting up mason-lspconfig more than once when setting mslp opts ([8c900f9](https://github.com/LazyVim/LazyVim/commit/8c900f92e735e9c7e9af24b97de740390383a137))
|
||||||
|
|
||||||
|
## [12.21.1](https://github.com/LazyVim/LazyVim/compare/v12.21.0...v12.21.1) (2024-06-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **git:** use current dir when git not found to get a meaningful error message ([b43ace1](https://github.com/LazyVim/LazyVim/commit/b43ace1ecfbeb87626fbde8973a2717247471b2e))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **markdown:** don't format with markdown-toc when no toc in the doc ([73e72ee](https://github.com/LazyVim/LazyVim/commit/73e72ee21d7673e4040bb99f4de834410219d6cb))
|
||||||
|
|
||||||
|
## [12.21.0](https://github.com/LazyVim/LazyVim/compare/v12.20.1...v12.21.0) (2024-06-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **extras:** add `overseer.nvim` plugin extra ([#2421](https://github.com/LazyVim/LazyVim/issues/2421)) ([683bf52](https://github.com/LazyVim/LazyVim/commit/683bf52c024306f9c0fccc2b02348692c3f09bfa))
|
||||||
|
* **extras:** add chezmoi extra ([#2859](https://github.com/LazyVim/LazyVim/issues/2859)) ([88f2541](https://github.com/LazyVim/LazyVim/commit/88f25410e020fe64fe42a94d71f0be3db1b918b4))
|
||||||
|
* **extras:** switch to markdownlint-cli2 ([#3843](https://github.com/LazyVim/LazyVim/issues/3843)) ([f47d105](https://github.com/LazyVim/LazyVim/commit/f47d105b80dce615a572a13351a137653444d548))
|
||||||
|
* **java:** enable Lombok support in jdtls ([#3852](https://github.com/LazyVim/LazyVim/issues/3852)) ([0fede40](https://github.com/LazyVim/LazyVim/commit/0fede4040b15da7e74c6a741132ff3d48634c1ad))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **bufremove:** fix `Cancel` ([#3834](https://github.com/LazyVim/LazyVim/issues/3834)) ([87fe403](https://github.com/LazyVim/LazyVim/commit/87fe403df62fd8b89b886920c4f562da8e162cbe))
|
||||||
|
* **edgy:** improve edgy.lua bufferline offset logic ([#3794](https://github.com/LazyVim/LazyVim/issues/3794)) ([566753b](https://github.com/LazyVim/LazyVim/commit/566753b8889a6132f2e667606a6a002fdd8847b1))
|
||||||
|
* **extras:** don't load pkgs when parsing specs for LazyExtras ([3764735](https://github.com/LazyVim/LazyVim/commit/3764735fb20596dfc9cd0707d2830a40004c7f0e))
|
||||||
|
* **gitsigns:** fix inconsistent signs ([#3830](https://github.com/LazyVim/LazyVim/issues/3830)) ([44ed11c](https://github.com/LazyVim/LazyVim/commit/44ed11c4f8867cdc887fdcba6a22938125a403ee))
|
||||||
|
* **lazygit:** fix browsing private git hostings ([#3833](https://github.com/LazyVim/LazyVim/issues/3833)) ([b292a72](https://github.com/LazyVim/LazyVim/commit/b292a721bfce1b079428a3a42aa9ea3454c5692d))
|
||||||
|
* **lint:** make prepend_args opt work when default args is empty ([#3828](https://github.com/LazyVim/LazyVim/issues/3828)) ([ff1b44e](https://github.com/LazyVim/LazyVim/commit/ff1b44e67606080b8b40d066943c55c92856e3c6))
|
||||||
|
* **neotest:** support adapter key on adapter for playwright ([#3824](https://github.com/LazyVim/LazyVim/issues/3824)) ([e5e8d7a](https://github.com/LazyVim/LazyVim/commit/e5e8d7a8056a8c80456751385e73a4b184bcd436))
|
||||||
|
* **pick:** set recurse_submodules to false when using `auto` picker. Fixes [#3831](https://github.com/LazyVim/LazyVim/issues/3831), Closes [#3835](https://github.com/LazyVim/LazyVim/issues/3835) ([d6429a5](https://github.com/LazyVim/LazyVim/commit/d6429a5c8ad317057cb852d3cd67ce52e9c30727))
|
||||||
|
|
||||||
|
## [12.20.1](https://github.com/LazyVim/LazyVim/compare/v12.20.0...v12.20.1) (2024-06-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **autocmds:** check that buf exists ([135ce0d](https://github.com/LazyVim/LazyVim/commit/135ce0d7edb64958b2c8f636a9ba624ec0721eb3))
|
||||||
|
|
||||||
|
## [12.20.0](https://github.com/LazyVim/LazyVim/compare/v12.19.1...v12.20.0) (2024-06-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **autocmds:** added proper bigfile support ([938a671](https://github.com/LazyVim/LazyVim/commit/938a6718c6f0d5c6716a34bd3383758907820c52))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **dashboard:** load dashboard when closing lazy if needed ([fa2fc64](https://github.com/LazyVim/LazyVim/commit/fa2fc6403185faabc47741b3aa2809192870b92e))
|
||||||
|
* **elixir:** fix credo detection for elixir linters. ([#3809](https://github.com/LazyVim/LazyVim/issues/3809)) ([c132158](https://github.com/LazyVim/LazyVim/commit/c13215814cd5dc3821625e9f3b55860ba880ebdb))
|
||||||
|
* **fzf:** disable `preview` for `vtsls` ([#3798](https://github.com/LazyVim/LazyVim/issues/3798)) ([b5945c2](https://github.com/LazyVim/LazyVim/commit/b5945c2fc8cbb531983c7ec27d283ad8abf1acec))
|
||||||
|
* **noice:** dont show old messages when installing plugins ([faee8ce](https://github.com/LazyVim/LazyVim/commit/faee8ce5819c40852f574aafad55701e2492ffae))
|
||||||
|
* **util.terminal:** fix the shellredir and shellpipe options for powershell ([#3803](https://github.com/LazyVim/LazyVim/issues/3803)) ([a33eabd](https://github.com/LazyVim/LazyVim/commit/a33eabddd9f3786421652d07894516d946c88647))
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* **markdown:** add filetype in VeryLazy ([3513362](https://github.com/LazyVim/LazyVim/commit/351336244c0a68d4ebed7f687e27e6eab8e5da09))
|
||||||
|
|
||||||
## [12.19.1](https://github.com/LazyVim/LazyVim/compare/v12.19.0...v12.19.1) (2024-06-23)
|
## [12.19.1](https://github.com/LazyVim/LazyVim/compare/v12.19.0...v12.19.1) (2024-06-23)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 25
|
*LazyVim.txt* For Neovim Last change: 2024 July 19
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,11 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||||
},
|
},
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
vim.bo[event.buf].buflisted = false
|
vim.bo[event.buf].buflisted = false
|
||||||
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
|
vim.keymap.set("n", "q", "<cmd>close<cr>", {
|
||||||
|
buffer = event.buf,
|
||||||
|
silent = true,
|
||||||
|
desc = "Quit buffer",
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -87,7 +91,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||||
-- wrap and check for spell in text filetypes
|
-- wrap and check for spell in text filetypes
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
group = augroup("wrap_spell"),
|
group = augroup("wrap_spell"),
|
||||||
pattern = { "*.txt", "*.tex", "*.typ", "gitcommit", "markdown" },
|
pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt_local.wrap = true
|
vim.opt_local.wrap = true
|
||||||
vim.opt_local.spell = true
|
vim.opt_local.spell = true
|
||||||
|
|
@ -114,3 +118,29 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||||
end,
|
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
|
---@class LazyVimConfig: LazyVimOptions
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.version = "12.19.1" -- x-release-please-version
|
M.version = "12.33.0" -- x-release-please-version
|
||||||
LazyVim.config = M
|
LazyVim.config = M
|
||||||
|
|
||||||
---@class LazyVimOptions
|
---@class LazyVimOptions
|
||||||
|
|
@ -136,6 +136,7 @@ local defaults = {
|
||||||
|
|
||||||
M.json = {
|
M.json = {
|
||||||
version = 6,
|
version = 6,
|
||||||
|
path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json",
|
||||||
data = {
|
data = {
|
||||||
version = nil, ---@type string?
|
version = nil, ---@type string?
|
||||||
news = {}, ---@type table<string, string>
|
news = {}, ---@type table<string, string>
|
||||||
|
|
@ -144,8 +145,7 @@ M.json = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.json.load()
|
function M.json.load()
|
||||||
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
|
local f = io.open(M.json.path, "r")
|
||||||
local f = io.open(path, "r")
|
|
||||||
if f then
|
if f then
|
||||||
local data = f:read("*a")
|
local data = f:read("*a")
|
||||||
f:close()
|
f:close()
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,20 +115,19 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
|
|
||||||
-- toggle options
|
-- toggle options
|
||||||
map("n", "<leader>uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" })
|
LazyVim.toggle.map("<leader>uf", LazyVim.toggle.format())
|
||||||
map("n", "<leader>uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" })
|
LazyVim.toggle.map("<leader>uF", LazyVim.toggle.format(true))
|
||||||
map("n", "<leader>us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" })
|
LazyVim.toggle.map("<leader>us", LazyVim.toggle("spell", { name = "Spelling" }))
|
||||||
map("n", "<leader>uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
LazyVim.toggle.map("<leader>uw", LazyVim.toggle("wrap", { name = "Wrap" }))
|
||||||
map("n", "<leader>uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
LazyVim.toggle.map("<leader>uL", LazyVim.toggle("relativenumber", { name = "Relative Number" }))
|
||||||
map("n", "<leader>ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" })
|
LazyVim.toggle.map("<leader>ud", LazyVim.toggle.diagnostics)
|
||||||
map("n", "<leader>ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
LazyVim.toggle.map("<leader>ul", LazyVim.toggle.number)
|
||||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
LazyVim.toggle.map( "<leader>uc", LazyVim.toggle("conceallevel", { values = { 0, vim.o.conceallevel > 0 and vim.o.conceallevel or 2 } }))
|
||||||
map("n", "<leader>uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
LazyVim.toggle.map("<leader>uT", LazyVim.toggle.treesitter)
|
||||||
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
|
LazyVim.toggle.map("<leader>ub", LazyVim.toggle("background", { values = { "light", "dark" }, name = "Background" }))
|
||||||
map( "n", "<leader>uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
|
if vim.lsp.inlay_hint then
|
||||||
|
LazyVim.toggle.map("<leader>uh", LazyVim.toggle.inlay_hints)
|
||||||
end
|
end
|
||||||
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
|
|
||||||
map("n", "<leader>ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" })
|
|
||||||
|
|
||||||
-- lazygit
|
-- lazygit
|
||||||
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||||
|
|
@ -175,13 +174,11 @@ map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
||||||
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
||||||
|
|
||||||
-- windows
|
-- windows
|
||||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other Window", remap = true })
|
map("n", "<leader>w", "<c-w>", { desc = "Windows", 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>s", { desc = "Split Window Below", remap = true })
|
||||||
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
|
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
|
||||||
map("n", "<leader>wm", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" })
|
map("n", "<c-w>d", "<C-W>c", { desc = "Delete Window", remap = true })
|
||||||
|
LazyVim.toggle.map("<c-w>m", LazyVim.toggle.maximize)
|
||||||
|
|
||||||
-- tabs
|
-- tabs
|
||||||
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
|
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,14 @@ vim.g.lazyvim_statuscolumn = {
|
||||||
-- Hide deprecation warnings
|
-- Hide deprecation warnings
|
||||||
vim.g.deprecation_warnings = false
|
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
|
-- 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
|
vim.g.trouble_lualine = true
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
@ -69,6 +76,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...
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,23 @@ return {
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
}),
|
}),
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(_, item)
|
format = function(entry, item)
|
||||||
local icons = LazyVim.config.icons.kinds
|
local icons = LazyVim.config.icons.kinds
|
||||||
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
|
||||||
|
|
||||||
|
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
|
return item
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
@ -128,20 +140,6 @@ return {
|
||||||
-- better deal with markdown code blocks
|
-- better deal with markdown code blocks
|
||||||
markdown = true,
|
markdown = true,
|
||||||
},
|
},
|
||||||
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)
|
config = function(_, opts)
|
||||||
LazyVim.mini.pairs(opts)
|
LazyVim.mini.pairs(opts)
|
||||||
end,
|
end,
|
||||||
|
|
@ -159,9 +157,6 @@ return {
|
||||||
"echasnovski/mini.ai",
|
"echasnovski/mini.ai",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = function()
|
opts = function()
|
||||||
LazyVim.on_load("which-key.nvim", function()
|
|
||||||
vim.schedule(LazyVim.mini.ai_whichkey)
|
|
||||||
end)
|
|
||||||
local ai = require("mini.ai")
|
local ai = require("mini.ai")
|
||||||
return {
|
return {
|
||||||
n_lines = 500,
|
n_lines = 500,
|
||||||
|
|
@ -185,6 +180,14 @@ return {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
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,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ return {
|
||||||
-- file explorer
|
-- file explorer
|
||||||
{
|
{
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v3.x",
|
|
||||||
cmd = "Neotree",
|
cmd = "Neotree",
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
|
@ -163,32 +162,67 @@ return {
|
||||||
{
|
{
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
opts_extend = { "spec" },
|
||||||
opts = {
|
opts = {
|
||||||
plugins = { spelling = true },
|
defaults = {},
|
||||||
defaults = {
|
spec = {
|
||||||
mode = { "n", "v" },
|
{
|
||||||
["g"] = { name = "+goto" },
|
mode = { "n", "v" },
|
||||||
["gs"] = { name = "+surround" },
|
{ "<leader><tab>", group = "tabs" },
|
||||||
["z"] = { name = "+fold" },
|
{
|
||||||
["]"] = { name = "+next" },
|
"<leader>b",
|
||||||
["["] = { name = "+prev" },
|
group = "buffer",
|
||||||
["<leader><tab>"] = { name = "+tabs" },
|
expand = function()
|
||||||
["<leader>b"] = { name = "+buffer" },
|
return require("which-key.extras").expand.buf()
|
||||||
["<leader>c"] = { name = "+code" },
|
end,
|
||||||
["<leader>f"] = { name = "+file/find" },
|
},
|
||||||
["<leader>g"] = { name = "+git" },
|
{ "<leader>c", group = "code" },
|
||||||
["<leader>gh"] = { name = "+hunks", ["_"] = "which_key_ignore" },
|
{ "<leader>f", group = "file/find" },
|
||||||
["<leader>q"] = { name = "+quit/session" },
|
{ "<leader>g", group = "git" },
|
||||||
["<leader>s"] = { name = "+search" },
|
{ "<leader>gh", group = "hunks" },
|
||||||
["<leader>u"] = { name = "+ui" },
|
{ "<leader>q", group = "quit/session" },
|
||||||
["<leader>w"] = { name = "+windows" },
|
{ "<leader>s", group = "search" },
|
||||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
{ "<leader>u", group = "ui", icon = { icon = " ", color = "cyan" } },
|
||||||
|
{
|
||||||
|
"<leader>w",
|
||||||
|
group = "windows",
|
||||||
|
proxy = "<c-w>",
|
||||||
|
expand = function()
|
||||||
|
return require("which-key.extras").expand.win()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ "<leader>x", group = "diagnostics/quickfix", icon = { icon = " ", color = "green" } },
|
||||||
|
{ "[", 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 Keymaps (which-key)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<c-w><space>",
|
||||||
|
function()
|
||||||
|
require("which-key").show({ keys = "<c-w>", loop = true })
|
||||||
|
end,
|
||||||
|
desc = "Window Hydra Mode (which-key)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.setup(opts)
|
wk.setup(opts)
|
||||||
wk.register(opts.defaults)
|
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
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -207,6 +241,13 @@ return {
|
||||||
changedelete = { text = "▎" },
|
changedelete = { text = "▎" },
|
||||||
untracked = { text = "▎" },
|
untracked = { text = "▎" },
|
||||||
},
|
},
|
||||||
|
signs_staged = {
|
||||||
|
add = { text = "▎" },
|
||||||
|
change = { text = "▎" },
|
||||||
|
delete = { text = "" },
|
||||||
|
topdelete = { text = "" },
|
||||||
|
changedelete = { text = "▎" },
|
||||||
|
},
|
||||||
on_attach = function(buffer)
|
on_attach = function(buffer)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
|
@ -250,16 +291,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)" },
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
|
lazy = true,
|
||||||
build = (not LazyVim.is_win())
|
build = (not LazyVim.is_win())
|
||||||
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
||||||
or nil,
|
or nil,
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,15 @@ return {
|
||||||
vim.cmd([[YankyRingHistory]])
|
vim.cmd([[YankyRingHistory]])
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
mode = { "n", "x" },
|
||||||
desc = "Open Yank History",
|
desc = "Open Yank History",
|
||||||
},
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
||||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
|
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Text After Cursor" },
|
||||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
|
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Cursor" },
|
||||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
|
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Text After Selection" },
|
||||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
|
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Selection" },
|
||||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
||||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
||||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 },
|
||||||
|
|
@ -200,12 +211,12 @@ return {
|
||||||
},
|
},
|
||||||
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||||
{ "<leader>:", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
|
{ "<leader>:", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader><space>", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
-- find
|
-- find
|
||||||
{ "<leader>fb", "<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
{ "<leader>fb", "<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||||
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
||||||
{ "<leader>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||||
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
|
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
|
||||||
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
|
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
|
||||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ return {
|
||||||
"ggandor/flit.nvim",
|
"ggandor/flit.nvim",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
keys = function()
|
keys = function()
|
||||||
---@type LazyKeys[]
|
---@type LazyKeysSpec[]
|
||||||
local ret = {}
|
local ret = {}
|
||||||
for _, key in ipairs({ "f", "F", "t", "T" }) do
|
for _, key in ipairs({ "f", "F", "t", "T" }) do
|
||||||
ret[#ret + 1] = { key, mode = { "n", "x", "o" }, desc = key }
|
ret[#ret + 1] = { key, mode = { "n", "x", "o" } }
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -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 = vim.deepcopy(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,
|
||||||
|
|
|
||||||
102
lua/lazyvim/plugins/extras/editor/overseer.lua
Normal file
102
lua/lazyvim/plugins/extras/editor/overseer.lua
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"catppuccin",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
integrations = { overseer = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"stevearc/overseer.nvim",
|
||||||
|
cmd = {
|
||||||
|
"OverseerOpen",
|
||||||
|
"OverseerClose",
|
||||||
|
"OverseerToggle",
|
||||||
|
"OverseerSaveBundle",
|
||||||
|
"OverseerLoadBundle",
|
||||||
|
"OverseerDeleteBundle",
|
||||||
|
"OverseerRunCmd",
|
||||||
|
"OverseerRun",
|
||||||
|
"OverseerInfo",
|
||||||
|
"OverseerBuild",
|
||||||
|
"OverseerQuickAction",
|
||||||
|
"OverseerTaskAction",
|
||||||
|
"OverseerClearCache",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
dap = false,
|
||||||
|
task_list = {
|
||||||
|
bindings = {
|
||||||
|
["<C-h>"] = false,
|
||||||
|
["<C-j>"] = false,
|
||||||
|
["<C-k>"] = false,
|
||||||
|
["<C-l>"] = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
form = {
|
||||||
|
win_opts = {
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
confirm = {
|
||||||
|
win_opts = {
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
task_win = {
|
||||||
|
win_opts = {
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ow", "<cmd>OverseerToggle<cr>", desc = "Task list" },
|
||||||
|
{ "<leader>oo", "<cmd>OverseerRun<cr>", desc = "Run task" },
|
||||||
|
{ "<leader>oq", "<cmd>OverseerQuickAction<cr>", desc = "Action recent task" },
|
||||||
|
{ "<leader>oi", "<cmd>OverseerInfo<cr>", desc = "Overseer Info" },
|
||||||
|
{ "<leader>ob", "<cmd>OverseerBuild<cr>", desc = "Task builder" },
|
||||||
|
{ "<leader>ot", "<cmd>OverseerTaskAction<cr>", desc = "Task action" },
|
||||||
|
{ "<leader>oc", "<cmd>OverseerClearCache<cr>", desc = "Clear cache" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
spec = {
|
||||||
|
{ "<leader>o", group = "overseer" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/edgy.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.right = opts.right or {}
|
||||||
|
table.insert(opts.right, {
|
||||||
|
title = "Overseer",
|
||||||
|
ft = "OverseerList",
|
||||||
|
open = function()
|
||||||
|
require("overseer").open()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-neotest/neotest",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.consumers = opts.consumers or {}
|
||||||
|
opts.consumers.overseer = require("neotest.consumers.overseer")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
optional = true,
|
||||||
|
opts = function()
|
||||||
|
require("overseer").enable_dap()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -92,12 +92,12 @@ return {
|
||||||
},
|
},
|
||||||
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader><space>", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
-- find
|
-- find
|
||||||
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||||
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
||||||
{ "<leader>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||||
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
|
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
|
||||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||||
|
|
@ -165,6 +165,20 @@ return {
|
||||||
LazyVim.pick("find_files", { hidden = true, default_text = line })()
|
LazyVim.pick("find_files", { hidden = true, default_text = line })()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function find_command()
|
||||||
|
if 1 == vim.fn.executable("rg") then
|
||||||
|
return { "rg", "--files", "--color", "never", "-g", "!.git" }
|
||||||
|
elseif 1 == vim.fn.executable("fd") then
|
||||||
|
return { "fd", "--type", "f", "--color", "never", "-E", ".git" }
|
||||||
|
elseif 1 == vim.fn.executable("fdfind") then
|
||||||
|
return { "fdfind", "--type", "f", "--color", "never", "-E", ".git" }
|
||||||
|
elseif 1 == vim.fn.executable("find") and vim.fn.has("win32") == 0 then
|
||||||
|
return { "find", ".", "-type", "f" }
|
||||||
|
elseif 1 == vim.fn.executable("where") then
|
||||||
|
return { "where", "/r", ".", "*" }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
defaults = {
|
defaults = {
|
||||||
prompt_prefix = " ",
|
prompt_prefix = " ",
|
||||||
|
|
@ -198,6 +212,12 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
pickers = {
|
||||||
|
find_files = {
|
||||||
|
find_command = find_command,
|
||||||
|
hidden = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,13 @@ return {
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if vim.fn.executable("credo") == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
nls.builtins.diagnostics.credo,
|
nls.builtins.diagnostics.credo.with({
|
||||||
|
condition = function(utils)
|
||||||
|
return utils.root_has_file(".credo.exs")
|
||||||
|
end,
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
@ -46,12 +47,17 @@ return {
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if vim.fn.executable("credo") == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
opts.linters_by_ft = {
|
opts.linters_by_ft = {
|
||||||
elixir = { "credo" },
|
elixir = { "credo" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts.linters = {
|
||||||
|
credo = {
|
||||||
|
condition = function(ctx)
|
||||||
|
return vim.fs.find({ ".credo.exs" }, { path = ctx.filename, upward = true })[1]
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
lua/lazyvim/plugins/extras/lang/erlang.lua
Normal file
20
lua/lazyvim/plugins/extras/lang/erlang.lua
Normal 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" } },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -137,4 +137,17 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Filetype icons
|
||||||
|
{
|
||||||
|
"echasnovski/mini.icons",
|
||||||
|
opts = {
|
||||||
|
file = {
|
||||||
|
[".go-version"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||||
|
},
|
||||||
|
filetype = {
|
||||||
|
gotmpl = { glyph = "", hl = "MiniIconsGrey" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,8 @@ return {
|
||||||
dependencies = { "folke/which-key.nvim" },
|
dependencies = { "folke/which-key.nvim" },
|
||||||
ft = java_filetypes,
|
ft = java_filetypes,
|
||||||
opts = function()
|
opts = function()
|
||||||
|
local mason_registry = require("mason-registry")
|
||||||
|
local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar"
|
||||||
return {
|
return {
|
||||||
-- How to find the root dir for a given filename. The default comes from
|
-- How to find the root dir for a given filename. The default comes from
|
||||||
-- lspconfig which provides a function specifically for java projects.
|
-- lspconfig which provides a function specifically for java projects.
|
||||||
|
|
@ -91,7 +93,10 @@ return {
|
||||||
|
|
||||||
-- How to run jdtls. This can be overridden to a full java command-line
|
-- How to run jdtls. This can be overridden to a full java command-line
|
||||||
-- if the Python wrapper script doesn't suffice.
|
-- if the Python wrapper script doesn't suffice.
|
||||||
cmd = { vim.fn.exepath("jdtls") },
|
cmd = {
|
||||||
|
vim.fn.exepath("jdtls"),
|
||||||
|
string.format("--jvm-arg=-javaagent:%s", lombok_jar),
|
||||||
|
},
|
||||||
full_cmd = function(opts)
|
full_cmd = function(opts)
|
||||||
local fname = vim.api.nvim_buf_get_name(0)
|
local fname = vim.api.nvim_buf_get_name(0)
|
||||||
local root_dir = opts.root_dir(fname)
|
local root_dir = opts.root_dir(fname)
|
||||||
|
|
@ -185,30 +190,40 @@ return {
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
if client and client.name == "jdtls" then
|
if client and client.name == "jdtls" then
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.register({
|
wk.add({
|
||||||
["<leader>cx"] = { name = "+extract" },
|
{
|
||||||
["<leader>cxv"] = { require("jdtls").extract_variable_all, "Extract Variable" },
|
mode = "n",
|
||||||
["<leader>cxc"] = { require("jdtls").extract_constant, "Extract Constant" },
|
buffer = args.buf,
|
||||||
["gs"] = { require("jdtls").super_implementation, "Goto Super" },
|
{ "<leader>cx", group = "extract" },
|
||||||
["gS"] = { require("jdtls.tests").goto_subjects, "Goto Subjects" },
|
{ "<leader>cxv", require("jdtls").extract_variable_all, desc = "Extract Variable" },
|
||||||
["<leader>co"] = { require("jdtls").organize_imports, "Organize Imports" },
|
{ "<leader>cxc", require("jdtls").extract_constant, desc = "Extract Constant" },
|
||||||
}, { mode = "n", buffer = args.buf })
|
{ "gs", require("jdtls").super_implementation, desc = "Goto Super" },
|
||||||
wk.register({
|
{ "gS", require("jdtls.tests").goto_subjects, desc = "Goto Subjects" },
|
||||||
["<leader>c"] = { name = "+code" },
|
{ "<leader>co", require("jdtls").organize_imports, desc = "Organize Imports" },
|
||||||
["<leader>cx"] = { name = "+extract" },
|
|
||||||
["<leader>cxm"] = {
|
|
||||||
[[<ESC><CMD>lua require('jdtls').extract_method(true)<CR>]],
|
|
||||||
"Extract Method",
|
|
||||||
},
|
},
|
||||||
["<leader>cxv"] = {
|
})
|
||||||
[[<ESC><CMD>lua require('jdtls').extract_variable_all(true)<CR>]],
|
wk.add({
|
||||||
"Extract Variable",
|
{
|
||||||
|
mode = "v",
|
||||||
|
buffer = args.buf,
|
||||||
|
{ "<leader>cx", group = "extract" },
|
||||||
|
{
|
||||||
|
"<leader>cxm",
|
||||||
|
[[<ESC><CMD>lua require('jdtls').extract_method(true)<CR>]],
|
||||||
|
desc = "Extract Method",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cxv",
|
||||||
|
[[<ESC><CMD>lua require('jdtls').extract_variable_all(true)<CR>]],
|
||||||
|
desc = "Extract Variable",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cxc",
|
||||||
|
[[<ESC><CMD>lua require('jdtls').extract_constant(true)<CR>]],
|
||||||
|
desc = "Extract Constant",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
["<leader>cxc"] = {
|
})
|
||||||
[[<ESC><CMD>lua require('jdtls').extract_constant(true)<CR>]],
|
|
||||||
"Extract Constant",
|
|
||||||
},
|
|
||||||
}, { mode = "v", buffer = args.buf })
|
|
||||||
|
|
||||||
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then
|
||||||
-- custom init for Java debugger
|
-- custom init for Java debugger
|
||||||
|
|
@ -218,12 +233,32 @@ return {
|
||||||
-- Java Test require Java debugger to work
|
-- Java Test require Java debugger to work
|
||||||
if opts.test and mason_registry.is_installed("java-test") then
|
if opts.test and mason_registry.is_installed("java-test") then
|
||||||
-- 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.add({
|
||||||
["<leader>t"] = { name = "+test" },
|
{
|
||||||
["<leader>tt"] = { require("jdtls.dap").test_class, "Run All Test" },
|
mode = "n",
|
||||||
["<leader>tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" },
|
buffer = args.buf,
|
||||||
["<leader>tT"] = { require("jdtls.dap").pick_test, "Run Test" },
|
{ "<leader>t", group = "test" },
|
||||||
}, { mode = "n", buffer = args.buf })
|
{
|
||||||
|
"<leader>tt",
|
||||||
|
function()
|
||||||
|
require("jdtls.dap").test_class({
|
||||||
|
config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Run All Test",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tr",
|
||||||
|
function()
|
||||||
|
require("jdtls.dap").test_nearest_method({
|
||||||
|
config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
desc = "Run Nearest Test",
|
||||||
|
},
|
||||||
|
{ "<leader>tT", require("jdtls.dap").pick_test, desc = "Run Test" },
|
||||||
|
},
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
125
lua/lazyvim/plugins/extras/lang/lean.lua
Normal file
125
lua/lazyvim/plugins/extras/lang/lean.lua
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
ft = { "lean" },
|
||||||
|
root = { "lean-toolchain" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
"Julian/lean.nvim",
|
||||||
|
event = { "BufReadPre *.lean", "BufNewFile *.lean" },
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- see details below for full configuration options
|
||||||
|
opts = {
|
||||||
|
-- Enable the Lean language server(s)?
|
||||||
|
--
|
||||||
|
-- false to disable, otherwise should be a table of options to pass to `leanls`
|
||||||
|
--
|
||||||
|
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls for details.
|
||||||
|
-- In particular ensure you have followed instructions setting up a callback
|
||||||
|
-- for `LspAttach` which sets your key bindings!
|
||||||
|
lsp = {
|
||||||
|
init_options = {
|
||||||
|
-- See Lean.Lsp.InitializationOptions for details and further options.
|
||||||
|
|
||||||
|
-- Time (in milliseconds) which must pass since latest edit until elaboration begins.
|
||||||
|
-- Lower values may make editing feel faster at the cost of higher CPU usage.
|
||||||
|
-- Note that lean.nvim changes the Lean default for this value!
|
||||||
|
editDelay = 0,
|
||||||
|
|
||||||
|
-- Whether to signal that widgets are supported.
|
||||||
|
hasWidgets = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
ft = {
|
||||||
|
-- A list of patterns which will be used to protect any matching
|
||||||
|
-- Lean file paths from being accidentally modified (by marking the
|
||||||
|
-- buffer as `nomodifiable`).
|
||||||
|
nomodifiable = {
|
||||||
|
-- by default, this list includes the Lean standard libraries,
|
||||||
|
-- as well as files within dependency directories (e.g. `_target`)
|
||||||
|
-- Set this to an empty table to disable.
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Abbreviation support
|
||||||
|
abbreviations = {
|
||||||
|
-- Enable expanding of unicode abbreviations?
|
||||||
|
enable = true,
|
||||||
|
-- additional abbreviations:
|
||||||
|
extra = {
|
||||||
|
-- Add a \wknight abbreviation to insert ♘
|
||||||
|
--
|
||||||
|
-- Note that the backslash is implied, and that you of
|
||||||
|
-- course may also use a snippet engine directly to do
|
||||||
|
-- this if so desired.
|
||||||
|
wknight = "♘",
|
||||||
|
},
|
||||||
|
-- Change if you don't like the backslash
|
||||||
|
-- (comma is a popular choice on French keyboards)
|
||||||
|
leader = "\\",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Enable suggested mappings?
|
||||||
|
--
|
||||||
|
-- false by default, true to enable
|
||||||
|
mappings = true,
|
||||||
|
|
||||||
|
-- Infoview support
|
||||||
|
infoview = {
|
||||||
|
-- Automatically open an infoview on entering a Lean buffer?
|
||||||
|
-- Should be a function that will be called anytime a new Lean file
|
||||||
|
-- is opened. Return true to open an infoview, otherwise false.
|
||||||
|
-- Setting this to `true` is the same as `function() return true end`,
|
||||||
|
-- i.e. autoopen for any Lean file, or setting it to `false` is the
|
||||||
|
-- same as `function() return false end`, i.e. never autoopen.
|
||||||
|
autoopen = true,
|
||||||
|
|
||||||
|
-- Set infoview windows' starting dimensions.
|
||||||
|
-- Windows are opened horizontally or vertically depending on spacing.
|
||||||
|
width = 50,
|
||||||
|
height = 20,
|
||||||
|
|
||||||
|
-- Put the infoview on the top or bottom when horizontal?
|
||||||
|
-- top | bottom
|
||||||
|
horizontal_position = "bottom",
|
||||||
|
|
||||||
|
-- Always open the infoview window in a separate tabpage.
|
||||||
|
-- Might be useful if you are using a screen reader and don't want too
|
||||||
|
-- many dynamic updates in the terminal at the same time.
|
||||||
|
-- Note that `height` and `width` will be ignored in this case.
|
||||||
|
separate_tab = false,
|
||||||
|
|
||||||
|
-- Show indicators for pin locations when entering an infoview window?
|
||||||
|
-- always | never | auto (= only when there are multiple pins)
|
||||||
|
indicators = "auto",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Progress bar support
|
||||||
|
progress_bars = {
|
||||||
|
-- Enable the progress bars?
|
||||||
|
enable = true,
|
||||||
|
-- What character should be used for the bars?
|
||||||
|
character = "│",
|
||||||
|
-- Use a different priority for the signs
|
||||||
|
priority = 10,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Redirect Lean's stderr messages somehwere (to a buffer by default)
|
||||||
|
stderr = {
|
||||||
|
enable = true,
|
||||||
|
-- height of the window
|
||||||
|
height = 5,
|
||||||
|
-- a callback which will be called with (multi-line) stderr output
|
||||||
|
-- e.g., use:
|
||||||
|
-- on_lines = function(lines) vim.notify(lines) end
|
||||||
|
-- if you want to redirect stderr to `vim.notify`.
|
||||||
|
-- The default implementation will redirect to a dedicated stderr
|
||||||
|
-- window.
|
||||||
|
on_lines = nil,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -14,15 +14,34 @@ return {
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = {
|
opts = {
|
||||||
|
formatters = {
|
||||||
|
["markdown-toc"] = {
|
||||||
|
condition = function(_, ctx)
|
||||||
|
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
|
||||||
|
if line:find("<!%-%- toc %-%->") then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
["markdownlint-cli2"] = {
|
||||||
|
condition = function(_, ctx)
|
||||||
|
local diag = vim.tbl_filter(function(d)
|
||||||
|
return d.source == "markdownlint"
|
||||||
|
end, vim.diagnostic.get(ctx.buf))
|
||||||
|
return #diag > 0
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
["markdown"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" },
|
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||||
["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" },
|
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = { ensure_installed = { "markdownlint", "markdown-toc" } },
|
opts = { ensure_installed = { "markdownlint-cli2", "markdown-toc" } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
|
|
@ -30,7 +49,7 @@ return {
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
nls.builtins.diagnostics.markdownlint,
|
nls.builtins.diagnostics.markdownlint_cli2,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
@ -39,7 +58,7 @@ return {
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = {
|
opts = {
|
||||||
linters_by_ft = {
|
linters_by_ft = {
|
||||||
markdown = { "markdownlint" },
|
markdown = { "markdownlint-cli2" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -81,6 +100,7 @@ return {
|
||||||
headline_highlights = {},
|
headline_highlights = {},
|
||||||
-- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66
|
-- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66
|
||||||
bullets = {},
|
bullets = {},
|
||||||
|
quote_string = false,
|
||||||
}
|
}
|
||||||
for i = 1, 6 do
|
for i = 1, 6 do
|
||||||
local hl = "Headline" .. i
|
local hl = "Headline" .. i
|
||||||
|
|
|
||||||
39
lua/lazyvim/plugins/extras/lang/ocaml.lua
Normal file
39
lua/lazyvim/plugins/extras/lang/ocaml.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
return {
|
||||||
|
recommended = function()
|
||||||
|
return LazyVim.extras.wants({
|
||||||
|
ft = { "ml", "mli", "cmi", "cmo", "cmx", "cma", "cmxa", "cmxs", "cmt", "cmti", "opam" },
|
||||||
|
root = { "merlin.opam", "dune-project" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
vim.list_extend(opts.ensure_installed, { "ocaml" })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
ocamllsp = {
|
||||||
|
get_language_id = function(_, ftype)
|
||||||
|
return language_id_of[ftype]
|
||||||
|
end,
|
||||||
|
root_dir = function(fname)
|
||||||
|
return require("lspconfig.util").root_pattern(
|
||||||
|
"*.opam",
|
||||||
|
"esy.json",
|
||||||
|
"package.json",
|
||||||
|
".git",
|
||||||
|
"dune-project",
|
||||||
|
"dune-workspace",
|
||||||
|
"*.ml"
|
||||||
|
)(fname)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -75,6 +75,9 @@ return {
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = vim.fn.exepath("netcoredbg"),
|
command = vim.fn.exepath("netcoredbg"),
|
||||||
args = { "--interpreter=vscode" },
|
args = { "--interpreter=vscode" },
|
||||||
|
options = {
|
||||||
|
detached = false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
for _, lang in ipairs({ "cs", "fsharp", "vb" }) do
|
for _, lang in ipairs({ "cs", "fsharp", "vb" }) do
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,13 @@ return {
|
||||||
php = { "phpcs" },
|
php = { "phpcs" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
"stevearc/conform.nvim",
|
{
|
||||||
optional = true,
|
"stevearc/conform.nvim",
|
||||||
opts = {
|
optional = true,
|
||||||
formatters_by_ft = {
|
opts = {
|
||||||
php = { "php-cs-fixer" },
|
formatters_by_ft = {
|
||||||
},
|
php = { "php_cs_fixer" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -19,24 +19,22 @@ return {
|
||||||
vim.keymap.set("n", "<Enter>", "<Plug>RDSendLine", { buffer = true })
|
vim.keymap.set("n", "<Enter>", "<Plug>RDSendLine", { buffer = true })
|
||||||
vim.keymap.set("v", "<Enter>", "<Plug>RSendSelection", { buffer = true })
|
vim.keymap.set("v", "<Enter>", "<Plug>RSendSelection", { buffer = true })
|
||||||
|
|
||||||
-- Increase the width of which-key to handle the longer r-nvim descriptions
|
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
-- Workaround from https://github.com/folke/which-key.nvim/issues/514#issuecomment-1987286901
|
wk.add({
|
||||||
wk.register({
|
buffer = true,
|
||||||
["<localleader>"] = {
|
{ "<localleader>a", group = "all" },
|
||||||
a = { name = "+(a)ll", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>b", group = "between marks" },
|
||||||
b = { name = "+(b)etween marks", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>c", group = "chunks" },
|
||||||
c = { name = "+(c)hunks", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>f", group = "functions" },
|
||||||
f = { name = "+(f)unctions", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>g", group = "goto" },
|
||||||
g = { name = "+(g)oto", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>i", group = "install" },
|
||||||
k = { name = "+(k)nit", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>k", group = "knit" },
|
||||||
p = { name = "+(p)aragraph", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>p", group = "paragraph" },
|
||||||
q = { name = "+(q)uarto", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>q", group = "quarto" },
|
||||||
r = { name = "+(r) general", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>r", group = "r general" },
|
||||||
s = { name = "+(s)plit or (s)end", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>s", group = "split or send" },
|
||||||
t = { name = "+(t)erminal", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>t", group = "terminal" },
|
||||||
v = { name = "+(v)iew", ["🚫"] = "which_key_ignore" },
|
{ "<localleader>v", group = "view" },
|
||||||
},
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,17 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- LSP Server to use for Ruby.
|
||||||
|
-- Set to "solargraph" to use solargraph instead of ruby_lsp.
|
||||||
|
vim.g.lazyvim_ruby_lsp = "ruby_lsp"
|
||||||
|
vim.g.lazyvim_ruby_formatter = "rubocop"
|
||||||
|
end
|
||||||
|
|
||||||
|
local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp"
|
||||||
|
if vim.fn.has("nvim-0.10") == 0 then
|
||||||
|
-- ruby_lsp does not work well with Neovim < 0.10
|
||||||
|
lsp = vim.g.lazyvim_ruby_lsp or "solargraph"
|
||||||
|
end
|
||||||
|
local formatter = vim.g.lazyvim_ruby_formatter or "rubocop"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
@ -11,12 +25,29 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
|
---@class PluginLspOpts
|
||||||
opts = {
|
opts = {
|
||||||
|
---@type lspconfig.options
|
||||||
servers = {
|
servers = {
|
||||||
solargraph = {},
|
ruby_lsp = {
|
||||||
|
enabled = lsp == "ruby_lsp",
|
||||||
|
},
|
||||||
|
solargraph = {
|
||||||
|
enabled = lsp == "solargraph",
|
||||||
|
},
|
||||||
|
rubocop = {
|
||||||
|
enabled = formatter == "rubocop",
|
||||||
|
},
|
||||||
|
standardrb = {
|
||||||
|
enabled = formatter == "standardrb",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = { ensure_installed = { "erb-formatter", "erb-lint" } },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
@ -27,6 +58,16 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
ruby = { formatter },
|
||||||
|
eruby = { "erb-format" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
optional = true,
|
optional = true,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,31 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- The setup below will automatically configure connections without the need for manual input each time.
|
||||||
|
|
||||||
|
-- Example configuration using dictionary with keys:
|
||||||
|
-- vim.g.dbs = {
|
||||||
|
-- dev = "Replace with your database connection URL.",
|
||||||
|
-- staging = "Replace with your database connection URL.",
|
||||||
|
-- }
|
||||||
|
-- or
|
||||||
|
-- Example configuration using a list of dictionaries:
|
||||||
|
-- vim.g.dbs = {
|
||||||
|
-- { name = "dev", url = "Replace with your database connection URL." },
|
||||||
|
-- { name = "staging", url = "Replace with your database connection URL." },
|
||||||
|
-- }
|
||||||
|
|
||||||
|
-- or
|
||||||
|
-- Create a `.lazy.lua` file in your project and set your connections like this:
|
||||||
|
-- ```lua
|
||||||
|
-- vim.g.dbs = {...}
|
||||||
|
--
|
||||||
|
-- return {}
|
||||||
|
-- ```
|
||||||
|
|
||||||
|
-- Alternatively, you can also use other methods to inject your environment variables.
|
||||||
|
|
||||||
|
-- Finally, please make sure to add `.lazy.lua` to your `.gitignore` file to protect your secrets.
|
||||||
|
end
|
||||||
|
|
||||||
local sql_ft = { "sql", "mysql", "plsql" }
|
local sql_ft = { "sql", "mysql", "plsql" }
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,17 @@ return {
|
||||||
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
|
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
|
||||||
end, opts.filetypes)
|
end, opts.filetypes)
|
||||||
|
|
||||||
|
-- Additional settings for Phoenix projects
|
||||||
|
opts.settings = {
|
||||||
|
tailwindCSS = {
|
||||||
|
includeLanguages = {
|
||||||
|
elixir = "html-eex",
|
||||||
|
eelixir = "html-eex",
|
||||||
|
heex = "html-eex",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
-- Add additional filetypes
|
-- Add additional filetypes
|
||||||
vim.list_extend(opts.filetypes, opts.filetypes_include or {})
|
vim.list_extend(opts.filetypes, opts.filetypes_include or {})
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ return {
|
||||||
volar = {
|
volar = {
|
||||||
init_options = {
|
init_options = {
|
||||||
vue = {
|
vue = {
|
||||||
hybridMode = false,
|
hybridMode = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,9 @@ return {
|
||||||
local meta = getmetatable(adapter)
|
local meta = getmetatable(adapter)
|
||||||
if adapter.setup then
|
if adapter.setup then
|
||||||
adapter.setup(config)
|
adapter.setup(config)
|
||||||
|
elseif adapter.adapter then
|
||||||
|
adapter.adapter(config)
|
||||||
|
adapter = adapter.adapter
|
||||||
elseif meta and meta.__call then
|
elseif meta and meta.__call then
|
||||||
adapter(config)
|
adapter(config)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ return {
|
||||||
{ title = "Neotest Summary", ft = "neotest-summary" },
|
{ title = "Neotest Summary", ft = "neotest-summary" },
|
||||||
-- "neo-tree",
|
-- "neo-tree",
|
||||||
},
|
},
|
||||||
|
right = {
|
||||||
|
{ title = "Grug Far", ft = "grug-far", size = { width = 0.4 } },
|
||||||
|
},
|
||||||
keys = {
|
keys = {
|
||||||
-- increase width
|
-- increase width
|
||||||
["<c-Right>"] = function(win)
|
["<c-Right>"] = function(win)
|
||||||
|
|
@ -152,14 +155,17 @@ return {
|
||||||
local get = Offset.get
|
local get = Offset.get
|
||||||
Offset.get = function()
|
Offset.get = function()
|
||||||
if package.loaded.edgy then
|
if package.loaded.edgy then
|
||||||
|
local old_offset = get()
|
||||||
local layout = require("edgy.config").layout
|
local layout = require("edgy.config").layout
|
||||||
local ret = { left = "", left_size = 0, right = "", right_size = 0 }
|
local ret = { left = "", left_size = 0, right = "", right_size = 0 }
|
||||||
for _, pos in ipairs({ "left", "right" }) do
|
for _, pos in ipairs({ "left", "right" }) do
|
||||||
local sb = layout[pos]
|
local sb = layout[pos]
|
||||||
|
local title = " Sidebar" .. string.rep(" ", sb.bounds.width - 8)
|
||||||
if sb and #sb.wins > 0 then
|
if sb and #sb.wins > 0 then
|
||||||
local title = " Sidebar" .. string.rep(" ", sb.bounds.width - 8)
|
ret[pos] = old_offset[pos .. "_size"] > 0 and old_offset[pos]
|
||||||
ret[pos] = "%#EdgyTitle#" .. title .. "%*" .. "%#WinSeparator#│%*"
|
or pos == "left" and ("%#Bold#" .. title .. "%*" .. "%#BufferLineOffsetSeparator#│%*")
|
||||||
ret[pos .. "_size"] = sb.bounds.width
|
or pos == "right" and ("%#BufferLineOffsetSeparator#│%*" .. "%#Bold#" .. title .. "%*")
|
||||||
|
ret[pos .. "_size"] = old_offset[pos .. "_size"] > 0 and old_offset[pos .. "_size"] or sb.bounds.width
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ret.total_size = ret.left_size + ret.right_size
|
ret.total_size = ret.left_size + ret.right_size
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,16 @@ return {
|
||||||
end, { expr = true })
|
end, { expr = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
LazyVim.toggle.map("<leader>ua", {
|
||||||
|
name = "Mini Animate",
|
||||||
|
get = function()
|
||||||
|
return not vim.g.minianimate_disable
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
vim.g.minianimate_disable = not state
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
local animate = require("mini.animate")
|
local animate = require("mini.animate")
|
||||||
return {
|
return {
|
||||||
resize = {
|
resize = {
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,22 @@
|
||||||
-- Show context of the current function
|
-- Show context of the current function
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
event = "LazyFile",
|
event = "VeryLazy",
|
||||||
opts = { mode = "cursor", max_lines = 3 },
|
opts = function()
|
||||||
keys = {
|
local tsc = require("treesitter-context")
|
||||||
{
|
|
||||||
"<leader>ut",
|
LazyVim.toggle.map("<leader>ut", {
|
||||||
function()
|
name = "Treesitter Context",
|
||||||
local tsc = require("treesitter-context")
|
get = tsc.enabled,
|
||||||
tsc.toggle()
|
set = function(state)
|
||||||
if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then
|
if state then
|
||||||
LazyVim.info("Enabled Treesitter Context", { title = "Option" })
|
tsc.enable()
|
||||||
else
|
else
|
||||||
LazyVim.warn("Disabled Treesitter Context", { title = "Option" })
|
tsc.disable()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
desc = "Toggle Treesitter Context",
|
})
|
||||||
},
|
|
||||||
},
|
return { mode = "cursor", max_lines = 3 }
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
111
lua/lazyvim/plugins/extras/util/chezmoi.lua
Normal file
111
lua/lazyvim/plugins/extras/util/chezmoi.lua
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
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 {
|
||||||
|
{
|
||||||
|
-- highlighting for chezmoi files template files
|
||||||
|
"alker0/chezmoi.vim",
|
||||||
|
init = function()
|
||||||
|
vim.g["chezmoi#use_tmp_buffer"] = 1
|
||||||
|
vim.g["chezmoi#source_dir_path"] = os.getenv("HOME") .. "/.local/share/chezmoi"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"xvzc/chezmoi.nvim",
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>sz",
|
||||||
|
pick_chezmoi,
|
||||||
|
desc = "Chezmoi",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
edit = {
|
||||||
|
watch = false,
|
||||||
|
force = false,
|
||||||
|
},
|
||||||
|
notification = {
|
||||||
|
on_open = true,
|
||||||
|
on_apply = true,
|
||||||
|
on_watch = false,
|
||||||
|
},
|
||||||
|
telescope = {
|
||||||
|
select = { "<CR>" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- run chezmoi edit on file enter
|
||||||
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
|
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
|
||||||
|
callback = function()
|
||||||
|
vim.schedule(require("chezmoi.commands.__edit").watch)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvimdev/dashboard-nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local projects = {
|
||||||
|
action = pick_chezmoi,
|
||||||
|
desc = " Config",
|
||||||
|
icon = "",
|
||||||
|
key = "c",
|
||||||
|
}
|
||||||
|
|
||||||
|
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
|
||||||
|
projects.key_format = " %s"
|
||||||
|
|
||||||
|
-- remove lazyvim config property
|
||||||
|
for i = #opts.config.center, 1, -1 do
|
||||||
|
if opts.config.center[i].key == "c" then
|
||||||
|
table.remove(opts.config.center, i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(opts.config.center, 5, projects)
|
||||||
|
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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -8,71 +8,76 @@ pick = function()
|
||||||
local project = require("project_nvim.project")
|
local project = require("project_nvim.project")
|
||||||
local history = require("project_nvim.utils.history")
|
local history = require("project_nvim.utils.history")
|
||||||
local results = history.get_recent_projects()
|
local results = history.get_recent_projects()
|
||||||
local actions = require("fzf-lua.actions")
|
|
||||||
local core = require("fzf-lua.core")
|
|
||||||
-- local path = require("fzf-lua.path")
|
|
||||||
local utils = require("fzf-lua.utils")
|
local utils = require("fzf-lua.utils")
|
||||||
|
|
||||||
local function hl_validate(hl)
|
local function hl_validate(hl)
|
||||||
return not utils.is_hl_cleared(hl) and hl or nil
|
return not utils.is_hl_cleared(hl) and hl or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function actions.project_files(selected)
|
local function ansi_from_hl(hl, s)
|
||||||
fzf_lua.files({ cwd = selected[1] })
|
return utils.ansi_from_hl(hl_validate(hl), s)
|
||||||
end
|
end
|
||||||
|
|
||||||
function actions.project_live_grep(selected)
|
|
||||||
fzf_lua.live_grep({ cwd = selected[1] })
|
|
||||||
end
|
|
||||||
|
|
||||||
function actions.project_oldfiles(selected)
|
|
||||||
fzf_lua.oldfiles({ cwd = selected[1] })
|
|
||||||
end
|
|
||||||
|
|
||||||
function actions.project_cd_cwd(selected)
|
|
||||||
local path = selected[1]
|
|
||||||
local ok = project.set_pwd(path)
|
|
||||||
if ok then
|
|
||||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
|
|
||||||
LazyVim.info("Change project dir to " .. path)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function actions.project_delete(selected)
|
|
||||||
local path = selected[1]
|
|
||||||
local choice = vim.fn.confirm("Delete '" .. path .. "' project? ", "&Yes\n&No")
|
|
||||||
if choice == 1 then
|
|
||||||
history.delete_project({ value = path })
|
|
||||||
end
|
|
||||||
pick()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- core.ACTION_DEFINITIONS[actions.project_files] = { "find project files" }
|
|
||||||
core.ACTION_DEFINITIONS[actions.file_tabedit] = { "tabedit" }
|
|
||||||
core.ACTION_DEFINITIONS[actions.project_live_grep] = { "live_grep" }
|
|
||||||
core.ACTION_DEFINITIONS[actions.project_oldfiles] = { "oldfiles" }
|
|
||||||
core.ACTION_DEFINITIONS[actions.project_cd_cwd] = { "change dir" }
|
|
||||||
core.ACTION_DEFINITIONS[actions.project_delete] = { "delete" }
|
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
fzf_opts = {},
|
fzf_opts = {
|
||||||
hls = {
|
["--header"] = string.format(
|
||||||
header_bind = hl_validate("FzfLuaHeaderBind"),
|
":: <%s> to %s | <%s> to %s | <%s> to %s | <%s> to %s | <%s> to %s",
|
||||||
header_text = hl_validate("FzfLuaHeaderText"),
|
ansi_from_hl("FzfLuaHeaderBind", "ctrl-t"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderText", "tabedit"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderBind", "ctrl-s"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderText", "live_grep"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderBind", "ctrl-r"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderText", "oldfiles"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderBind", "ctrl-w"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderText", "change_dir"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderBind", "ctrl-d"),
|
||||||
|
ansi_from_hl("FzfLuaHeaderText", "delete")
|
||||||
|
),
|
||||||
},
|
},
|
||||||
fzf_colors = true,
|
fzf_colors = true,
|
||||||
header_separator = " | ",
|
|
||||||
actions = {
|
actions = {
|
||||||
["default"] = actions.project_files,
|
["default"] = {
|
||||||
["ctrl-t"] = actions.file_tabedit,
|
function(selected)
|
||||||
["ctrl-s"] = actions.project_live_grep,
|
fzf_lua.files({ cwd = selected[1] })
|
||||||
["ctrl-r"] = actions.project_oldfiles,
|
end,
|
||||||
["ctrl-w"] = actions.project_cd_cwd,
|
},
|
||||||
["ctrl-d"] = actions.project_delete,
|
["ctrl-t"] = {
|
||||||
|
function(selected)
|
||||||
|
vim.cmd("tabedit")
|
||||||
|
fzf_lua.files({ cwd = selected[1] })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
["ctrl-s"] = {
|
||||||
|
function(selected)
|
||||||
|
fzf_lua.live_grep({ cwd = selected[1] })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
["ctrl-r"] = {
|
||||||
|
function(selected)
|
||||||
|
fzf_lua.oldfiles({ cwd = selected[1] })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
["ctrl-w"] = {
|
||||||
|
function(selected)
|
||||||
|
local path = selected[1]
|
||||||
|
local ok = project.set_pwd(path)
|
||||||
|
if ok then
|
||||||
|
vim.api.nvim_win_close(0, false)
|
||||||
|
LazyVim.info("Change project dir to " .. path)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
["ctrl-d"] = function(selected)
|
||||||
|
local path = selected[1]
|
||||||
|
local choice = vim.fn.confirm("Delete '" .. path .. "' project? ", "&Yes\n&No")
|
||||||
|
if choice == 1 then
|
||||||
|
history.delete_project({ value = path })
|
||||||
|
end
|
||||||
|
pick()
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
opts = core.set_header(opts, { "actions" })
|
|
||||||
fzf_lua.fzf_exec(results, opts)
|
fzf_lua.fzf_exec(results, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
25
lua/lazyvim/plugins/extras/util/rest.lua
Normal file
25
lua/lazyvim/plugins/extras/util/rest.lua
Normal 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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -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>]])
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ return {
|
||||||
if type(linter) == "table" and type(lint.linters[name]) == "table" then
|
if type(linter) == "table" and type(lint.linters[name]) == "table" then
|
||||||
lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name], linter)
|
lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name], linter)
|
||||||
if type(linter.prepend_args) == "table" then
|
if type(linter.prepend_args) == "table" then
|
||||||
|
lint.linters[name].args = lint.linters[name].args or {}
|
||||||
vim.list_extend(lint.linters[name].args, linter.prepend_args)
|
vim.list_extend(lint.linters[name].args, linter.prepend_args)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ return {
|
||||||
event = "LazyFile",
|
event = "LazyFile",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"mason.nvim",
|
"mason.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
{ "williamboman/mason-lspconfig.nvim", config = function() end },
|
||||||
},
|
},
|
||||||
---@class PluginLspOpts
|
|
||||||
opts = function()
|
opts = function()
|
||||||
return {
|
---@class PluginLspOpts
|
||||||
|
local ret = {
|
||||||
-- options for vim.diagnostic.config()
|
-- options for vim.diagnostic.config()
|
||||||
---@type vim.diagnostic.Opts
|
---@type vim.diagnostic.Opts
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
|
|
@ -114,6 +114,7 @@ return {
|
||||||
-- ["*"] = function(server, opts) end,
|
-- ["*"] = function(server, opts) end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
return ret
|
||||||
end,
|
end,
|
||||||
---@param opts PluginLspOpts
|
---@param opts PluginLspOpts
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
|
@ -150,7 +151,7 @@ return {
|
||||||
and vim.bo[buffer].buftype == ""
|
and vim.bo[buffer].buftype == ""
|
||||||
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
||||||
then
|
then
|
||||||
LazyVim.toggle.inlay_hints(buffer, true)
|
vim.lsp.inlay_hint.enable(true, { bufnr = buffer })
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ function M.get()
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
M._keys = {
|
M._keys = {
|
||||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||||
{ "gd", vim.lsp.buf.definition(), desc = "Goto Definition", has = "definition" },
|
{ "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" },
|
||||||
{ "gr", vim.lsp.buf.references(), desc = "References", nowait = true },
|
{ "gr", vim.lsp.buf.references, desc = "References", nowait = true },
|
||||||
{ "gI", vim.lsp.buf.implementation(), desc = "Goto Implementation" },
|
{ "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" },
|
||||||
{ "gy", vim.lsp.buf.type_definition(), desc = "Goto T[y]pe Definition" },
|
{ "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" },
|
||||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,14 @@
|
||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
opts = {
|
||||||
|
spec = {
|
||||||
|
{ "<BS>", desc = "Decrement Selection", mode = "x" },
|
||||||
|
{ "<c-space>", desc = "Increment Selection", mode = { "x", "n" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- Treesitter is a new parser generator tool that we can
|
-- Treesitter is a new parser generator tool that we can
|
||||||
-- use in Neovim to power faster and more accurate
|
-- use in Neovim to power faster and more accurate
|
||||||
-- syntax highlighting.
|
-- syntax highlighting.
|
||||||
|
|
|
||||||
|
|
@ -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,20 +198,22 @@ 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
|
-- And allow it to be overriden for some buffer types (see autocmds)
|
||||||
|
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({
|
mode = "symbols",
|
||||||
mode = "symbols",
|
groups = {},
|
||||||
groups = {},
|
title = false,
|
||||||
title = false,
|
filter = { range = true },
|
||||||
filter = { range = true },
|
format = "{kind_icon}{symbol.name:Normal}",
|
||||||
format = "{kind_icon}{symbol.name:Normal}",
|
hl_group = "lualine_c_normal",
|
||||||
hl_group = "lualine_c_normal",
|
})
|
||||||
})
|
|
||||||
table.insert(opts.sections.lualine_c, {
|
table.insert(opts.sections.lualine_c, {
|
||||||
symbols and symbols.get,
|
symbols and symbols.get,
|
||||||
cond = symbols and symbols.has,
|
cond = function()
|
||||||
|
return vim.b.trouble_lualine ~= false and symbols.has()
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -303,7 +305,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 },
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ return {
|
||||||
{
|
{
|
||||||
"folke/persistence.nvim",
|
"folke/persistence.nvim",
|
||||||
event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
opts = { options = vim.opt.sessionoptions:get() },
|
opts = {},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||||
|
|
|
||||||
|
|
@ -84,13 +84,13 @@ end
|
||||||
---@param source LazyExtraSource
|
---@param source LazyExtraSource
|
||||||
function M.get_extra(source, modname)
|
function M.get_extra(source, modname)
|
||||||
local enabled = vim.tbl_contains(M.state, modname)
|
local enabled = vim.tbl_contains(M.state, modname)
|
||||||
local spec = Plugin.Spec.new(nil, { optional = true })
|
local spec = Plugin.Spec.new(nil, { optional = true, pkg = false })
|
||||||
spec:parse({ import = modname })
|
spec:parse({ import = modname })
|
||||||
local imports = vim.tbl_filter(function(x)
|
local imports = vim.tbl_filter(function(x)
|
||||||
return x ~= modname
|
return x ~= modname
|
||||||
end, spec.modules)
|
end, spec.modules)
|
||||||
if #imports > 0 then
|
if #imports > 0 then
|
||||||
spec = Plugin.Spec.new(nil, { optional = true })
|
spec = Plugin.Spec.new(nil, { optional = true, pkg = false })
|
||||||
spec.modules = vim.deepcopy(imports)
|
spec.modules = vim.deepcopy(imports)
|
||||||
spec:parse({ import = modname })
|
spec:parse({ import = modname })
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,19 @@ end
|
||||||
|
|
||||||
---@param buf? boolean
|
---@param buf? boolean
|
||||||
function M.toggle(buf)
|
function M.toggle(buf)
|
||||||
|
M.enable(not M.enabled(), buf)
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param enable? boolean
|
||||||
|
---@param buf? boolean
|
||||||
|
function M.enable(enable, buf)
|
||||||
|
if enable == nil then
|
||||||
|
enable = true
|
||||||
|
end
|
||||||
if buf then
|
if buf then
|
||||||
vim.b.autoformat = not M.enabled()
|
vim.b.autoformat = enable
|
||||||
else
|
else
|
||||||
vim.g.autoformat = not M.enabled()
|
vim.g.autoformat = enable
|
||||||
vim.b.autoformat = nil
|
vim.b.autoformat = nil
|
||||||
end
|
end
|
||||||
M.info()
|
M.info()
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,7 @@ end
|
||||||
|
|
||||||
function M.save()
|
function M.save()
|
||||||
LazyVim.config.json.data.version = LazyVim.config.json.version
|
LazyVim.config.json.data.version = LazyVim.config.json.version
|
||||||
local path = vim.fn.stdpath("config") .. "/lazyvim.json"
|
local f = io.open(LazyVim.config.json.path, "w")
|
||||||
local f = io.open(path, "w")
|
|
||||||
if f then
|
if f then
|
||||||
f:write(LazyVim.json.encode(LazyVim.config.json.data))
|
f:write(LazyVim.json.encode(LazyVim.config.json.data))
|
||||||
f:close()
|
f:close()
|
||||||
|
|
|
||||||
|
|
@ -154,22 +154,48 @@ function M.blame_line(opts)
|
||||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||||
local line = cursor[1]
|
local line = cursor[1]
|
||||||
local file = vim.api.nvim_buf_get_name(0)
|
local file = vim.api.nvim_buf_get_name(0)
|
||||||
local root = LazyVim.root.detectors.pattern(0, { ".git" })[1]
|
local root = LazyVim.root.detectors.pattern(0, { ".git" })[1] or "."
|
||||||
local cmd = { "git", "-C", root, "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
|
local cmd = { "git", "-C", root, "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
|
||||||
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@github.com") or url:find("git@bitbucket.org") or url:find("git@gitlab.com") 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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,57 +60,76 @@ function M.ai_buffer(ai_type)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- register all text objects with which-key
|
-- register all text objects with which-key
|
||||||
function M.ai_whichkey()
|
---@param opts table
|
||||||
---@type table<string, string|table>
|
function M.ai_whichkey(opts)
|
||||||
local i = {
|
local objects = {
|
||||||
[" "] = "Whitespace",
|
{ " ", desc = "whitespace" },
|
||||||
['"'] = 'Balanced "',
|
{ '"', desc = '" string' },
|
||||||
["'"] = "Balanced '",
|
{ "'", desc = "' string" },
|
||||||
["`"] = "Balanced `",
|
{ "(", desc = "() block" },
|
||||||
["("] = "Balanced (",
|
{ ")", desc = "() block with ws" },
|
||||||
[")"] = "Balanced ) including white-space",
|
{ "<", desc = "<> block" },
|
||||||
[">"] = "Balanced > including white-space",
|
{ ">", desc = "<> block with ws" },
|
||||||
["<lt>"] = "Balanced <",
|
{ "?", desc = "user prompt" },
|
||||||
["]"] = "Balanced ] including white-space",
|
{ "U", desc = "use/call without dot" },
|
||||||
["["] = "Balanced [",
|
{ "[", desc = "[] block" },
|
||||||
["}"] = "Balanced } including white-space",
|
{ "]", desc = "[] block with ws" },
|
||||||
["{"] = "Balanced {",
|
{ "_", desc = "underscore" },
|
||||||
["?"] = "User Prompt",
|
{ "`", desc = "` string" },
|
||||||
_ = "Underscore",
|
{ "a", desc = "argument" },
|
||||||
a = "Argument",
|
{ "b", desc = ")]} block" },
|
||||||
b = "Balanced ), ], }",
|
{ "c", desc = "class" },
|
||||||
c = "Class",
|
{ "d", desc = "digit(s)" },
|
||||||
d = "Digit(s)",
|
{ "e", desc = "CamelCase / snake_case" },
|
||||||
e = "Word in CamelCase & snake_case",
|
{ "f", desc = "function" },
|
||||||
f = "Function",
|
{ "g", desc = "entire file" },
|
||||||
g = "Entire file",
|
{ "i", desc = "indent" },
|
||||||
i = "Indent",
|
{ "o", desc = "block, conditional, loop" },
|
||||||
o = "Block, conditional, loop",
|
{ "q", desc = "quote `\"'" },
|
||||||
q = "Quote `, \", '",
|
{ "t", desc = "tag" },
|
||||||
t = "Tag",
|
{ "u", desc = "use/call" },
|
||||||
u = "Use/call function & method",
|
{ "{", desc = "{} block" },
|
||||||
U = "Use/call without dot in name",
|
{ "}", desc = "{} with ws" },
|
||||||
}
|
}
|
||||||
local a = vim.deepcopy(i)
|
|
||||||
for k, v in pairs(a) do
|
|
||||||
a[k] = v:gsub(" including.*", "")
|
|
||||||
end
|
|
||||||
|
|
||||||
local ic = vim.deepcopy(i)
|
local ret = { mode = { "o", "x" } }
|
||||||
local ac = vim.deepcopy(a)
|
---@type table<string, string>
|
||||||
for key, name in pairs({ n = "Next", l = "Last" }) do
|
local mappings = vim.tbl_extend("force", {}, {
|
||||||
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
|
around = "a",
|
||||||
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
|
inside = "i",
|
||||||
|
around_next = "an",
|
||||||
|
inside_next = "in",
|
||||||
|
around_last = "al",
|
||||||
|
inside_last = "il",
|
||||||
|
}, opts.mappings or {})
|
||||||
|
mappings.goto_left = nil
|
||||||
|
mappings.goto_right = nil
|
||||||
|
|
||||||
|
for name, prefix in pairs(mappings) do
|
||||||
|
name = name:gsub("^around_", ""):gsub("^inside_", "")
|
||||||
|
ret[#ret + 1] = { prefix, group = name }
|
||||||
|
for _, obj in ipairs(objects) do
|
||||||
|
local desc = obj.desc
|
||||||
|
if prefix:sub(1, 1) == "i" then
|
||||||
|
desc = desc:gsub(" with ws", "")
|
||||||
|
end
|
||||||
|
ret[#ret + 1] = { prefix .. obj[1], desc = obj.desc }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
require("which-key").register({
|
require("which-key").add(ret, { notify = false })
|
||||||
mode = { "o", "x" },
|
|
||||||
i = i,
|
|
||||||
a = a,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param opts {skip_next: string, skip_ts: string[], skip_unbalanced: boolean, markdown: boolean}
|
---@param opts {skip_next: string, skip_ts: string[], skip_unbalanced: boolean, markdown: boolean}
|
||||||
function M.pairs(opts)
|
function M.pairs(opts)
|
||||||
|
LazyVim.toggle.map("<leader>up", {
|
||||||
|
name = "Mini Pairs",
|
||||||
|
get = function()
|
||||||
|
return not vim.g.minipairs_disable
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
vim.g.minipairs_disable = not state
|
||||||
|
end,
|
||||||
|
})
|
||||||
local pairs = require("mini.pairs")
|
local pairs = require("mini.pairs")
|
||||||
pairs.setup(opts)
|
pairs.setup(opts)
|
||||||
local open = pairs.open
|
local open = pairs.open
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ function M.open(command, opts)
|
||||||
return LazyVim.error("LazyVim.pick: picker not set")
|
return LazyVim.error("LazyVim.pick: picker not set")
|
||||||
end
|
end
|
||||||
|
|
||||||
command = command or "auto"
|
command = command ~= "auto" and command or "files"
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
opts = vim.deepcopy(opts)
|
opts = vim.deepcopy(opts)
|
||||||
|
|
@ -71,18 +71,6 @@ function M.open(command, opts)
|
||||||
opts.cwd = LazyVim.root({ buf = opts.buf })
|
opts.cwd = LazyVim.root({ buf = opts.buf })
|
||||||
end
|
end
|
||||||
|
|
||||||
local cwd = opts.cwd or vim.uv.cwd()
|
|
||||||
if command == "auto" then
|
|
||||||
command = "files"
|
|
||||||
if
|
|
||||||
vim.uv.fs_stat(cwd .. "/.git")
|
|
||||||
and not vim.uv.fs_stat(cwd .. "/.ignore")
|
|
||||||
and not vim.uv.fs_stat(cwd .. "/.rgignore")
|
|
||||||
then
|
|
||||||
command = "git_files"
|
|
||||||
opts.show_untracked = opts.show_untracked ~= false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
command = M.picker.commands[command] or command
|
command = M.picker.commands[command] or command
|
||||||
M.picker.open(command, opts)
|
M.picker.open(command, opts)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,8 @@ function M.open(cmd, opts)
|
||||||
vim.cmd.startinsert()
|
vim.cmd.startinsert()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.cmd("noh")
|
||||||
end
|
end
|
||||||
|
|
||||||
return terminals[termkey]
|
return terminals[termkey]
|
||||||
|
|
|
||||||
|
|
@ -1,115 +1,179 @@
|
||||||
---@class lazyvim.util.toggle
|
---@class lazyvim.util.toggle
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
---@param silent boolean?
|
---@class lazyvim.Toggle
|
||||||
---@param values? {[1]:any, [2]:any}
|
---@field name string
|
||||||
function M.option(option, silent, values)
|
---@field get fun():boolean
|
||||||
if values then
|
---@field set fun(state:boolean)
|
||||||
if vim.opt_local[option]:get() == values[1] then
|
|
||||||
---@diagnostic disable-next-line: no-unknown
|
---@class lazyvim.Toggle.wrap: lazyvim.Toggle
|
||||||
vim.opt_local[option] = values[2]
|
---@operator call:boolean
|
||||||
else
|
|
||||||
---@diagnostic disable-next-line: no-unknown
|
---@param toggle lazyvim.Toggle
|
||||||
vim.opt_local[option] = values[1]
|
function M.wrap(toggle)
|
||||||
end
|
return setmetatable(toggle, {
|
||||||
return LazyVim.info("Set " .. option .. " to " .. vim.opt_local[option]:get(), { title = "Option" })
|
__call = function()
|
||||||
end
|
toggle.set(not toggle.get())
|
||||||
---@diagnostic disable-next-line: no-unknown
|
local state = toggle.get()
|
||||||
vim.opt_local[option] = not vim.opt_local[option]:get()
|
if state then
|
||||||
if not silent then
|
LazyVim.info("Enabled " .. toggle.name, { title = toggle.name })
|
||||||
if vim.opt_local[option]:get() then
|
else
|
||||||
LazyVim.info("Enabled " .. option, { title = "Option" })
|
LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name })
|
||||||
else
|
end
|
||||||
LazyVim.warn("Disabled " .. option, { title = "Option" })
|
return state
|
||||||
end
|
end,
|
||||||
end
|
}) --[[@as lazyvim.Toggle.wrap]]
|
||||||
end
|
end
|
||||||
|
|
||||||
local nu = { number = true, relativenumber = true }
|
---@param lhs string
|
||||||
function M.number()
|
---@param toggle lazyvim.Toggle
|
||||||
if vim.opt_local.number:get() or vim.opt_local.relativenumber:get() then
|
function M.map(lhs, toggle)
|
||||||
nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() }
|
local t = M.wrap(toggle)
|
||||||
vim.opt_local.number = false
|
LazyVim.safe_keymap_set("n", lhs, function()
|
||||||
vim.opt_local.relativenumber = false
|
t()
|
||||||
LazyVim.warn("Disabled line numbers", { title = "Option" })
|
end, { desc = "Toggle " .. toggle.name })
|
||||||
else
|
M.wk(lhs, toggle)
|
||||||
vim.opt_local.number = nu.number
|
|
||||||
vim.opt_local.relativenumber = nu.relativenumber
|
|
||||||
LazyVim.info("Enabled line numbers", { title = "Option" })
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local enabled = true
|
function M.wk(lhs, toggle)
|
||||||
function M.diagnostics()
|
if not LazyVim.has("which-key.nvim") then
|
||||||
-- if this Neovim version supports checking if diagnostics are enabled
|
|
||||||
-- then use that for the current state
|
|
||||||
if vim.diagnostic.is_enabled then
|
|
||||||
enabled = vim.diagnostic.is_enabled()
|
|
||||||
elseif vim.diagnostic.is_disabled then
|
|
||||||
enabled = not vim.diagnostic.is_disabled()
|
|
||||||
end
|
|
||||||
enabled = not enabled
|
|
||||||
|
|
||||||
if enabled then
|
|
||||||
vim.diagnostic.enable()
|
|
||||||
LazyVim.info("Enabled diagnostics", { title = "Diagnostics" })
|
|
||||||
else
|
|
||||||
vim.diagnostic.disable()
|
|
||||||
LazyVim.warn("Disabled diagnostics", { title = "Diagnostics" })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param buf? number
|
|
||||||
---@param value? boolean
|
|
||||||
function M.inlay_hints(buf, value)
|
|
||||||
local ih = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
|
||||||
if type(ih) == "function" then
|
|
||||||
ih(buf, value)
|
|
||||||
elseif type(ih) == "table" and ih.enable then
|
|
||||||
if value == nil then
|
|
||||||
value = not ih.is_enabled({ bufnr = buf or 0 })
|
|
||||||
end
|
|
||||||
ih.enable(value, { bufnr = buf })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---@type {k:string, v:any}[]
|
|
||||||
M._maximized = nil
|
|
||||||
---@param state boolean?
|
|
||||||
function M.maximize(state)
|
|
||||||
if state == (M._maximized ~= nil) then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if M._maximized then
|
require("which-key").add({
|
||||||
for _, opt in ipairs(M._maximized) do
|
{
|
||||||
vim.o[opt.k] = opt.v
|
lhs,
|
||||||
|
icon = function()
|
||||||
|
return toggle.get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" }
|
||||||
|
end,
|
||||||
|
desc = function()
|
||||||
|
return (toggle.get() and "Disable " or "Enable ") .. toggle.name
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.treesitter = M.wrap({
|
||||||
|
name = "Treesitter Highlight",
|
||||||
|
get = function()
|
||||||
|
return vim.b.ts_highlight
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
if state then
|
||||||
|
vim.treesitter.start()
|
||||||
|
else
|
||||||
|
vim.treesitter.stop()
|
||||||
end
|
end
|
||||||
M._maximized = nil
|
end,
|
||||||
vim.cmd("wincmd =")
|
})
|
||||||
else
|
|
||||||
M._maximized = {}
|
---@param buf? boolean
|
||||||
local function set(k, v)
|
function M.format(buf)
|
||||||
table.insert(M._maximized, 1, { k = k, v = vim.o[k] })
|
return M.wrap({
|
||||||
vim.o[k] = v
|
name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")",
|
||||||
end
|
get = function()
|
||||||
set("winwidth", 999)
|
if not buf then
|
||||||
set("winheight", 999)
|
return vim.g.autoformat == nil or vim.g.autoformat
|
||||||
set("winminwidth", 10)
|
end
|
||||||
set("winminheight", 4)
|
return LazyVim.format.enabled()
|
||||||
vim.cmd("wincmd =")
|
end,
|
||||||
end
|
set = function(state)
|
||||||
-- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that
|
LazyVim.format.enable(state, buf)
|
||||||
-- `VimLeavePre` might be another consideration? Not sure about differences between the 2
|
|
||||||
vim.api.nvim_create_autocmd("ExitPre", {
|
|
||||||
once = true,
|
|
||||||
group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }),
|
|
||||||
desc = "Restore width/height when close Neovim while maximized",
|
|
||||||
callback = function()
|
|
||||||
M.maximize(false)
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param opts? {values?: {[1]:any, [2]:any}, name?: string}
|
||||||
|
function M.option(option, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
local name = opts.name or option
|
||||||
|
local on = opts.values and opts.values[2] or true
|
||||||
|
local off = opts.values and opts.values[1] or false
|
||||||
|
return M.wrap({
|
||||||
|
name = name,
|
||||||
|
get = function()
|
||||||
|
return vim.opt_local[option]:get() == on
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
vim.opt_local[option] = state and on or off
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local nu = { number = true, relativenumber = true }
|
||||||
|
M.number = M.wrap({
|
||||||
|
name = "Line Numbers",
|
||||||
|
get = function()
|
||||||
|
return vim.opt_local.number:get() or vim.opt_local.relativenumber:get()
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
if state then
|
||||||
|
vim.opt_local.number = nu.number
|
||||||
|
vim.opt_local.relativenumber = nu.relativenumber
|
||||||
|
else
|
||||||
|
nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() }
|
||||||
|
vim.opt_local.number = false
|
||||||
|
vim.opt_local.relativenumber = false
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
M.diagnostics = M.wrap({
|
||||||
|
name = "Diagnostics",
|
||||||
|
get = function()
|
||||||
|
return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled()
|
||||||
|
end,
|
||||||
|
set = vim.diagnostic.enable,
|
||||||
|
})
|
||||||
|
|
||||||
|
M.inlay_hints = M.wrap({
|
||||||
|
name = "Inlay Hints",
|
||||||
|
get = function()
|
||||||
|
return vim.lsp.inlay_hint.is_enabled({ bufnr = 0 })
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
vim.lsp.inlay_hint.enable(state, { bufnr = 0 })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
---@type {k:string, v:any}[]
|
||||||
|
M._maximized = nil
|
||||||
|
M.maximize = M.wrap({
|
||||||
|
name = "Maximize",
|
||||||
|
get = function()
|
||||||
|
return M._maximized ~= nil
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
if state then
|
||||||
|
M._maximized = {}
|
||||||
|
local function set(k, v)
|
||||||
|
table.insert(M._maximized, 1, { k = k, v = vim.o[k] })
|
||||||
|
vim.o[k] = v
|
||||||
|
end
|
||||||
|
set("winwidth", 999)
|
||||||
|
set("winheight", 999)
|
||||||
|
set("winminwidth", 10)
|
||||||
|
set("winminheight", 4)
|
||||||
|
vim.cmd("wincmd =")
|
||||||
|
-- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that
|
||||||
|
-- `VimLeavePre` might be another consideration? Not sure about differences between the 2
|
||||||
|
vim.api.nvim_create_autocmd("ExitPre", {
|
||||||
|
once = true,
|
||||||
|
group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }),
|
||||||
|
desc = "Restore width/height when close Neovim while maximized",
|
||||||
|
callback = function()
|
||||||
|
M.maximize.set(false)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
else
|
||||||
|
for _, opt in ipairs(M._maximized) do
|
||||||
|
vim.o[opt.k] = opt.v
|
||||||
|
end
|
||||||
|
M._maximized = nil
|
||||||
|
vim.cmd("wincmd =")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
setmetatable(M, {
|
setmetatable(M, {
|
||||||
__call = function(m, ...)
|
__call = function(m, ...)
|
||||||
return m.option(...)
|
return m.option(...)
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ function M.bufremove(buf)
|
||||||
|
|
||||||
if vim.bo.modified then
|
if vim.bo.modified then
|
||||||
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel")
|
||||||
if choice == 0 then -- Cancel
|
if choice == 0 or choice == 3 then -- 0 for <Esc>/<C-c> and 3 for Cancel
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if choice == 1 then -- Yes
|
if choice == 1 then -- Yes
|
||||||
|
|
|
||||||
3
scripts/test
Executable file
3
scripts/test
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/env bash
|
||||||
|
|
||||||
|
nvim -l tests/minit.lua --minitest
|
||||||
4
selene.toml
Normal file
4
selene.toml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
std="vim"
|
||||||
|
|
||||||
|
[lints]
|
||||||
|
mixed_table="allow"
|
||||||
|
|
@ -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")
|
||||||
|
|
||||||
|
|
@ -38,13 +40,10 @@ describe("Extra", function()
|
||||||
for _, extra in ipairs(extras) do
|
for _, extra in ipairs(extras) do
|
||||||
local name = extra.modname:sub(#"lazyvim.plugins.extras" + 2)
|
local name = extra.modname:sub(#"lazyvim.plugins.extras" + 2)
|
||||||
describe(name, function()
|
describe(name, function()
|
||||||
---@type any, LazySpecLoader
|
|
||||||
local mod, spec
|
|
||||||
|
|
||||||
it("spec is valid", function()
|
it("spec is valid", function()
|
||||||
mod = require(extra.modname)
|
local mod = require(extra.modname)
|
||||||
assert.is_not_nil(mod)
|
assert.is_not_nil(mod)
|
||||||
spec = Plugin.Spec.new({
|
local spec = Plugin.Spec.new({
|
||||||
{ "williamboman/mason.nvim", opts = { ensure_installed = {} } },
|
{ "williamboman/mason.nvim", opts = { ensure_installed = {} } },
|
||||||
{ "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } },
|
{ "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } },
|
||||||
mod,
|
mod,
|
||||||
|
|
@ -54,10 +53,17 @@ describe("Extra", function()
|
||||||
|
|
||||||
if extra.modname:find("%.lang%.") then
|
if extra.modname:find("%.lang%.") then
|
||||||
it("has recommended set", function()
|
it("has recommended set", function()
|
||||||
|
local mod = require(extra.modname)
|
||||||
assert(mod.recommended, "`recommended` not set for " .. extra.modname)
|
assert(mod.recommended, "`recommended` not set for " .. extra.modname)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local mod = require(extra.modname)
|
||||||
|
local spec = Plugin.Spec.new({
|
||||||
|
{ "williamboman/mason.nvim", opts = { ensure_installed = {} } },
|
||||||
|
{ "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } },
|
||||||
|
mod,
|
||||||
|
}, { optional = true })
|
||||||
local lspconfig = spec.plugins["nvim-lspconfig"]
|
local lspconfig = spec.plugins["nvim-lspconfig"]
|
||||||
if lspconfig then
|
if lspconfig then
|
||||||
it("does not install LSP servers with mason.nvim", function()
|
it("does not install LSP servers with mason.nvim", function()
|
||||||
|
|
@ -94,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)
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
-- DO NOT change the paths and don't remove the colorscheme
|
|
||||||
local root = vim.fn.fnamemodify("./.tests", ":p")
|
|
||||||
|
|
||||||
-- 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
|
|
||||||
print("Bootstrapping lazy.nvim")
|
|
||||||
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 = {
|
|
||||||
"LazyVim/starter",
|
|
||||||
{ "nvim-lua/plenary.nvim" },
|
|
||||||
{ "folke/lazy.nvim" },
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
}
|
|
||||||
|
|
||||||
local function main()
|
|
||||||
print("Installing plugins")
|
|
||||||
require("lazy").setup(plugins, {
|
|
||||||
root = root .. "/plugins",
|
|
||||||
pkg = { enabled = false },
|
|
||||||
performance = {
|
|
||||||
rtp = {
|
|
||||||
reset = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if vim.o.filetype == "lazy" then
|
|
||||||
vim.cmd.close()
|
|
||||||
end
|
|
||||||
|
|
||||||
print("Updating plugins")
|
|
||||||
-- update plugins, wait for it to finish and don't show the output
|
|
||||||
require("lazy").update({ wait = true, show = false })
|
|
||||||
-- require("lazy.core.cache").reset()
|
|
||||||
|
|
||||||
vim.opt.rtp:append(".")
|
|
||||||
end
|
|
||||||
|
|
||||||
local Util = require("lazy.core.util")
|
|
||||||
Util.try(main, {
|
|
||||||
on_error = function(err)
|
|
||||||
print(err)
|
|
||||||
os.exit(1)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
16
tests/minit.lua
Normal file
16
tests/minit.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env -S nvim -l
|
||||||
|
|
||||||
|
vim.env.LAZY_STDPATH = ".tests"
|
||||||
|
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
|
||||||
|
|
||||||
|
-- Setup lazy.nvim
|
||||||
|
require("lazy.minit").setup({
|
||||||
|
spec = {
|
||||||
|
{ dir = vim.uv.cwd() },
|
||||||
|
"LazyVim/starter",
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
{ "echasnovski/mini.icons", opts = {} },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests {init = 'tests//init.lua', sequential = true}"
|
|
||||||
42
tests/util/lazygit_spec.lua
Normal file
42
tests/util/lazygit_spec.lua
Normal 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
21
vim.toml
Normal 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
|
||||||
Loading…
Add table
Reference in a new issue