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
d7ca7220a3
72 changed files with 1445 additions and 617 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.25.0"
|
||||
".": "12.38.2"
|
||||
}
|
||||
|
|
|
|||
41
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
41
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -6,7 +6,10 @@ body:
|
|||
- type: markdown
|
||||
attributes:
|
||||
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
|
||||
attributes:
|
||||
label: Did you check docs and existing issues?
|
||||
|
|
@ -14,6 +17,8 @@ body:
|
|||
options:
|
||||
- label: I have read all the LazyVim docs
|
||||
required: true
|
||||
- label: I have updated the plugin to the latest version before submitting this issue
|
||||
required: true
|
||||
- label: I have searched the existing issues of LazyVim
|
||||
required: true
|
||||
- label: I have searched the existing issues of plugins related to this issue
|
||||
|
|
@ -57,33 +62,15 @@ body:
|
|||
label: Repro
|
||||
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
|
||||
value: |
|
||||
-- DO NOT change the paths and don't remove the colorscheme
|
||||
local root = vim.fn.fnamemodify("./.repro", ":p")
|
||||
vim.env.LAZY_STDPATH = ".repro"
|
||||
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
|
||||
|
||||
-- set stdpaths to use .repro
|
||||
for _, name in ipairs({ "config", "data", "state", "cache" }) do
|
||||
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
|
||||
end
|
||||
|
||||
-- bootstrap lazy
|
||||
local lazypath = root .. "/plugins/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
|
||||
end
|
||||
vim.opt.runtimepath:prepend(lazypath)
|
||||
|
||||
-- install plugins
|
||||
local plugins = {
|
||||
"folke/tokyonight.nvim",
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- add any other plugins here
|
||||
}
|
||||
require("lazy").setup(plugins, {
|
||||
root = root .. "/plugins",
|
||||
require("lazy.minit").repro({
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- add any other plugins here
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme("tokyonight")
|
||||
-- add anything else here
|
||||
render: Lua
|
||||
render: lua
|
||||
validations:
|
||||
required: false
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -1,5 +1,5 @@
|
|||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Ask a question or start a discussion
|
||||
- name: Ask a question
|
||||
url: https://github.com/LazyVim/LazyVim/discussions
|
||||
about: Use Github discussions instead
|
||||
|
|
|
|||
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
|
@ -1,15 +1,19 @@
|
|||
## What is this PR for?
|
||||
## Description
|
||||
|
||||
<!-- Describe the big picture of your changes to communicate to the maintainers
|
||||
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.
|
||||
Fixes #<issue_number>
|
||||
- Fixes #<issue_number>
|
||||
-->
|
||||
|
||||
## Screenshots
|
||||
|
||||
<!-- Add screenshots of the changes if applicable. -->
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
|
||||
|
|
|
|||
9
.github/dependabot.yml
vendored
9
.github/dependabot.yml
vendored
|
|
@ -1,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
|
||||
updates:
|
||||
- package-ecosystem: "github-actions" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
|
|
|
|||
80
.github/workflows/ci.yml
vendored
80
.github/workflows/ci.yml
vendored
|
|
@ -1,78 +1,14 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
stylua:
|
||||
name: Stylua Formatting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: JohnnyMorganz/stylua-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: latest
|
||||
args: --check .
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Neovim
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p /tmp/nvim
|
||||
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
|
||||
cd /tmp/nvim
|
||||
chmod a+x ./nvim.appimage
|
||||
./nvim.appimage --appimage-extract
|
||||
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
|
||||
- name: Run Tests
|
||||
run: |
|
||||
nvim --version
|
||||
[ ! -d tests ] && exit 0
|
||||
./tests/run
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: tests
|
||||
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'LazyVim' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: panvimdoc
|
||||
uses: kdheepak/panvimdoc@main
|
||||
with:
|
||||
vimdoc: LazyVim
|
||||
version: "Neovim >= 0.9.0"
|
||||
demojify: true
|
||||
treesitter: true
|
||||
- name: Push changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "chore(build): auto-generate vimdoc"
|
||||
commit_user_name: "github-actions[bot]"
|
||||
commit_user_email: "github-actions[bot]@users.noreply.github.com"
|
||||
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
|
||||
release:
|
||||
name: release
|
||||
if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'LazyVim' }}
|
||||
needs:
|
||||
- docs
|
||||
- tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: googleapis/release-please-action@v4
|
||||
id: release
|
||||
with:
|
||||
config-file: .github/release-please-config.json
|
||||
manifest-file: .github/.release-please-manifest.json
|
||||
- uses: actions/checkout@v4
|
||||
- name: tag stable versions
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
run: |
|
||||
git config user.name github-actions[bot]
|
||||
git config user.email github-actions[bot]@users.noreply.github.com
|
||||
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
|
||||
git tag -d stable || true
|
||||
git push origin :stable || true
|
||||
git tag -a stable -m "Last Stable Release"
|
||||
git push origin stable
|
||||
ci:
|
||||
uses: folke/github/.github/workflows/ci.yml@main
|
||||
secrets: inherit
|
||||
with:
|
||||
plugin: LazyVim
|
||||
repo: LazyVim/LazyVim
|
||||
|
|
|
|||
10
.github/workflows/labeler.yml
vendored
10
.github/workflows/labeler.yml
vendored
|
|
@ -1,12 +1,8 @@
|
|||
name: "Pull Request Labeler"
|
||||
name: "PR Labeler"
|
||||
on:
|
||||
- pull_request_target
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v5
|
||||
uses: folke/github/.github/workflows/labeler.yml@main
|
||||
secrets: inherit
|
||||
|
|
|
|||
35
.github/workflows/pr.yml
vendored
35
.github/workflows/pr.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: "Lint PR"
|
||||
name: PR Title
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
|
@ -6,36 +6,13 @@ on:
|
|||
- opened
|
||||
- edited
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
main:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
requireScope: true
|
||||
subjectPattern: ^(?![A-Z]).+$
|
||||
scopes: |
|
||||
.+
|
||||
types: |
|
||||
build
|
||||
chore
|
||||
ci
|
||||
docs
|
||||
feat
|
||||
fix
|
||||
merge
|
||||
perf
|
||||
refactor
|
||||
revert
|
||||
style
|
||||
test
|
||||
wip
|
||||
ignoreLabels: |
|
||||
autorelease: pending
|
||||
pr-title:
|
||||
uses: folke/github/.github/workflows/pr.yml@main
|
||||
secrets: inherit
|
||||
|
|
|
|||
24
.github/workflows/stale.yml
vendored
24
.github/workflows/stale.yml
vendored
|
|
@ -1,27 +1,11 @@
|
|||
name: Close stale issues and PRs
|
||||
name: Stale Issues & PRs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
operations-per-run: 300
|
||||
# default stale time
|
||||
days-before-stale: 30
|
||||
days-before-close: 7
|
||||
# never stale pull requests
|
||||
# days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
# exclude issues with certain labels
|
||||
exempt-issue-labels: pinned,wip,security,notice
|
||||
# never stale issues attached to a milestone
|
||||
# exempt-all-milestones: true
|
||||
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days."
|
||||
stale-pr-message: "This PR is stale because it has been open 60 days with no activity."
|
||||
close-issue-message: "This issue was closed because it has been stalled for 7 days with no activity."
|
||||
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
|
||||
uses: folke/github/.github/workflows/stale.yml@main
|
||||
secrets: inherit
|
||||
|
|
|
|||
13
.github/workflows/update.yml
vendored
Normal file
13
.github/workflows/update.yml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
name: Update Repo
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Run every hour
|
||||
- cron: "0 * * * *"
|
||||
|
||||
jobs:
|
||||
update:
|
||||
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
|
||||
uses: folke/github/.github/workflows/update.yml@main
|
||||
secrets: inherit
|
||||
15
.gitignore
vendored
15
.gitignore
vendored
|
|
@ -1,8 +1,9 @@
|
|||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
/.repro
|
||||
/.tests
|
||||
/build
|
||||
/debug
|
||||
/doc/tags
|
||||
foo.*
|
||||
node_modules
|
||||
tt.*
|
||||
|
|
|
|||
232
CHANGELOG.md
232
CHANGELOG.md
|
|
@ -1,5 +1,237 @@
|
|||
# Changelog
|
||||
|
||||
## [12.38.2](https://github.com/LazyVim/LazyVim/compare/v12.38.1...v12.38.2) (2024-07-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **news:** pcall diag when showing news for older Neovim versions ([94bf4f9](https://github.com/LazyVim/LazyVim/commit/94bf4f932482012306fb375c4418a398bb00a949))
|
||||
|
||||
## [12.38.1](https://github.com/LazyVim/LazyVim/compare/v12.38.0...v12.38.1) (2024-07-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **autcmds:** added grug-far to close with q ([3282721](https://github.com/LazyVim/LazyVim/commit/328272144c8c0b2d96988770d48c690a72613a81))
|
||||
|
||||
## [12.38.0](https://github.com/LazyVim/LazyVim/compare/v12.37.0...v12.38.0) (2024-07-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **markdown:** markdown-render toggle ([c8d0faf](https://github.com/LazyVim/LazyVim/commit/c8d0faf9b152283b2ae74f9594287a834eae002a))
|
||||
* **markdown:** replace `headlines.nvim` by `markdown.nvim` ([#4139](https://github.com/LazyVim/LazyVim/issues/4139)) ([264abdf](https://github.com/LazyVim/LazyVim/commit/264abdf9d52fe44c1dcb66f0502dcba5a881ea43))
|
||||
|
||||
## [12.37.0](https://github.com/LazyVim/LazyVim/compare/v12.36.0...v12.37.0) (2024-07-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **catppuccin:** enable grug-far integration ([#4156](https://github.com/LazyVim/LazyVim/issues/4156)) ([4bf6d85](https://github.com/LazyVim/LazyVim/commit/4bf6d856a805d38c19c8485c7a062d6cbc5cfaa8))
|
||||
* **elixir:** add elixirls code actions ([#4148](https://github.com/LazyVim/LazyVim/issues/4148)) ([f94a059](https://github.com/LazyVim/LazyVim/commit/f94a0591b3e5838794b1c3897ec21491aeb080fe))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dap:** don't mess up DAP adapters provided by nvim-dap-python ([#4141](https://github.com/LazyVim/LazyVim/issues/4141)) ([940d7df](https://github.com/LazyVim/LazyVim/commit/940d7df59aac01f6cc587f035d9b4913139fae60))
|
||||
* **dap:** extend dap.configurations from .vscode/launch.json ([#4106](https://github.com/LazyVim/LazyVim/issues/4106)) ([caf227d](https://github.com/LazyVim/LazyVim/commit/caf227dd08e83c826800cb88c34c87c600793fa3))
|
||||
* **grug-far:** use new transient option ([1c2be20](https://github.com/LazyVim/LazyVim/commit/1c2be200c185a4567c6a634da2b624d9a638fe73))
|
||||
* **keymaps:** leader-wd ([f0d8b8b](https://github.com/LazyVim/LazyVim/commit/f0d8b8b293c1fc798b576a74a87f9bd0b59714f3))
|
||||
* **keymaps:** leader-wm ([391f506](https://github.com/LazyVim/LazyVim/commit/391f506295607e12db545b85fcbe0e00b1b8efa9))
|
||||
* **news:** deprecated API ([f6cd4a3](https://github.com/LazyVim/LazyVim/commit/f6cd4a38c667e3ef56672d723705ecd8a774a0f4))
|
||||
|
||||
## [12.36.0](https://github.com/LazyVim/LazyVim/compare/v12.35.1...v12.36.0) (2024-07-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **grug-far:** no longer needed to call visual replace separately ([72d0cad](https://github.com/LazyVim/LazyVim/commit/72d0cad3530d877401ad9674f5266c79fbec396b))
|
||||
|
||||
## [12.35.1](https://github.com/LazyVim/LazyVim/compare/v12.35.0...v12.35.1) (2024-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **grug-far:** only prefill files filter when file has an extension. Closes [#4130](https://github.com/LazyVim/LazyVim/issues/4130) ([6411ab0](https://github.com/LazyVim/LazyVim/commit/6411ab0897f19dad9f902dfee29e101a9a767357))
|
||||
|
||||
## [12.35.0](https://github.com/LazyVim/LazyVim/compare/v12.34.0...v12.35.0) (2024-07-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **python:** default to new ruff instead of ruff_lsp ([#4126](https://github.com/LazyVim/LazyVim/issues/4126)) ([61ce1cf](https://github.com/LazyVim/LazyVim/commit/61ce1cfaaf8365e3b5c12b1509064579ab7d80b5))
|
||||
|
||||
## [12.34.0](https://github.com/LazyVim/LazyVim/compare/v12.33.0...v12.34.0) (2024-07-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **editor:** replace nvim-spectre with grug-far.nvim ([#4099](https://github.com/LazyVim/LazyVim/issues/4099)) ([0d561a3](https://github.com/LazyVim/LazyVim/commit/0d561a3226b46f6a44c4f2c9be2288f3b52cc351))
|
||||
* **indent-blankline:** add which-key toggles ([#4122](https://github.com/LazyVim/LazyVim/issues/4122)) ([a997152](https://github.com/LazyVim/LazyVim/commit/a997152eb2307380888d640440e0732493f82727))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **conform:** changes for new conform.nvim config ([eed91a3](https://github.com/LazyVim/LazyVim/commit/eed91a3e4c1521dd839d1a8bc09bdd98ac2fb874))
|
||||
* **toggle:** safe toggle get ([c8ab5d7](https://github.com/LazyVim/LazyVim/commit/c8ab5d7554da9f1eff69f5d6d8a0df38309d9f81))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **core:** defer clipboard because xsel and pbcopy can be slow ([#4120](https://github.com/LazyVim/LazyVim/issues/4120)) ([578f06e](https://github.com/LazyVim/LazyVim/commit/578f06e1401defbbc0a82f9ff1fb505564d038cf))
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
|
|
|
|||
6
NEWS.md
6
NEWS.md
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
## 12.x
|
||||
|
||||
- **Markdown Extra**: [headlines.nvim](https://github.com/lukas-reineke/headlines.nvim) has been removed in favor of [markdown.nvim](https://github.com/MeanderingProgrammer/markdown.nvim)
|
||||
to spice up your markdown files.
|
||||
|
||||
- [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim).
|
||||
**grug-far.nvim** has a great UI and feels more intuitive to use.
|
||||
|
||||
- This **news** is now also available on the website at [https://www.lazyvim.org/news](https://www.lazyvim.org/news)
|
||||
|
||||
- **prettier** extra now works for all prettier supported filetypes
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 July 04
|
||||
*LazyVim.txt* For Neovim Last change: 2024 July 25
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
group = augroup("close_with_q"),
|
||||
pattern = {
|
||||
"PlenaryTestPopup",
|
||||
"grug-far",
|
||||
"help",
|
||||
"lspinfo",
|
||||
"notify",
|
||||
|
|
@ -71,7 +72,11 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
},
|
||||
callback = function(event)
|
||||
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,
|
||||
})
|
||||
|
||||
|
|
@ -87,7 +92,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
-- wrap and check for spell in text filetypes
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("wrap_spell"),
|
||||
pattern = { "*.txt", "*.tex", "*.typ", "gitcommit", "markdown" },
|
||||
pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
|||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "12.25.0" -- x-release-please-version
|
||||
M.version = "12.38.2" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
|
|
@ -161,6 +161,7 @@ end
|
|||
|
||||
---@type LazyVimOptions
|
||||
local options
|
||||
local lazy_clipboard
|
||||
|
||||
---@param opts? LazyVimOptions
|
||||
function M.setup(opts)
|
||||
|
|
@ -181,6 +182,9 @@ function M.setup(opts)
|
|||
M.load("autocmds")
|
||||
end
|
||||
M.load("keymaps")
|
||||
if lazy_clipboard ~= nil then
|
||||
vim.opt.clipboard = lazy_clipboard
|
||||
end
|
||||
|
||||
LazyVim.format.setup()
|
||||
LazyVim.news.setup()
|
||||
|
|
@ -248,16 +252,17 @@ function M.load(name)
|
|||
end, { msg = "Failed loading " .. mod })
|
||||
end
|
||||
end
|
||||
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
|
||||
-- always load lazyvim, then user file
|
||||
if M.defaults[name] or name == "options" then
|
||||
_load("lazyvim.config." .. name)
|
||||
vim.api.nvim_exec_autocmds("User", { pattern = pattern .. "Defaults", modeline = false })
|
||||
end
|
||||
_load("config." .. name)
|
||||
if vim.bo.filetype == "lazy" then
|
||||
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
|
||||
vim.cmd([[do VimResized]])
|
||||
end
|
||||
local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2)
|
||||
vim.api.nvim_exec_autocmds("User", { pattern = pattern, modeline = false })
|
||||
end
|
||||
|
||||
|
|
@ -284,6 +289,9 @@ function M.init()
|
|||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
M.load("options")
|
||||
-- defer built-in clipboard handling: "xsel" and "pbcopy" can be slow
|
||||
lazy_clipboard = vim.opt.clipboard
|
||||
vim.opt.clipboard = ""
|
||||
|
||||
if vim.g.deprecation_warnings == false then
|
||||
vim.deprecate = function() end
|
||||
|
|
|
|||
|
|
@ -115,20 +115,19 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
|
|||
-- stylua: ignore start
|
||||
|
||||
-- toggle options
|
||||
map("n", "<leader>uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" })
|
||||
map("n", "<leader>uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" })
|
||||
map("n", "<leader>us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||
map("n", "<leader>uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||
map("n", "<leader>uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
||||
map("n", "<leader>ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" })
|
||||
map("n", "<leader>ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||
map("n", "<leader>uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
|
||||
map( "n", "<leader>uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
|
||||
LazyVim.toggle.map("<leader>uf", LazyVim.toggle.format())
|
||||
LazyVim.toggle.map("<leader>uF", LazyVim.toggle.format(true))
|
||||
LazyVim.toggle.map("<leader>us", LazyVim.toggle("spell", { name = "Spelling" }))
|
||||
LazyVim.toggle.map("<leader>uw", LazyVim.toggle("wrap", { name = "Wrap" }))
|
||||
LazyVim.toggle.map("<leader>uL", LazyVim.toggle("relativenumber", { name = "Relative Number" }))
|
||||
LazyVim.toggle.map("<leader>ud", LazyVim.toggle.diagnostics)
|
||||
LazyVim.toggle.map("<leader>ul", LazyVim.toggle.number)
|
||||
LazyVim.toggle.map( "<leader>uc", LazyVim.toggle("conceallevel", { values = { 0, vim.o.conceallevel > 0 and vim.o.conceallevel or 2 } }))
|
||||
LazyVim.toggle.map("<leader>uT", LazyVim.toggle.treesitter)
|
||||
LazyVim.toggle.map("<leader>ub", LazyVim.toggle("background", { values = { "light", "dark" }, name = "Background" }))
|
||||
if vim.lsp.inlay_hint then
|
||||
LazyVim.toggle.map("<leader>uh", LazyVim.toggle.inlay_hints)
|
||||
end
|
||||
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
|
||||
map("n", "<leader>ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" })
|
||||
|
||||
-- lazygit
|
||||
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" })
|
||||
|
||||
-- windows
|
||||
map("n", "<leader>ww", "<C-W>p", { desc = "Other Window", remap = true })
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
|
||||
map("n", "<leader>w-", "<C-W>s", { desc = "Split Window Below", remap = true })
|
||||
map("n", "<leader>w|", "<C-W>v", { desc = "Split Window Right", remap = true })
|
||||
map("n", "<leader>w", "<c-w>", { desc = "Windows", 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>wm", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" })
|
||||
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
|
||||
LazyVim.toggle.map("<leader>wm", LazyVim.toggle.maximize)
|
||||
|
||||
-- tabs
|
||||
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ vim.g.deprecation_warnings = false
|
|||
vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB
|
||||
|
||||
-- Show the current document symbols location from Trouble in lualine
|
||||
-- You can disable this for a buffer by setting `vim.b.trouble_lualine = false`
|
||||
vim.g.trouble_lualine = true
|
||||
|
||||
local opt = vim.opt
|
||||
|
|
|
|||
|
|
@ -140,20 +140,6 @@ return {
|
|||
-- better deal with markdown code blocks
|
||||
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)
|
||||
LazyVim.mini.pairs(opts)
|
||||
end,
|
||||
|
|
@ -171,9 +157,6 @@ return {
|
|||
"echasnovski/mini.ai",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
LazyVim.on_load("which-key.nvim", function()
|
||||
vim.schedule(LazyVim.mini.ai_whichkey)
|
||||
end)
|
||||
local ai = require("mini.ai")
|
||||
return {
|
||||
n_lines = 500,
|
||||
|
|
@ -197,6 +180,14 @@ return {
|
|||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("mini.ai").setup(opts)
|
||||
LazyVim.on_load("which-key.nvim", function()
|
||||
vim.schedule(function()
|
||||
LazyVim.mini.ai_whichkey(opts)
|
||||
end)
|
||||
end)
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ return {
|
|||
cmp = true,
|
||||
dashboard = true,
|
||||
flash = true,
|
||||
grug_far = true,
|
||||
gitsigns = true,
|
||||
headlines = true,
|
||||
illuminate = true,
|
||||
|
|
|
|||
|
|
@ -128,13 +128,25 @@ return {
|
|||
|
||||
-- search/replace in multiple files
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
build = false,
|
||||
cmd = "Spectre",
|
||||
opts = { open_cmd = "noswapfile vnew" },
|
||||
-- stylua: ignore
|
||||
"MagicDuck/grug-far.nvim",
|
||||
opts = { headerMaxWidth = 80 },
|
||||
cmd = "GrugFar",
|
||||
keys = {
|
||||
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" },
|
||||
{
|
||||
"<leader>sr",
|
||||
function()
|
||||
local grug = require("grug-far")
|
||||
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
|
||||
grug.grug_far({
|
||||
transient = true,
|
||||
prefills = {
|
||||
filesFilter = ext and ext ~= "" and "*." .. ext or nil,
|
||||
},
|
||||
})
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Search and Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -162,32 +174,69 @@ return {
|
|||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts_extend = { "spec" },
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
defaults = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gs"] = { name = "+surround" },
|
||||
["z"] = { name = "+fold" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks", ["_"] = "which_key_ignore" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
defaults = {},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
{ "<leader><tab>", group = "tabs" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>f", group = "file/find" },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>gh", group = "hunks" },
|
||||
{ "<leader>q", group = "quit/session" },
|
||||
{ "<leader>s", group = "search" },
|
||||
{ "<leader>u", group = "ui", icon = { icon = " ", color = "cyan" } },
|
||||
{ "<leader>x", group = "diagnostics/quickfix", icon = { icon = " ", color = "green" } },
|
||||
{ "[", group = "prev" },
|
||||
{ "]", group = "next" },
|
||||
{ "g", group = "goto" },
|
||||
{ "gs", group = "surround" },
|
||||
{ "z", group = "fold" },
|
||||
{
|
||||
"<leader>b",
|
||||
group = "buffer",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.buf()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"<leader>w",
|
||||
group = "windows",
|
||||
proxy = "<c-w>",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.win()
|
||||
end,
|
||||
},
|
||||
-- better descriptions
|
||||
{ "gx", desc = "Open with system app" },
|
||||
},
|
||||
},
|
||||
},
|
||||
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)
|
||||
local wk = require("which-key")
|
||||
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,
|
||||
},
|
||||
|
||||
|
|
@ -256,16 +305,18 @@ return {
|
|||
{
|
||||
"folke/trouble.nvim",
|
||||
cmd = { "Trouble" },
|
||||
opts = {},
|
||||
opts = {
|
||||
modes = {
|
||||
lsp = {
|
||||
win = { position = "right" },
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
|
||||
{ "<leader>cs", "<cmd>Trouble symbols toggle focus=false<cr>", desc = "Symbols (Trouble)" },
|
||||
{
|
||||
"<leader>cS",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||
desc = "LSP references/definitions/... (Trouble)",
|
||||
},
|
||||
{ "<leader>cs", "<cmd>Trouble symbols toggle<cr>", desc = "Symbols (Trouble)" },
|
||||
{ "<leader>cS", "<cmd>Trouble lsp toggle<cr>", desc = "LSP references/definitions/... (Trouble)" },
|
||||
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
lazy = true,
|
||||
build = (not LazyVim.is_win())
|
||||
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
|
||||
or nil,
|
||||
|
|
|
|||
|
|
@ -17,14 +17,15 @@ return {
|
|||
vim.cmd([[YankyRingHistory]])
|
||||
end
|
||||
end,
|
||||
mode = { "n", "x" },
|
||||
desc = "Open Yank History",
|
||||
},
|
||||
-- stylua: ignore
|
||||
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Text After Cursor" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Cursor" },
|
||||
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Text After Selection" },
|
||||
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Selection" },
|
||||
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
|
||||
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
|
||||
|
|
|
|||
|
|
@ -69,6 +69,11 @@ return {
|
|||
vscode.json_decode = function(str)
|
||||
return vim.json.decode(json.json_strip_comments(str))
|
||||
end
|
||||
|
||||
-- Extends dap.configurations with entries read from .vscode/launch.json
|
||||
if vim.fn.filereadable(".vscode/launch.json") then
|
||||
vscode.load_launchjs()
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -108,21 +108,26 @@ return {
|
|||
scss = "css",
|
||||
typescript = "typescript",
|
||||
typescriptreact = "typescript",
|
||||
yaml = "yaml",
|
||||
},
|
||||
groups = {
|
||||
default = {
|
||||
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
|
||||
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
|
||||
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
typescript = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
logical_alias,
|
||||
augend.constant.new({ elements = { "let", "const" } }),
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
yaml = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
augend.constant.alias.bool, -- boolean value (true <-> false)
|
||||
},
|
||||
css = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
|
|
@ -135,9 +140,6 @@ return {
|
|||
},
|
||||
markdown = {
|
||||
augend.misc.alias.markdown_header,
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
json = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
|
|
@ -151,17 +153,11 @@ return {
|
|||
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
|
||||
cyclic = true, -- "or" is incremented into "and".
|
||||
}),
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
python = {
|
||||
augend.integer.alias.decimal, -- nonnegative and negative decimal number
|
||||
capitalized_boolean,
|
||||
logical_alias,
|
||||
ordinal_numbers,
|
||||
weekdays,
|
||||
months,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,12 +190,13 @@ return {
|
|||
end,
|
||||
config = function(_, 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("fzf-lua")
|
||||
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)
|
||||
|
|
@ -210,12 +211,12 @@ return {
|
|||
},
|
||||
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||
{ "<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
|
||||
{ "<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>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
|
||||
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ return {
|
|||
"ggandor/flit.nvim",
|
||||
enabled = true,
|
||||
keys = function()
|
||||
---@type LazyKeys[]
|
||||
---@type LazyKeysSpec[]
|
||||
local ret = {}
|
||||
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
|
||||
return ret
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -14,28 +14,21 @@ return {
|
|||
opts = function()
|
||||
local defaults = require("outline.config").defaults
|
||||
local opts = {
|
||||
symbols = {},
|
||||
symbol_blacklist = {},
|
||||
symbols = {
|
||||
icons = {},
|
||||
filter = vim.deepcopy(LazyVim.config.kind_filter),
|
||||
},
|
||||
keymaps = {
|
||||
up_and_jump = "<up>",
|
||||
down_and_jump = "<down>",
|
||||
},
|
||||
}
|
||||
local filter = LazyVim.config.kind_filter
|
||||
|
||||
if type(filter) == "table" then
|
||||
filter = filter.default
|
||||
if type(filter) == "table" then
|
||||
for kind, symbol in pairs(defaults.symbols) do
|
||||
opts.symbols[kind] = {
|
||||
icon = 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
|
||||
for kind, symbol in pairs(defaults.symbols.icons) do
|
||||
opts.symbols.icons[kind] = {
|
||||
icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
|
||||
hl = symbol.hl,
|
||||
}
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ return {
|
|||
"folke/which-key.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = { ["<leader>o"] = { name = "+overseer" } },
|
||||
spec = {
|
||||
{ "<leader>o", group = "overseer" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -92,12 +92,12 @@ return {
|
|||
},
|
||||
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||
{ "<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
|
||||
{ "<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>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<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 })()
|
||||
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 {
|
||||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
|
|
@ -198,6 +212,12 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
find_command = find_command,
|
||||
hidden = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,7 +9,32 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
elixirls = {},
|
||||
elixirls = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>cp",
|
||||
function()
|
||||
local params = vim.lsp.util.make_position_params()
|
||||
LazyVim.lsp.execute({
|
||||
command = "manipulatePipes:serverid",
|
||||
arguments = { "toPipe", params.textDocument.uri, params.position.line, params.position.character },
|
||||
})
|
||||
end,
|
||||
desc = "To Pipe",
|
||||
},
|
||||
{
|
||||
"<leader>cP",
|
||||
function()
|
||||
local params = vim.lsp.util.make_position_params()
|
||||
LazyVim.lsp.execute({
|
||||
command = "manipulatePipes:serverid",
|
||||
arguments = { "fromPipe", params.textDocument.uri, params.position.line, params.position.character },
|
||||
})
|
||||
end,
|
||||
desc = "From Pipe",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -137,4 +137,17 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Filetype icons
|
||||
{
|
||||
"echasnovski/mini.icons",
|
||||
opts = {
|
||||
file = {
|
||||
[".go-version"] = { glyph = "", hl = "MiniIconsBlue" },
|
||||
},
|
||||
filetype = {
|
||||
gotmpl = { glyph = "", hl = "MiniIconsGrey" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,30 +190,40 @@ return {
|
|||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client and client.name == "jdtls" then
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
["<leader>cx"] = { name = "+extract" },
|
||||
["<leader>cxv"] = { require("jdtls").extract_variable_all, "Extract Variable" },
|
||||
["<leader>cxc"] = { require("jdtls").extract_constant, "Extract Constant" },
|
||||
["gs"] = { require("jdtls").super_implementation, "Goto Super" },
|
||||
["gS"] = { require("jdtls.tests").goto_subjects, "Goto Subjects" },
|
||||
["<leader>co"] = { require("jdtls").organize_imports, "Organize Imports" },
|
||||
}, { mode = "n", buffer = args.buf })
|
||||
wk.register({
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>cx"] = { name = "+extract" },
|
||||
["<leader>cxm"] = {
|
||||
[[<ESC><CMD>lua require('jdtls').extract_method(true)<CR>]],
|
||||
"Extract Method",
|
||||
wk.add({
|
||||
{
|
||||
mode = "n",
|
||||
buffer = args.buf,
|
||||
{ "<leader>cx", group = "extract" },
|
||||
{ "<leader>cxv", require("jdtls").extract_variable_all, desc = "Extract Variable" },
|
||||
{ "<leader>cxc", require("jdtls").extract_constant, desc = "Extract Constant" },
|
||||
{ "gs", require("jdtls").super_implementation, desc = "Goto Super" },
|
||||
{ "gS", require("jdtls.tests").goto_subjects, desc = "Goto Subjects" },
|
||||
{ "<leader>co", require("jdtls").organize_imports, desc = "Organize Imports" },
|
||||
},
|
||||
["<leader>cxv"] = {
|
||||
[[<ESC><CMD>lua require('jdtls').extract_variable_all(true)<CR>]],
|
||||
"Extract Variable",
|
||||
})
|
||||
wk.add({
|
||||
{
|
||||
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
|
||||
-- custom init for Java debugger
|
||||
|
|
@ -223,12 +233,32 @@ return {
|
|||
-- Java Test require Java debugger to work
|
||||
if opts.test and mason_registry.is_installed("java-test") then
|
||||
-- custom keymaps for Java test runner (not yet compatible with neotest)
|
||||
wk.register({
|
||||
["<leader>t"] = { name = "+test" },
|
||||
["<leader>tt"] = { require("jdtls.dap").test_class, "Run All Test" },
|
||||
["<leader>tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" },
|
||||
["<leader>tT"] = { require("jdtls.dap").pick_test, "Run Test" },
|
||||
}, { mode = "n", buffer = args.buf })
|
||||
wk.add({
|
||||
{
|
||||
mode = "n",
|
||||
buffer = args.buf,
|
||||
{ "<leader>t", group = "test" },
|
||||
{
|
||||
"<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
|
||||
|
||||
|
|
|
|||
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,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -92,30 +92,36 @@ return {
|
|||
},
|
||||
|
||||
{
|
||||
"lukas-reineke/headlines.nvim",
|
||||
opts = function()
|
||||
local opts = {}
|
||||
for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do
|
||||
opts[ft] = {
|
||||
headline_highlights = {},
|
||||
-- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66
|
||||
bullets = {},
|
||||
}
|
||||
for i = 1, 6 do
|
||||
local hl = "Headline" .. i
|
||||
vim.api.nvim_set_hl(0, hl, { link = "Headline", default = true })
|
||||
table.insert(opts[ft].headline_highlights, hl)
|
||||
end
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
"MeanderingProgrammer/markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "markdown", "norg", "rmd", "org" },
|
||||
code = {
|
||||
sign = false,
|
||||
width = "block",
|
||||
right_pad = 1,
|
||||
},
|
||||
heading = {
|
||||
sign = false,
|
||||
icons = {},
|
||||
},
|
||||
},
|
||||
ft = { "markdown", "norg", "rmd", "org" },
|
||||
config = function(_, opts)
|
||||
-- PERF: schedule to prevent headlines slowing down opening a file
|
||||
vim.schedule(function()
|
||||
require("headlines").setup(opts)
|
||||
require("headlines").refresh()
|
||||
end)
|
||||
require("render-markdown").setup(opts)
|
||||
LazyVim.toggle.map("<leader>um", {
|
||||
name = "Render Markdown",
|
||||
get = function()
|
||||
return require("render-markdown.state").enabled
|
||||
end,
|
||||
set = function(enabled)
|
||||
local m = require("render-markdown")
|
||||
if enabled then
|
||||
m.enable()
|
||||
else
|
||||
m.disable()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
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",
|
||||
command = vim.fn.exepath("netcoredbg"),
|
||||
args = { "--interpreter=vscode" },
|
||||
options = {
|
||||
detached = false,
|
||||
},
|
||||
}
|
||||
end
|
||||
for _, lang in ipairs({ "cs", "fsharp", "vb" }) do
|
||||
|
|
|
|||
|
|
@ -74,13 +74,13 @@ return {
|
|||
php = { "phpcs" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
php = { "php-cs-fixer" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
php = { "php_cs_fixer" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@ if lazyvim_docs then
|
|||
-- LSP Server to use for Python.
|
||||
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
||||
vim.g.lazyvim_python_lsp = "pyright"
|
||||
vim.g.lazyvim_python_ruff = "ruff_lsp"
|
||||
-- Set to "ruff_lsp" to use the old LSP implementation version.
|
||||
vim.g.lazyvim_python_ruff = "ruff"
|
||||
end
|
||||
|
||||
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
||||
local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp"
|
||||
local ruff = vim.g.lazyvim_python_ruff or "ruff"
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
|
|
@ -30,22 +31,22 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
pyright = {
|
||||
enabled = lsp == "pyright",
|
||||
},
|
||||
basedpyright = {
|
||||
enabled = lsp == "basedpyright",
|
||||
},
|
||||
[lsp] = {
|
||||
enabled = true,
|
||||
ruff = {
|
||||
cmd_env = { RUFF_TRACE = "messages" },
|
||||
init_options = {
|
||||
settings = {
|
||||
logLevel = "error",
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
LazyVim.lsp.action["source.organizeImports"],
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
},
|
||||
},
|
||||
ruff_lsp = {
|
||||
enabled = ruff == "ruff_lsp",
|
||||
},
|
||||
ruff = {
|
||||
enabled = ruff == "ruff",
|
||||
},
|
||||
[ruff] = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
|
|
@ -65,6 +66,16 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function(_, opts)
|
||||
local servers = { "pyright", "basedpyright", "ruff", "ruff_lsp", ruff, lsp }
|
||||
for _, server in ipairs(servers) do
|
||||
opts.servers[server] = opts.servers[server] or {}
|
||||
opts.servers[server].enabled = server == lsp or server == ruff
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
|
|
@ -127,4 +138,15 @@ return {
|
|||
table.insert(opts.auto_brackets, "python")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Don't mess up DAP adapters provided by nvim-dap-python
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
handlers = {
|
||||
python = function() end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,24 +19,22 @@ return {
|
|||
vim.keymap.set("n", "<Enter>", "<Plug>RDSendLine", { 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")
|
||||
-- Workaround from https://github.com/folke/which-key.nvim/issues/514#issuecomment-1987286901
|
||||
wk.register({
|
||||
["<localleader>"] = {
|
||||
a = { name = "+(a)ll", ["🚫"] = "which_key_ignore" },
|
||||
b = { name = "+(b)etween marks", ["🚫"] = "which_key_ignore" },
|
||||
c = { name = "+(c)hunks", ["🚫"] = "which_key_ignore" },
|
||||
f = { name = "+(f)unctions", ["🚫"] = "which_key_ignore" },
|
||||
g = { name = "+(g)oto", ["🚫"] = "which_key_ignore" },
|
||||
k = { name = "+(k)nit", ["🚫"] = "which_key_ignore" },
|
||||
p = { name = "+(p)aragraph", ["🚫"] = "which_key_ignore" },
|
||||
q = { name = "+(q)uarto", ["🚫"] = "which_key_ignore" },
|
||||
r = { name = "+(r) general", ["🚫"] = "which_key_ignore" },
|
||||
s = { name = "+(s)plit or (s)end", ["🚫"] = "which_key_ignore" },
|
||||
t = { name = "+(t)erminal", ["🚫"] = "which_key_ignore" },
|
||||
v = { name = "+(v)iew", ["🚫"] = "which_key_ignore" },
|
||||
},
|
||||
wk.add({
|
||||
buffer = true,
|
||||
{ "<localleader>a", group = "all" },
|
||||
{ "<localleader>b", group = "between marks" },
|
||||
{ "<localleader>c", group = "chunks" },
|
||||
{ "<localleader>f", group = "functions" },
|
||||
{ "<localleader>g", group = "goto" },
|
||||
{ "<localleader>i", group = "install" },
|
||||
{ "<localleader>k", group = "knit" },
|
||||
{ "<localleader>p", group = "paragraph" },
|
||||
{ "<localleader>q", group = "quarto" },
|
||||
{ "<localleader>r", group = "r general" },
|
||||
{ "<localleader>s", group = "split or send" },
|
||||
{ "<localleader>t", group = "terminal" },
|
||||
{ "<localleader>v", group = "view" },
|
||||
})
|
||||
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 {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
|
|
@ -11,12 +25,29 @@ return {
|
|||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
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",
|
||||
optional = true,
|
||||
|
|
@ -27,6 +58,16 @@ return {
|
|||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
ruby = { formatter },
|
||||
eruby = { "erb-format" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
|
|
|
|||
|
|
@ -40,6 +40,17 @@ return {
|
|||
return not vim.tbl_contains(opts.filetypes_exclude or {}, ft)
|
||||
end, opts.filetypes)
|
||||
|
||||
-- Additional settings for Phoenix projects
|
||||
opts.settings = {
|
||||
tailwindCSS = {
|
||||
includeLanguages = {
|
||||
elixir = "html-eex",
|
||||
eelixir = "html-eex",
|
||||
heex = "html-eex",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Add additional filetypes
|
||||
vim.list_extend(opts.filetypes, opts.filetypes_include or {})
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -248,4 +248,22 @@ return {
|
|||
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 = {
|
||||
init_options = {
|
||||
vue = {
|
||||
hybridMode = false,
|
||||
hybridMode = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ return {
|
|||
{ title = "Neotest Summary", ft = "neotest-summary" },
|
||||
-- "neo-tree",
|
||||
},
|
||||
right = {
|
||||
{ title = "Grug Far", ft = "grug-far", size = { width = 0.4 } },
|
||||
},
|
||||
keys = {
|
||||
-- increase width
|
||||
["<c-Right>"] = function(win)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,23 @@ return {
|
|||
end, { expr = true })
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "grug-far",
|
||||
callback = function()
|
||||
vim.b.minianimate_disable = true
|
||||
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")
|
||||
return {
|
||||
resize = {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ return {
|
|||
local pad_footer = string.rep(" ", 8)
|
||||
starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
|
||||
-- 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)
|
||||
end
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -1,21 +1,22 @@
|
|||
-- Show context of the current function
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "LazyFile",
|
||||
opts = { mode = "cursor", max_lines = 3 },
|
||||
keys = {
|
||||
{
|
||||
"<leader>ut",
|
||||
function()
|
||||
local tsc = require("treesitter-context")
|
||||
tsc.toggle()
|
||||
if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then
|
||||
LazyVim.info("Enabled Treesitter Context", { title = "Option" })
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
local tsc = require("treesitter-context")
|
||||
|
||||
LazyVim.toggle.map("<leader>ut", {
|
||||
name = "Treesitter Context",
|
||||
get = tsc.enabled,
|
||||
set = function(state)
|
||||
if state then
|
||||
tsc.enable()
|
||||
else
|
||||
LazyVim.warn("Disabled Treesitter Context", { title = "Option" })
|
||||
tsc.disable()
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Treesitter Context",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
return { mode = "cursor", max_lines = 3 }
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,4 +88,24 @@ return {
|
|||
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" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ pick = function()
|
|||
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)
|
||||
vim.api.nvim_win_close(0, false)
|
||||
LazyVim.info("Change project dir to " .. path)
|
||||
end
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ end
|
|||
|
||||
-- Add some vscode specific keymaps
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimKeymaps",
|
||||
pattern = "LazyVimKeymapsDefaults",
|
||||
callback = function()
|
||||
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
|
||||
vim.keymap.set("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
local M = {}
|
||||
|
||||
---@param opts ConformOpts
|
||||
---@param opts conform.setupOpts
|
||||
function M.setup(_, opts)
|
||||
for _, key in ipairs({ "format_on_save", "format_after_save" }) do
|
||||
if opts[key] then
|
||||
|
|
@ -10,6 +10,10 @@ function M.setup(_, opts)
|
|||
opts[key] = nil
|
||||
end
|
||||
end
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
if opts.format then
|
||||
LazyVim.warn("**conform.nvim** `opts.format` is deprecated. Please use `opts.default_format_opts` instead.")
|
||||
end
|
||||
require("conform").setup(opts)
|
||||
end
|
||||
|
||||
|
|
@ -37,8 +41,7 @@ return {
|
|||
priority = 100,
|
||||
primary = true,
|
||||
format = function(buf)
|
||||
local opts = LazyVim.opts("conform.nvim")
|
||||
require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf }))
|
||||
require("conform").format({ bufnr = buf })
|
||||
end,
|
||||
sources = function(buf)
|
||||
local ret = require("conform").list_formatters(buf)
|
||||
|
|
@ -59,16 +62,14 @@ return {
|
|||
"Please refer to the docs at https://www.lazyvim.org/plugins/formatting",
|
||||
}, { title = "LazyVim" })
|
||||
end
|
||||
---@class ConformOpts
|
||||
---@type conform.setupOpts
|
||||
local opts = {
|
||||
-- LazyVim will use these options when formatting with the conform.nvim formatter
|
||||
format = {
|
||||
default_format_opts = {
|
||||
timeout_ms = 3000,
|
||||
async = false, -- not recommended to change
|
||||
quiet = false, -- not recommended to change
|
||||
lsp_format = "fallback", -- not recommended to change
|
||||
},
|
||||
---@type table<string, conform.FormatterUnit[]>
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
fish = { "fish_indent" },
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ return {
|
|||
"mason.nvim",
|
||||
{ "williamboman/mason-lspconfig.nvim", config = function() end },
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = function()
|
||||
return {
|
||||
---@class PluginLspOpts
|
||||
local ret = {
|
||||
-- options for vim.diagnostic.config()
|
||||
---@type vim.diagnostic.Opts
|
||||
diagnostics = {
|
||||
|
|
@ -114,6 +114,7 @@ return {
|
|||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
}
|
||||
return ret
|
||||
end,
|
||||
---@param opts PluginLspOpts
|
||||
config = function(_, opts)
|
||||
|
|
@ -150,7 +151,7 @@ return {
|
|||
and vim.bo[buffer].buftype == ""
|
||||
and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype)
|
||||
then
|
||||
LazyVim.toggle.inlay_hints(buffer, true)
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = buffer })
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
@ -195,6 +196,9 @@ return {
|
|||
local server_opts = vim.tbl_deep_extend("force", {
|
||||
capabilities = vim.deepcopy(capabilities),
|
||||
}, servers[server] or {})
|
||||
if server_opts.enabled == false then
|
||||
return
|
||||
end
|
||||
|
||||
if opts.setup[server] then
|
||||
if opts.setup[server](server, server_opts) then
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ function M.get()
|
|||
-- stylua: ignore
|
||||
M._keys = {
|
||||
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
|
||||
{ "gd", vim.lsp.buf.definition(), desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", vim.lsp.buf.references(), desc = "References", nowait = true },
|
||||
{ "gI", vim.lsp.buf.implementation(), desc = "Goto Implementation" },
|
||||
{ "gy", vim.lsp.buf.type_definition(), desc = "Goto T[y]pe Definition" },
|
||||
{ "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", vim.lsp.buf.references, desc = "References", nowait = true },
|
||||
{ "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" },
|
||||
{ "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" },
|
||||
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
|
||||
{ "K", vim.lsp.buf.hover, desc = "Hover" },
|
||||
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
|
||||
|
|
|
|||
|
|
@ -1,4 +1,14 @@
|
|||
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
|
||||
-- use in Neovim to power faster and more accurate
|
||||
-- syntax highlighting.
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ return {
|
|||
options = {
|
||||
theme = "auto",
|
||||
globalstatus = vim.o.laststatus == 3,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter" } },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
|
|
@ -198,20 +198,22 @@ return {
|
|||
}
|
||||
|
||||
-- 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 symbols = trouble.statusline
|
||||
and trouble.statusline({
|
||||
mode = "symbols",
|
||||
groups = {},
|
||||
title = false,
|
||||
filter = { range = true },
|
||||
format = "{kind_icon}{symbol.name:Normal}",
|
||||
hl_group = "lualine_c_normal",
|
||||
})
|
||||
local symbols = trouble.statusline({
|
||||
mode = "symbols",
|
||||
groups = {},
|
||||
title = false,
|
||||
filter = { range = true },
|
||||
format = "{kind_icon}{symbol.name:Normal}",
|
||||
hl_group = "lualine_c_normal",
|
||||
})
|
||||
table.insert(opts.sections.lualine_c, {
|
||||
symbols and symbols.get,
|
||||
cond = symbols and symbols.has,
|
||||
cond = function()
|
||||
return vim.b.trouble_lualine ~= false and symbols.has()
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
@ -223,28 +225,40 @@ return {
|
|||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
indent = {
|
||||
char = "│",
|
||||
tab_char = "│",
|
||||
},
|
||||
scope = { show_start = false, show_end = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
opts = function()
|
||||
LazyVim.toggle.map("<leader>ug", {
|
||||
name = "Indention Guides",
|
||||
get = function()
|
||||
return require("ibl.config").get_config(0).enabled
|
||||
end,
|
||||
set = function(state)
|
||||
require("ibl").setup_buffer(0, { enabled = state })
|
||||
end,
|
||||
})
|
||||
|
||||
return {
|
||||
indent = {
|
||||
char = "│",
|
||||
tab_char = "│",
|
||||
},
|
||||
},
|
||||
},
|
||||
scope = { show_start = false, show_end = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
main = "ibl",
|
||||
},
|
||||
|
||||
|
|
@ -306,7 +320,15 @@ return {
|
|||
{
|
||||
"echasnovski/mini.icons",
|
||||
lazy = true,
|
||||
opts = {},
|
||||
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()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ return {
|
|||
{
|
||||
"folke/persistence.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = { options = vim.opt.sessionoptions:get() },
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||
|
|
|
|||
|
|
@ -97,10 +97,19 @@ end
|
|||
|
||||
---@param buf? boolean
|
||||
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
|
||||
vim.b.autoformat = not M.enabled()
|
||||
vim.b.autoformat = enable
|
||||
else
|
||||
vim.g.autoformat = not M.enabled()
|
||||
vim.g.autoformat = enable
|
||||
vim.b.autoformat = nil
|
||||
end
|
||||
M.info()
|
||||
|
|
|
|||
|
|
@ -159,17 +159,43 @@ function M.blame_line(opts)
|
|||
return require("lazy.util").float_cmd(cmd, opts)
|
||||
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()
|
||||
local lines = require("lazy.manage.process").exec({ "git", "remote", "-v" })
|
||||
local remotes = {} ---@type {name:string, url:string}[]
|
||||
|
||||
for _, line in ipairs(lines) do
|
||||
local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)")
|
||||
if name and url then
|
||||
if url:find("git@") == 1 then
|
||||
url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "")
|
||||
local name, remote = line:match("(%S+)%s+(%S+)%s+%(fetch%)")
|
||||
if name and remote then
|
||||
local url = M.get_url(remote)
|
||||
if url then
|
||||
table.insert(remotes, {
|
||||
name = name,
|
||||
url = url,
|
||||
})
|
||||
end
|
||||
table.insert(remotes, { name = name, url = url })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -60,57 +60,76 @@ function M.ai_buffer(ai_type)
|
|||
end
|
||||
|
||||
-- register all text objects with which-key
|
||||
function M.ai_whichkey()
|
||||
---@type table<string, string|table>
|
||||
local i = {
|
||||
[" "] = "Whitespace",
|
||||
['"'] = 'Balanced "',
|
||||
["'"] = "Balanced '",
|
||||
["`"] = "Balanced `",
|
||||
["("] = "Balanced (",
|
||||
[")"] = "Balanced ) including white-space",
|
||||
[">"] = "Balanced > including white-space",
|
||||
["<lt>"] = "Balanced <",
|
||||
["]"] = "Balanced ] including white-space",
|
||||
["["] = "Balanced [",
|
||||
["}"] = "Balanced } including white-space",
|
||||
["{"] = "Balanced {",
|
||||
["?"] = "User Prompt",
|
||||
_ = "Underscore",
|
||||
a = "Argument",
|
||||
b = "Balanced ), ], }",
|
||||
c = "Class",
|
||||
d = "Digit(s)",
|
||||
e = "Word in CamelCase & snake_case",
|
||||
f = "Function",
|
||||
g = "Entire file",
|
||||
i = "Indent",
|
||||
o = "Block, conditional, loop",
|
||||
q = "Quote `, \", '",
|
||||
t = "Tag",
|
||||
u = "Use/call function & method",
|
||||
U = "Use/call without dot in name",
|
||||
---@param opts table
|
||||
function M.ai_whichkey(opts)
|
||||
local objects = {
|
||||
{ " ", desc = "whitespace" },
|
||||
{ '"', desc = '" string' },
|
||||
{ "'", desc = "' string" },
|
||||
{ "(", desc = "() block" },
|
||||
{ ")", desc = "() block with ws" },
|
||||
{ "<", desc = "<> block" },
|
||||
{ ">", desc = "<> block with ws" },
|
||||
{ "?", desc = "user prompt" },
|
||||
{ "U", desc = "use/call without dot" },
|
||||
{ "[", desc = "[] block" },
|
||||
{ "]", desc = "[] block with ws" },
|
||||
{ "_", desc = "underscore" },
|
||||
{ "`", desc = "` string" },
|
||||
{ "a", desc = "argument" },
|
||||
{ "b", desc = ")]} block" },
|
||||
{ "c", desc = "class" },
|
||||
{ "d", desc = "digit(s)" },
|
||||
{ "e", desc = "CamelCase / snake_case" },
|
||||
{ "f", desc = "function" },
|
||||
{ "g", desc = "entire file" },
|
||||
{ "i", desc = "indent" },
|
||||
{ "o", desc = "block, conditional, loop" },
|
||||
{ "q", desc = "quote `\"'" },
|
||||
{ "t", desc = "tag" },
|
||||
{ "u", desc = "use/call" },
|
||||
{ "{", desc = "{} block" },
|
||||
{ "}", 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 ac = vim.deepcopy(a)
|
||||
for key, name in pairs({ n = "Next", l = "Last" }) do
|
||||
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
|
||||
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
|
||||
local ret = { mode = { "o", "x" } }
|
||||
---@type table<string, string>
|
||||
local mappings = vim.tbl_extend("force", {}, {
|
||||
around = "a",
|
||||
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
|
||||
require("which-key").register({
|
||||
mode = { "o", "x" },
|
||||
i = i,
|
||||
a = a,
|
||||
})
|
||||
require("which-key").add(ret, { notify = false })
|
||||
end
|
||||
|
||||
---@param opts {skip_next: string, skip_ts: string[], skip_unbalanced: boolean, markdown: boolean}
|
||||
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")
|
||||
pairs.setup(opts)
|
||||
local open = pairs.open
|
||||
|
|
|
|||
|
|
@ -81,7 +81,11 @@ function M.open(file, opts)
|
|||
vim.opt_local.signcolumn = "yes"
|
||||
vim.opt_local.statuscolumn = " "
|
||||
vim.opt_local.conceallevel = 3
|
||||
vim.diagnostic.disable(float.buf)
|
||||
if vim.diagnostic.enable then
|
||||
pcall(vim.diagnostic.enable, false, { bufnr = float.buf })
|
||||
else
|
||||
pcall(vim.diagnostic.disable, float.buf)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ function M.open(command, opts)
|
|||
return LazyVim.error("LazyVim.pick: picker not set")
|
||||
end
|
||||
|
||||
command = command or "auto"
|
||||
command = command ~= "auto" and command or "files"
|
||||
opts = opts or {}
|
||||
|
||||
opts = vim.deepcopy(opts)
|
||||
|
|
@ -71,21 +71,6 @@ function M.open(command, opts)
|
|||
opts.cwd = LazyVim.root({ buf = opts.buf })
|
||||
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"
|
||||
if opts.show_untracked == nil then
|
||||
opts.show_untracked = true
|
||||
opts.recurse_submodules = false
|
||||
end
|
||||
end
|
||||
end
|
||||
command = M.picker.commands[command] or command
|
||||
M.picker.open(command, opts)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ function M.open(cmd, opts)
|
|||
vim.cmd.startinsert()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd("noh")
|
||||
end
|
||||
|
||||
return terminals[termkey]
|
||||
|
|
|
|||
|
|
@ -1,115 +1,186 @@
|
|||
---@class lazyvim.util.toggle
|
||||
local M = {}
|
||||
|
||||
---@param silent boolean?
|
||||
---@param values? {[1]:any, [2]:any}
|
||||
function M.option(option, silent, values)
|
||||
if values then
|
||||
if vim.opt_local[option]:get() == values[1] then
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
vim.opt_local[option] = values[2]
|
||||
else
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
vim.opt_local[option] = values[1]
|
||||
end
|
||||
return LazyVim.info("Set " .. option .. " to " .. vim.opt_local[option]:get(), { title = "Option" })
|
||||
end
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
vim.opt_local[option] = not vim.opt_local[option]:get()
|
||||
if not silent then
|
||||
if vim.opt_local[option]:get() then
|
||||
LazyVim.info("Enabled " .. option, { title = "Option" })
|
||||
else
|
||||
LazyVim.warn("Disabled " .. option, { title = "Option" })
|
||||
end
|
||||
end
|
||||
---@class lazyvim.Toggle
|
||||
---@field name string
|
||||
---@field get fun():boolean
|
||||
---@field set fun(state:boolean)
|
||||
|
||||
---@class lazyvim.Toggle.wrap: lazyvim.Toggle
|
||||
---@operator call:boolean
|
||||
|
||||
---@param toggle lazyvim.Toggle
|
||||
function M.wrap(toggle)
|
||||
return setmetatable(toggle, {
|
||||
__call = function()
|
||||
toggle.set(not toggle.get())
|
||||
local state = toggle.get()
|
||||
if state then
|
||||
LazyVim.info("Enabled " .. toggle.name, { title = toggle.name })
|
||||
else
|
||||
LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name })
|
||||
end
|
||||
return state
|
||||
end,
|
||||
}) --[[@as lazyvim.Toggle.wrap]]
|
||||
end
|
||||
|
||||
local nu = { number = true, relativenumber = true }
|
||||
function M.number()
|
||||
if vim.opt_local.number:get() or vim.opt_local.relativenumber:get() then
|
||||
nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() }
|
||||
vim.opt_local.number = false
|
||||
vim.opt_local.relativenumber = false
|
||||
LazyVim.warn("Disabled line numbers", { title = "Option" })
|
||||
else
|
||||
vim.opt_local.number = nu.number
|
||||
vim.opt_local.relativenumber = nu.relativenumber
|
||||
LazyVim.info("Enabled line numbers", { title = "Option" })
|
||||
end
|
||||
---@param lhs string
|
||||
---@param toggle lazyvim.Toggle
|
||||
function M.map(lhs, toggle)
|
||||
local t = M.wrap(toggle)
|
||||
LazyVim.safe_keymap_set("n", lhs, function()
|
||||
t()
|
||||
end, { desc = "Toggle " .. toggle.name })
|
||||
M.wk(lhs, toggle)
|
||||
end
|
||||
|
||||
local enabled = true
|
||||
function M.diagnostics()
|
||||
-- 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
|
||||
function M.wk(lhs, toggle)
|
||||
if not LazyVim.has("which-key.nvim") then
|
||||
return
|
||||
end
|
||||
if M._maximized then
|
||||
for _, opt in ipairs(M._maximized) do
|
||||
vim.o[opt.k] = opt.v
|
||||
local function safe_get()
|
||||
local ok, enabled = pcall(toggle.get)
|
||||
if not ok then
|
||||
LazyVim.error({ "Failed to get toggle state for **" .. toggle.name .. "**:\n", enabled }, { once = true })
|
||||
end
|
||||
M._maximized = nil
|
||||
vim.cmd("wincmd =")
|
||||
else
|
||||
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 =")
|
||||
return enabled
|
||||
end
|
||||
-- `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(false)
|
||||
require("which-key").add({
|
||||
{
|
||||
lhs,
|
||||
icon = function()
|
||||
return safe_get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" }
|
||||
end,
|
||||
desc = function()
|
||||
return (safe_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,
|
||||
})
|
||||
|
||||
---@param buf? boolean
|
||||
function M.format(buf)
|
||||
return M.wrap({
|
||||
name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")",
|
||||
get = function()
|
||||
if not buf then
|
||||
return vim.g.autoformat == nil or vim.g.autoformat
|
||||
end
|
||||
return LazyVim.format.enabled()
|
||||
end,
|
||||
set = function(state)
|
||||
LazyVim.format.enable(state, buf)
|
||||
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, {
|
||||
__call = function(m, ...)
|
||||
return m.option(...)
|
||||
|
|
|
|||
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'
|
||||
|
||||
local Icons = require("mini.icons")
|
||||
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
_G.LazyVim = require("lazyvim.util")
|
||||
|
||||
|
|
@ -98,6 +100,28 @@ describe("Extra", function()
|
|||
)
|
||||
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)
|
||||
|
|
@ -11,5 +11,6 @@ require("lazy.minit").setup({
|
|||
"williamboman/mason-lspconfig.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
{ "echasnovski/mini.icons", opts = {} },
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
nvim -l tests/minit.lua --busted tests -o utfTerminal
|
||||
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