From 662e2ffe0ff8f43e15cf97029a5e1ec84bb1e376 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 13:41:59 +0200 Subject: [PATCH 01/30] fix(keymaps): use root dir for git log --- lua/lazyvim/config/keymaps.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 2bb782fc..5bd13527 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -141,8 +141,11 @@ map("n", "gf", function() end, { desc = "Lazygit Current File History" }) map("n", "gl", function() - LazyVim.lazygit({ args = { "log" } }) + LazyVim.lazygit({ args = { "log" }, cwd = LazyVim.root.git() }) end, { desc = "Lazygit Log" }) +map("n", "gL", function() + LazyVim.lazygit({ args = { "log" } }) +end, { desc = "Lazygit Log (cwd)" }) -- quit map("n", "qq", "qa", { desc = "Quit All" }) From c52242b05b96b24fd0630e854086aab1cf8e7ae7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 13:42:15 +0200 Subject: [PATCH 02/30] style: format --- lua/lazyvim/plugins/ui.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 18aa5200..adecc5eb 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -346,15 +346,15 @@ return { header = vim.split(logo, "\n"), -- stylua: ignore center = { - { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" }, - { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, - { action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" }, - { action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" }, - { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, - { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, - { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, - { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, - { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, + { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" }, + { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" }, + { action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" }, + { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, + { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, + { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, + { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, + { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, }, footer = function() local stats = require("lazy").stats() From 1faa5629642d650f31c6cfecbbbe33b429175884 Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Wed, 5 Jun 2024 18:34:33 +0545 Subject: [PATCH 03/30] ci: change the release please action name to new (#3259) * ci: change the release please action name to new * Update ci.yml * Create release-please-config.json * fix: add release manifest * fix: release-please --------- Co-authored-by: Folke Lemaitre --- .github/workflows/ci.yml | 5 +---- release-please-config.json | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b36e4c7..7b6f6478 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,13 +54,10 @@ jobs: - tests runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v4 + - uses: googleapis/release-please-action@v4 id: release with: release-type: simple - package-name: LazyVim - extra-files: | - lua/lazyvim/config/init.lua - uses: actions/checkout@v4 - name: tag stable versions if: ${{ steps.release.outputs.release_created }} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..1d1b8b1d --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "extra-files": ["lua/lazyvim/config/init.lua"] +} From 75dcce02dce58618d401f1bc4213a6e77e759cce Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:03:08 +0200 Subject: [PATCH 04/30] ci: added PR labeler --- .github/labeler.yml | 19 +++++++++++++++++++ .github/workflows/labeler.yml | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..bbe691b2 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,19 @@ +core: + - all: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/**" + - all-globs-to-all-files: "!lua/lazyvim/plugins/*" + +core-plugins: + - all: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/plugins/**" + - all-globs-to-all-files: "!lua/lazyvim/plugins/extras/*" + +extras: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/plugins/extras/**" + +extras-lang: + - changed-files: + - any-glob-to-any-file: "lua/lazyvim/plugins/extras/lang/**" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..d045889e --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,13 @@ +name: "Pull Request Labeler" +on: + - workflow_dispatch + - pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 From b7649470617a89f5dddcea84b9299ce02064e3c4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:08:20 +0200 Subject: [PATCH 05/30] ci: run labeler on existing PRs --- .github/workflows/labeler.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index d045889e..61f13c89 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -11,3 +11,35 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 + with: + pr-number: | + 3444 + 3428 + 3403 + 3402 + 3353 + 3303 + 3301 + 3293 + 3291 + 3235 + 3212 + 3169 + 3148 + 3131 + 3128 + 3073 + 3023 + 2975 + 2960 + 2956 + 2910 + 2909 + 2907 + 2881 + 2878 + 2859 + 2858 + 2853 + 2837 + 2804 From cf2870cce0873debb8d4bec7c3d64af9f78ff21c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:10:46 +0200 Subject: [PATCH 06/30] ci: fix labels --- .github/labeler.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index bbe691b2..9e3f87b8 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -2,13 +2,13 @@ core: - all: - changed-files: - any-glob-to-any-file: "lua/lazyvim/**" - - all-globs-to-all-files: "!lua/lazyvim/plugins/*" + - all-globs-to-all-files: "!lua/lazyvim/plugins/**" core-plugins: - all: - changed-files: - any-glob-to-any-file: "lua/lazyvim/plugins/**" - - all-globs-to-all-files: "!lua/lazyvim/plugins/extras/*" + - all-globs-to-all-files: "!lua/lazyvim/plugins/extras/**" extras: - changed-files: From 39c10b2b813308abf56293cc2cdfe9ebbc14fa21 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:16:39 +0200 Subject: [PATCH 07/30] ci: remove custom pr-numbers --- .github/workflows/labeler.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 61f13c89..52474c6a 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,6 +1,5 @@ name: "Pull Request Labeler" on: - - workflow_dispatch - pull_request_target jobs: @@ -11,35 +10,3 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 - with: - pr-number: | - 3444 - 3428 - 3403 - 3402 - 3353 - 3303 - 3301 - 3293 - 3291 - 3235 - 3212 - 3169 - 3148 - 3131 - 3128 - 3073 - 3023 - 2975 - 2960 - 2956 - 2910 - 2909 - 2907 - 2881 - 2878 - 2859 - 2858 - 2853 - 2837 - 2804 From 71165ac52a707350b67600c9c939b0c78a8f5c07 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:19:04 +0200 Subject: [PATCH 08/30] ci: label more PRs --- .github/workflows/labeler.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 52474c6a..992dc1d9 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,5 +1,6 @@ name: "Pull Request Labeler" on: + - workflow_dispatch - pull_request_target jobs: @@ -10,3 +11,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 + with: + pr-number: | + 2802 + 2797 + 2795 + 2695 + 2519 + 2495 + 2450 + 2449 + 2421 + 2416 + 2285 + 2282 + 2242 + 2232 + 2179 + 1958 + 1956 + 1949 + 1935 + 1884 + 1849 + 1815 + 1750 + 1740 + 1484 + 1450 From 7ed5a6c371e334938eec5ad4e9193993470eee64 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:20:32 +0200 Subject: [PATCH 09/30] ci: remove custom pr-numbers again --- .github/workflows/labeler.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 992dc1d9..52474c6a 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,6 +1,5 @@ name: "Pull Request Labeler" on: - - workflow_dispatch - pull_request_target jobs: @@ -11,31 +10,3 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 - with: - pr-number: | - 2802 - 2797 - 2795 - 2695 - 2519 - 2495 - 2450 - 2449 - 2421 - 2416 - 2285 - 2282 - 2242 - 2232 - 2179 - 1958 - 1956 - 1949 - 1935 - 1884 - 1849 - 1815 - 1750 - 1740 - 1484 - 1450 From a2cf7d9a11862997e54fa2ddfd56f364d349dd8c Mon Sep 17 00:00:00 2001 From: Seol So Date: Wed, 5 Jun 2024 09:22:30 -0400 Subject: [PATCH 10/30] docs: add the Korean version of README (#2495) --- README-KO.md | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 README-KO.md diff --git a/README-KO.md b/README-KO.md new file mode 100644 index 00000000..eb5cdb1d --- /dev/null +++ b/README-KO.md @@ -0,0 +1,139 @@ +
+ +
+ +
+ +

+ 설치하기 + · + 설정하기 + · + 문서 +

+ + + +LazyVim은 [💤 lazy.nvim](https://github.com/folke/lazy.nvim)를 기반으로 작동하는 Neovim 셋업입니다. 더 커스터마이징 가능하고, 설정들을 바꾸는 것을 쉽게 만들기위해 시작되었죠. 그저 처음부터 모든 설정들을 만지고 시작하는 방법, 또는 이미 만들어진 배포용 설정을 사용하는 방법이 있지만, LazyVIM은 이미 잘 설정된 환경과, 필요에 따라 쉽게 바꿀 수 있는 유연성을 모두 포괄합니다. 이를 통해 훨신 쉽고 편리한, 전에는 만나보실 수 없었던 새로운 Nvim의 세계를 경험하실 수 있으실 겁니다. + +![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) + +![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) + +## ✨ 기능 + +- 🔥 Neovim을 완벽한 IDE로 바꾸어보세요. +- 💤 lazy.vim과 함께 쉽게 커스터마이징하고, 확장하세요. +- 🚀 완전히 빠른 속도를 경험해보세요. +- 🧹 기본적으로 만져져있는 옵션, 자동커멘드, 그리고 단축키들을 아무런 추가적인 설정없이 사용해보세요. +- 📦 안정적이고 미리 설정되어져있는 플러그인들과 함게 코딩하세요. + +## ⚡️ 요구사항 + +- **0.9.0**이상의 Neovim (LuaJIT과 함께 개발이 되어져있어야함니다.) +- **2.19.0**이상의 Git (이것은 부분적인 클론기능을 지원하기 위함입니다.) +- [Nerd Font](https://www.nerdfonts.com/) **_(옵션)_** +- `nvim-treesitter`를 위한 **C** 컴파일러. [이 문서](https://github.com/nvim-treesitter/nvim-treesitter#requirements)를 확인해주시기바랍니다. + +## 🚀 시작하기 + +[이 깃헙 레파지토리](https://github.com/LazyVim/starter)에서 스타터 템플릿을 찾으실 수 있습니다. + +
도커와 함께 시작해보기 + +```sh +docker run -w /root -it --rm alpine:edge sh -uelic ' + apk add git lazygit neovim ripgrep alpine-sdk --update + git clone https://github.com/LazyVim/starter ~/.config/nvim + cd ~/.config/nvim + nvim +' +``` + +
+ +
LazyVim 스타터와 함께 시작해보기 + +- 현재 Neovim 파일들을 미리 백업: + + ```sh + mv ~/.config/nvim ~/.config/nvim.bak + mv ~/.local/share/nvim ~/.local/share/nvim.bak + ``` + +- Lazyvim 스타터 깃헙 레파지토리 복제: + + ```sh + git clone https://github.com/LazyVim/starter ~/.config/nvim + ``` + +- 나중에 본인의 레파지토리에 저장할 경우를 대비해 .git 폴더 지우기 + + ```sh + rm -rf ~/.config/nvim/.git + ``` + +- Neovim! + + ```sh + nvim + ``` + + LazyVim를 커스터마이징 하는 법에 대해 다룬 설명을 참조해주시기 바랍니다. + +
+ +--- + +유튜브에 LazyVim시작하기에 대해 [@elijahmanor](https://github.com/elijahmanor)에 의해 만들어진 영상이 있으니, 시청해 보시는 것을 추천드립니다. + +[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM) + +## 📂 파일 구조 + +config 폴더 안에 있는 모든 파일들은 적절한 시간내에 자동으로 로드가 되기에, 아무 파일도 require를 하지 않아도 됩니다. **LazyVim**은 config폴더 안에 있는 모든 기본 파일들을 당신의 config 파일들 **전**에 불어옵니다. 이것에 대해서는, [이 문서](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)를 확인해 보시기 바랍니다. + +추가적인 플러그인을 설치하시거나, 미리 설치되고 설정된 플러그인들을 또 덮어서 설정을 바꾸거나, 지우거나, 추가하고 싶으실 경우에는, 그에 해당하는 lua 파일들을 `lua/plugins` 폴더 안에 추가하시면, lazy.nvim이 자동적으로 그 파일들을 로드 할 것입니다. + +
+~/.config/nvim
+├── lua
+│   ├── config
+│   │   ├── autocmds.lua
+│   │   ├── keymaps.lua
+│   │   ├── lazy.lua
+│   │   └── options.lua
+│   └── plugins
+│       ├── spec1.lua
+│       ├── **
+│       └── spec2.lua
+└── init.lua
+
+ +## ⚙️ 설정 + +[Lazyvim 공식문서](https://lazyvim.github.io)를 확인해 주시기 바랍니다. + +LazyVim 공식문서의 한국어 지원은 현재 번역 중에 있습니다. From ea62195fe5e5f89beb37ca90f7bf974508bbba07 Mon Sep 17 00:00:00 2001 From: Takeshi Ooka <74577802+t-ooka@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:22:50 +0900 Subject: [PATCH 11/30] docs: Added Japanese Translation of the README (#2232) * add Japanese README file * fix some typo --- README-JP.md | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 README-JP.md diff --git a/README-JP.md b/README-JP.md new file mode 100644 index 00000000..316ede80 --- /dev/null +++ b/README-JP.md @@ -0,0 +1,139 @@ +
+ +
+ +
+ +

+ インストール + · + 設定 + · + ドキュメント +

+ + + +LazyVimは、設定の拡張と変更を容易にするために[💤 lazy.nvim](https://github.com/folke/lazy.nvim)によって提供されるNeovimセットアップです。 +LazyVimは、ゼロから始めるか、あらかじめ作成されたディストリビューションを使用するかの選択を迫ることなく、 +必要に応じて設定を調整する柔軟性と、事前に設定されたセットアップの利便性を両方叶える最高の世界を提供します。 + +![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) + +![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) + +## ✨ 機能 + +- 🔥 Neovimを本格的なIDEへと変身させます +- 💤 [lazy.nvim](https://github.com/folke/lazy.nvim)で簡単にカスタマイズと拡張が可能 +- 🚀 驚くほどの高速さ +- 🧹 Options, autocmds, そしてkeymapsのための合理的なデフォルト設定 +- 📦 事前に設定がされ、使用可能なプラグインが豊富についてきます + +## ⚡️ 必要要件 + +- Neovim >= **0.9.0** (**LuaJIT**でビルドされている必要があります) +- Git >= **2.19.0** (部分的なcloneサポートのため) +- [Nerd Font](https://www.nerdfonts.com/) **_(任意)_** +- `nvim-treesitter`用の**C**コンパイラ。詳細は[こちら](https://github.com/nvim-treesitter/nvim-treesitter#requirements) + +## 🚀 Getting Started + +**lazyvim**のスターターテンプレートは[こちら](https://github.com/lazyvim/starter)。 + +
Dockerで試す + +```sh +docker run -w /root -it --rm alpine:edge sh -uelic ' + apk add git lazygit neovim ripgrep alpine-sdk --update + git clone https://github.com/LazyVim/starter ~/.config/nvim + cd ~/.config/nvim + nvim +' +``` + +
+ +
LazyVim Starterをインストール + +- 既存のNeovimファイルのバックアップを作成します。 + + ```sh + mv ~/.config/nvim ~/.config/nvim.bak + mv ~/.local/share/nvim ~/.local/share/nvim.bak + ``` + +- スターターをcloneします。 + + ```sh + git clone https://github.com/LazyVim/starter ~/.config/nvim + ``` + +- 後ほど自分のリポジトリに加えられるように、`.git`フォルダを削除します。 + ```sh + rm -rf ~/.config/nvim/.git + ``` + +- Neovimを起動します! + + ```sh + nvim + ``` + + **LazyVim**をカスタマイズするために、ファイルのコメントを参照してください。 + +
+ +--- + +[@elijahmanor](https://github.com/elijahmanor)氏によって作成された始めるにあたっての概要動画があります。 + +[![動画を見る](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM) + +## 📂 ファイル構造 + +config配下にあるファイルは適切なタイミングで自動的にロードされる為、 +手動でそれらのファイルをrequireする必要はありません。 +LazyVimには、自分で設定したものより先にロードされるデフォルトの設定ファイルが付属しています。詳しくは[こちら](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)。 +カスタムプラグインをlua/plugins/の下に追加することができます。lua/plugins/配下の全てのファイルは[lazy.nvim](https://github.com/folke/lazy.nvim)によって自動的にロードされます。 + +
+~/.config/nvim
+├── lua
+│   ├── config
+│   │   ├── autocmds.lua
+│   │   ├── keymaps.lua
+│   │   ├── lazy.lua
+│   │   └── options.lua
+│   └── plugins
+│       ├── spec1.lua
+│       ├── **
+│       └── spec2.lua
+└── init.lua
+
+ +## ⚙️ 設定 + +こちらの[ドキュメント](https://lazyvim.github.io)を参照してください。 From cdadb59ee347bf5dfed3f13d19782268a6e2449e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Freitas?= Date: Wed, 5 Jun 2024 13:23:09 +0000 Subject: [PATCH 12/30] docs(pt): add readme in portuguese (#1958) --- README-PT.md | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 README-PT.md diff --git a/README-PT.md b/README-PT.md new file mode 100644 index 00000000..7fb8572e --- /dev/null +++ b/README-PT.md @@ -0,0 +1,146 @@ +
+ +
+ +
+ +

+ Instalar + · + Configurar + · + Documentação +

+ + + +LazyVim é uma configuração de Neovim potenciada por [💤 lazy.nvim](https://github.com/folke/lazy.nvim) +para tornar fácil customizar e extender a tua configuração. +Em vez de ter de escolher entre começar de raiz ou usar +uma distribuição pré-feita, LazyVim oferece o melhor +dos dois mundos - a flexibilidade de alterar a tua configuração +como necessário, junto com a conveniência de um setup pré-configurado. + +![imagem](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png) + +![imagem](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png) + +## ✨ Características + +- 🔥 Transforma o teu Neovim num IDE completo. +- 💤 Customiza e extende a tua configuração facilmente com [lazy.nvim](https://github.com/folke/lazy.nvim) +- 🚀 Super rápido +- 🧹 Definições comuns para options, autocms e keymaps +- 📦 Contém uma variedade de plugins pré-configurados e preparados a usar + +## ⚡️ Requesitos + +- Neovim >= **0.9.0** (preciso fazer build com **LuaJIT**) +- Git >= **2.19.0** (para suporte parcial de clones) +- uma [Nerd Font](https://www.nerdfonts.com/) **_(opcional)_** +- um compilador de **C** para `nvim-treesitter`. Mais informações [aqui](https://github.com/nvim-treesitter/nvim-treesitter#requirements) + +## 🚀 Como Começar + +Podes encontrar uma template **LazyVim** starter para começar, [aqui](https://github.com/LazyVim/starter) + +
Experimenta com docker + +```sh +docker run -w /root -it --rm alpine:edge sh -uelic ' + apk add git lazygit neovim ripgrep alpine-sdk --update + git clone https://github.com/LazyVim/starter ~/.config/nvim + cd ~/.config/nvim + nvim +' +``` + +
+ +
Instala a template LazyVim Starter + +- Faz um backup da tua configuração atual de Neovim: + + ```sh + mv ~/.config/nvim ~/.config/nvim.bak + mv ~/.local/share/nvim ~/.local/share/nvim.bak + ``` + +- Clona a template + + ```sh + git clone https://github.com/LazyVim/starter ~/.config/nvim + ``` + +- Remove o diretório `.git`, para poderes adicionar ao teu próprio repositório mais tarde + + ```sh + rm -rf ~/.config/nvim/.git + ``` + +- Inicia o Neovim! + + ```sh + nvim + ``` + + Consulta os comentários nos ficheiros sobre como customizar **LazyVim**. + +
+ +--- + +Existe um excelente video criado por [@elijahmanor](https://github.com/elijahmanor) com um passo a passo para começar. + +[![Vê o video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM) + +## 📂 Extrutura de ficheiros + +Os ficheiros no diretório **config** serão carregados automaticamente +no momento apropriado, por isso não é necessário carregar os plugins manualmente. +**LazyVim** vem com um conjunto de ficheiros +que serão carregados **_antes_** dos teus. Lẽ mais [aqui](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config) + +Tu podes acrescentar a tua configuração em `lua/plugins`. Todos os ficheiros +neste diretório serão carregados automaticamente por [lazy.nvim](https://github.com/folke/lazy.nvim) + +
+~/.config/nvim
+├── lua
+│   ├── config
+│   │   ├── autocmds.lua
+│   │   ├── keymaps.lua
+│   │   ├── lazy.lua
+│   │   └── options.lua
+│   └── plugins
+│       ├── spec1.lua
+│       ├── **
+│       └── spec2.lua
+└── init.lua
+
+ +## ⚙️ Configuração + +Consulta a [documentação](https://lazyvim.github.io) From ff9ca808e0f35f8bcf3284652970937aae44ec61 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:36:46 +0200 Subject: [PATCH 13/30] ci: added stylua / stale / conventional commits --- .github/workflows/ci.yml | 17 +++++++++++++++++ .github/workflows/stale.yml | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b6f6478..e3d580f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,23 @@ on: pull_request: jobs: + commit_msg: + name: Conventional Commit Messages + runs-on: ubuntu-latest + if: ${{ github.ref != 'refs/heads/main' }} + steps: + - uses: actions/checkout@v4 + - uses: webiny/action-conventional-commits@v1.3.0 + stylua: + name: Stylua Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: JohnnyMorganz/stylua-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --check . tests: strategy: matrix: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..5199c7ec --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,21 @@ +name: Close stale issues and PRs + +on: + workflow_call: + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + # 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 From 7f65b2411389dba1ab0b7a2186d949ed98bf8ae5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:38:04 +0200 Subject: [PATCH 14/30] style: r.lua --- lua/lazyvim/plugins/extras/lang/r.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index 49b3dd9c..eee57149 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -40,7 +40,7 @@ return { }) end, }, - pdfviewer = "" + pdfviewer = "", }, config = function(_, opts) vim.g.rout_follow_colorscheme = true From d6dea2247cd84fbe859dd27ba548a066c1fec9cb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:41:32 +0200 Subject: [PATCH 15/30] ci: enable conventional commit linter on main --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3d580f5..a1c6670f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,6 @@ jobs: commit_msg: name: Conventional Commit Messages runs-on: ubuntu-latest - if: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - uses: webiny/action-conventional-commits@v1.3.0 From 90d8ff27d2c60183a194e36fc5da643ad1036472 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:43:22 +0200 Subject: [PATCH 16/30] ci: fix stale workflow --- .github/workflows/stale.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5199c7ec..e4e03b57 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,7 +1,9 @@ name: Close stale issues and PRs on: - workflow_call: + workflow_dispatch: + schedule: + - cron: "30 1 * * *" jobs: stale: From 99c06952a012f0270b8837c5f60bbc8aa83ccb6a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 15:53:22 +0200 Subject: [PATCH 17/30] ci: stale --- .github/workflows/stale.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index e4e03b57..9ebbb312 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,6 +11,7 @@ jobs: steps: - uses: actions/stale@v9 with: + operations-per-run: 300 # default stale time days-before-stale: 30 days-before-close: 7 @@ -20,4 +21,7 @@ jobs: # exclude issues with certain labels exempt-issue-labels: pinned,wip,security,notice # never stale issues attached to a milestone - exempt-all-milestones: true + # 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." From de9e337f0dcd27a7621f6ab741ad3a5d769dbd7c Mon Sep 17 00:00:00 2001 From: Kevin Traver Date: Wed, 5 Jun 2024 08:04:17 -0600 Subject: [PATCH 18/30] feat(keymaps): add keymap to close all tab pages except the current one (#2975) * feat(keymaps): add keymap to close all tab pages except the current one * fix: use o --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/config/keymaps.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 5bd13527..768a41b8 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -185,6 +185,7 @@ map("n", "m", function() LazyVim.toggle.maximize() end, { desc = "Maximi -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) +map("n", "o", "tabonly", { desc = "Close Other Tabs" }) map("n", "f", "tabfirst", { desc = "First Tab" }) map("n", "", "tabnew", { desc = "New Tab" }) map("n", "]", "tabnext", { desc = "Next Tab" }) From 1806ea710fe391d5b00c1916ed9331bf58cfdb49 Mon Sep 17 00:00:00 2001 From: Dale Lakes <103068176+thedalelakes@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:11:16 -0400 Subject: [PATCH 19/30] feat(bufferline): add keymaps for BufferLineMovePrev / BufferLineMoveNext (#1935) * Add mappings for BufferLineMovePrev / BufferLineMoveNext * Change to '[B' and ']B' --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/ui.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index adecc5eb..5ef3405e 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -67,6 +67,8 @@ return { { "", "BufferLineCycleNext", desc = "Next Buffer" }, { "[b", "BufferLineCyclePrev", desc = "Prev Buffer" }, { "]b", "BufferLineCycleNext", desc = "Next Buffer" }, + { "[B", "BufferLineMovePrev", desc = "Move buffer prev" }, + { "]B", "BufferLineMoveNext", desc = "Move buffer next" }, }, opts = { options = { From 1cdb5bdf412933bb1be44a3ae5905202124718d9 Mon Sep 17 00:00:00 2001 From: Rabin Adhikari Date: Wed, 5 Jun 2024 20:18:49 +0545 Subject: [PATCH 20/30] feat(python): switch to regexp branch for a rewrite the venv selector plugin (#3301) It has eliminated many bugs and allows users to easily add their searches, if the plugin doesn't find them automatically. --- lua/lazyvim/plugins/extras/lang/python.lua | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 7a716b3e..54d25d8c 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -112,20 +112,17 @@ return { }, { "linux-cultist/venv-selector.nvim", + branch = "regexp", -- Use this branch for the new version cmd = "VenvSelect", - opts = function(_, opts) - if LazyVim.has("nvim-dap-python") then - opts.dap_enabled = true - end - return vim.tbl_deep_extend("force", opts, { - name = { - "venv", - ".venv", - "env", - ".env", + opts = { + settings = { + options = { + notify_user_on_venv_activation = true, }, - }) - end, + }, + }, + -- Call config for python files and load the cached venv automatically + ft = "python", keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv", ft = "python" } }, }, { From 373d6b60e134cffe8a70224dfb2e99629fac6cfb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 16:42:13 +0200 Subject: [PATCH 21/30] style: python.lua --- lua/lazyvim/plugins/extras/lang/python.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 54d25d8c..b727b468 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -122,7 +122,7 @@ return { }, }, -- Call config for python files and load the cached venv automatically - ft = "python", + ft = "python", keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv", ft = "python" } }, }, { From 106130f4cd8b116672c64116d4267c6c3196a40f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 17:31:51 +0200 Subject: [PATCH 22/30] ci: added some tests --- .github/workflows/ci.yml | 2 +- tests/extras/lang_spec.lua | 34 ++++++++++++++++++++++++ tests/init.lua | 53 ++++++++++++++++++++++++++++++++++++++ tests/run | 3 +++ 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 tests/extras/lang_spec.lua create mode 100644 tests/init.lua create mode 100755 tests/run diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1c6670f..93f48b12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: run: | nvim --version [ ! -d tests ] && exit 0 - nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua', sequential = true}" + ./tests/run docs: runs-on: ubuntu-latest needs: tests diff --git a/tests/extras/lang_spec.lua b/tests/extras/lang_spec.lua new file mode 100644 index 00000000..8a99ec3b --- /dev/null +++ b/tests/extras/lang_spec.lua @@ -0,0 +1,34 @@ +---@module 'luassert' + +local Plugin = require("lazy.core.plugin") +_G.LazyVim = require("lazyvim.util") + +describe("Extra", function() + local Config = require("lazy.core.config") + assert(vim.tbl_count(Config.plugins) > 0, "Lazy not properly setup") + + ---@type {modname:string, modpath:string}[] + local extras = vim.tbl_map( + ---@param path string + function(path) + local modname = path:sub(5):gsub("%.lua$", ""):gsub("/", ".") + return { modname = modname, modpath = path } + end, + vim.fs.find(function(name) + return name:match("%.lua$") + end, { limit = math.huge, type = "file", path = "lua/lazyvim/plugins/extras" }) + ) + + for _, extra in ipairs(extras) do + it(extra.modname .. " is valid", function() + local mod = require(extra.modname) + local spec = Plugin.Spec.new(mod, { optional = true }) + assert.is_not_nil(mod) + assert(#spec.notifs == 0, "Invalid spec: " .. vim.inspect(spec.notifs)) + + if extra.modname:find("%.lang%.") then + assert(mod.recommended, "`recommended` not set for " .. extra.modname) + end + end) + end +end) diff --git a/tests/init.lua b/tests/init.lua new file mode 100644 index 00000000..8132688a --- /dev/null +++ b/tests/init.lua @@ -0,0 +1,53 @@ +-- DO NOT change the paths and don't remove the colorscheme +local root = vim.fn.fnamemodify("./.tests", ":p") + +-- set stdpaths to use .repro +for _, name in ipairs({ "config", "data", "state", "cache" }) do + vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name +end + +-- bootstrap lazy +local lazypath = root .. "/plugins/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + print("Bootstrapping lazy.nvim") + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath }) +end +vim.opt.runtimepath:prepend(lazypath) + +-- install plugins +local plugins = { + "LazyVim/starter", + { "nvim-lua/plenary.nvim" }, + { "folke/lazy.nvim" }, +} + +local function main() + print("Installing plugins") + require("lazy").setup(plugins, { + root = root .. "/plugins", + performance = { + rtp = { + reset = false, + }, + }, + }) + + if vim.o.filetype == "lazy" then + vim.cmd.close() + end + + print("Updating plugins") + -- update plugins, wait for it to finish and don't show the output + require("lazy").update({ wait = true, show = false }) + -- require("lazy.core.cache").reset() + + vim.opt.rtp:append(".") +end + +local Util = require("lazy.core.util") +Util.try(main, { + on_error = function(err) + print(err) + os.exit(1) + end, +}) diff --git a/tests/run b/tests/run new file mode 100755 index 00000000..631fb09a --- /dev/null +++ b/tests/run @@ -0,0 +1,3 @@ +#!/bin/sh + +nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests {init = 'tests//init.lua', sequential = true}" From ca0b9ee915c7e5ddc4ca828688c2cb87f4f0c438 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 17:36:02 +0200 Subject: [PATCH 23/30] fix(extras): added recommended for helm/haskell --- lua/lazyvim/plugins/extras/lang/haskell.lua | 6 ++++++ lua/lazyvim/plugins/extras/lang/helm.lua | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/haskell.lua b/lua/lazyvim/plugins/extras/lang/haskell.lua index be1636bf..5ec5a5ec 100644 --- a/lua/lazyvim/plugins/extras/lang/haskell.lua +++ b/lua/lazyvim/plugins/extras/lang/haskell.lua @@ -1,4 +1,10 @@ return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "haskell", "lhaskell" }, + root = { "hie.yaml", "stack.yaml", "cabal.project", "*.cabal", "package.yaml" }, + }) + end, -- Add Haskell to treesitter { diff --git a/lua/lazyvim/plugins/extras/lang/helm.lua b/lua/lazyvim/plugins/extras/lang/helm.lua index 3f1fe00d..de537ba3 100644 --- a/lua/lazyvim/plugins/extras/lang/helm.lua +++ b/lua/lazyvim/plugins/extras/lang/helm.lua @@ -9,6 +9,13 @@ LazyVim.lsp.on_attach(function(client, buffer) end) return { + recommended = function() + return LazyVim.extras.wants({ + ft = "helm", + root = "Chart.yaml", + }) + end, + { "towolf/vim-helm", ft = "helm" }, { "neovim/nvim-lspconfig", From 368c060b45f260c34b87e17fe9a7d0f26992110c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 17:47:46 +0200 Subject: [PATCH 24/30] tests: check for treesitter langs and mason lsp config --- tests/extras/lang_spec.lua | 33 ++++++++++++++++++++++++++++++++- tests/init.lua | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/extras/lang_spec.lua b/tests/extras/lang_spec.lua index 8a99ec3b..7a58be5c 100644 --- a/tests/extras/lang_spec.lua +++ b/tests/extras/lang_spec.lua @@ -5,6 +5,7 @@ _G.LazyVim = require("lazyvim.util") describe("Extra", function() local Config = require("lazy.core.config") + local Loader = require("lazy.core.loader") assert(vim.tbl_count(Config.plugins) > 0, "Lazy not properly setup") ---@type {modname:string, modpath:string}[] @@ -18,16 +19,46 @@ describe("Extra", function() return name:match("%.lua$") end, { limit = math.huge, type = "file", path = "lua/lazyvim/plugins/extras" }) ) + local servers = require("mason-lspconfig.mappings.server").package_to_lspconfig + + local tsspec = Plugin.Spec.new({ + import = "lazyvim.plugins.treesitter", + }, { optional = true }) + + local tsopts = Plugin.values(tsspec.plugins["nvim-treesitter"], "opts", false) + + local tsensure = tsopts.ensure_installed + assert(type(tsensure) == "table", "No ensure_installed in nvim-treesitter spec") for _, extra in ipairs(extras) do it(extra.modname .. " is valid", function() local mod = require(extra.modname) - local spec = Plugin.Spec.new(mod, { optional = true }) + local spec = Plugin.Spec.new({ + { "williamboman/mason.nvim", opts = { ensure_installed = {} } }, + { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } }, + mod, + }, { optional = true }) assert.is_not_nil(mod) assert(#spec.notifs == 0, "Invalid spec: " .. vim.inspect(spec.notifs)) if extra.modname:find("%.lang%.") then assert(mod.recommended, "`recommended` not set for " .. extra.modname) + local mason = spec.plugins["mason.nvim"] + local opts = Plugin.values(mason, "opts", false) + for _, v in ipairs(opts.ensure_installed) do + assert( + not servers[v], + "LSP server " .. v .. " is installed automatically. Please remove from the mason.nvim spec" + ) + end + local ts = spec.plugins["nvim-treesitter"] + opts = Plugin.values(mason, "opts", false) + for _, v in ipairs(opts.ensure_installed) do + assert( + not vim.tbl_contains(tsensure, v), + "TS lang " .. v .. " is already a default. Please remove from the mason.nvim spec" + ) + end end end) end diff --git a/tests/init.lua b/tests/init.lua index 8132688a..ca44aab6 100644 --- a/tests/init.lua +++ b/tests/init.lua @@ -19,6 +19,8 @@ local plugins = { "LazyVim/starter", { "nvim-lua/plenary.nvim" }, { "folke/lazy.nvim" }, + "williamboman/mason-lspconfig.nvim", + "williamboman/mason.nvim", } local function main() From f8268faa7c705cca7047fbaef5984905b47a7324 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 18:07:01 +0200 Subject: [PATCH 25/30] fix: cleanup unnecessary treesitter langs and mason lsp servers --- lua/lazyvim/plugins/extras/lang/ansible.lua | 8 ------ lua/lazyvim/plugins/extras/lang/clangd.lua | 2 +- lua/lazyvim/plugins/extras/lang/elixir.lua | 8 ------ lua/lazyvim/plugins/extras/lang/helm.lua | 8 ------ lua/lazyvim/plugins/extras/lang/json.lua | 2 +- lua/lazyvim/plugins/extras/lang/markdown.lua | 10 +------ lua/lazyvim/plugins/extras/lang/python.lua | 2 +- lua/lazyvim/plugins/extras/lang/r.lua | 2 +- lua/lazyvim/plugins/extras/lang/ruby.lua | 8 ------ lua/lazyvim/plugins/extras/lang/rust.lua | 2 +- lua/lazyvim/plugins/extras/lang/tex.lua | 1 + lua/lazyvim/plugins/extras/lang/toml.lua | 25 +++------------- lua/lazyvim/plugins/extras/lang/yaml.lua | 10 ------- tests/extras/lang_spec.lua | 30 ++++++++++++++------ 14 files changed, 32 insertions(+), 86 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/ansible.lua b/lua/lazyvim/plugins/extras/lang/ansible.lua index 5f080395..0a3987a6 100644 --- a/lua/lazyvim/plugins/extras/lang/ansible.lua +++ b/lua/lazyvim/plugins/extras/lang/ansible.lua @@ -5,14 +5,6 @@ return { root = { "ansible.cfg", ".ansible-lint" }, }) end, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "yaml" }) - end - end, - }, { "williamboman/mason.nvim", opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index 86a1afe7..f9fb1f13 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -18,7 +18,7 @@ return { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "c", "cpp" }) + vim.list_extend(opts.ensure_installed, { "cpp" }) end end, }, diff --git a/lua/lazyvim/plugins/extras/lang/elixir.lua b/lua/lazyvim/plugins/extras/lang/elixir.lua index a6b9c260..503dbbed 100644 --- a/lua/lazyvim/plugins/extras/lang/elixir.lua +++ b/lua/lazyvim/plugins/extras/lang/elixir.lua @@ -15,14 +15,6 @@ return { }) end, }, - { - "williamboman/mason.nvim", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { - "elixir-ls", - }) - end, - }, { "nvim-neotest/neotest", optional = true, diff --git a/lua/lazyvim/plugins/extras/lang/helm.lua b/lua/lazyvim/plugins/extras/lang/helm.lua index de537ba3..566e7975 100644 --- a/lua/lazyvim/plugins/extras/lang/helm.lua +++ b/lua/lazyvim/plugins/extras/lang/helm.lua @@ -26,12 +26,4 @@ return { }, }, }, - { - "williamboman/mason.nvim", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { - "helm-ls", - }) - end, - }, } diff --git a/lua/lazyvim/plugins/extras/lang/json.lua b/lua/lazyvim/plugins/extras/lang/json.lua index 3f1de268..688432ec 100644 --- a/lua/lazyvim/plugins/extras/lang/json.lua +++ b/lua/lazyvim/plugins/extras/lang/json.lua @@ -11,7 +11,7 @@ return { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "json", "json5", "jsonc" }) + vim.list_extend(opts.ensure_installed, { "json5" }) end end, }, diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 81f4cc88..fe7c8be4 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -15,19 +15,11 @@ return { }, }, }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "markdown", "markdown_inline" }) - end - end, - }, { "williamboman/mason.nvim", opts = function(_, opts) opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "markdownlint", "marksman" }) + vim.list_extend(opts.ensure_installed, { "markdownlint" }) end, }, { diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index b727b468..8e4f942d 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -26,7 +26,7 @@ return { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "ninja", "python", "rst", "toml" }) + vim.list_extend(opts.ensure_installed, { "ninja", "rst" }) end end, }, diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index eee57149..b8279e8a 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -61,7 +61,7 @@ return { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "markdown", "markdown_inline", "r", "rnoweb" }) + vim.list_extend(opts.ensure_installed, { "r", "rnoweb" }) end end, }, diff --git a/lua/lazyvim/plugins/extras/lang/ruby.lua b/lua/lazyvim/plugins/extras/lang/ruby.lua index 40ff8005..c9686432 100644 --- a/lua/lazyvim/plugins/extras/lang/ruby.lua +++ b/lua/lazyvim/plugins/extras/lang/ruby.lua @@ -13,14 +13,6 @@ return { }) end, }, - { - "williamboman/mason.nvim", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { - "solargraph", - }) - end, - }, { "neovim/nvim-lspconfig", opts = { diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 5a3c59d7..e53e881e 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -32,7 +32,7 @@ return { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "ron", "rust", "toml" }) + vim.list_extend(opts.ensure_installed, { "ron", "rust" }) end, }, diff --git a/lua/lazyvim/plugins/extras/lang/tex.lua b/lua/lazyvim/plugins/extras/lang/tex.lua index 5d667b40..0b7796b5 100644 --- a/lua/lazyvim/plugins/extras/lang/tex.lua +++ b/lua/lazyvim/plugins/extras/lang/tex.lua @@ -19,6 +19,7 @@ return { { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) + opts.highlight = opts.highlight or {} if type(opts.ensure_installed) == "table" then vim.list_extend(opts.ensure_installed, { "bibtex" }) end diff --git a/lua/lazyvim/plugins/extras/lang/toml.lua b/lua/lazyvim/plugins/extras/lang/toml.lua index 9dcc029d..7b34bce0 100644 --- a/lua/lazyvim/plugins/extras/lang/toml.lua +++ b/lua/lazyvim/plugins/extras/lang/toml.lua @@ -5,27 +5,10 @@ return { root = "*.toml", }) end, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "toml" }) - end - end, - }, - { - "williamboman/mason.nvim", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "taplo" }) - end, - }, - { - "neovim/nvim-lspconfig", - opts = { - servers = { - taplo = {}, - }, + "neovim/nvim-lspconfig", + opts = { + servers = { + taplo = {}, }, }, } diff --git a/lua/lazyvim/plugins/extras/lang/yaml.lua b/lua/lazyvim/plugins/extras/lang/yaml.lua index 0aa23a2b..b34e2a26 100644 --- a/lua/lazyvim/plugins/extras/lang/yaml.lua +++ b/lua/lazyvim/plugins/extras/lang/yaml.lua @@ -5,16 +5,6 @@ return { }) end, - -- add yaml specific modules to treesitter - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { "yaml" }) - end - end, - }, - -- yaml schema support { "b0o/SchemaStore.nvim", diff --git a/tests/extras/lang_spec.lua b/tests/extras/lang_spec.lua index 7a58be5c..faa43250 100644 --- a/tests/extras/lang_spec.lua +++ b/tests/extras/lang_spec.lua @@ -19,7 +19,8 @@ describe("Extra", function() return name:match("%.lua$") end, { limit = math.huge, type = "file", path = "lua/lazyvim/plugins/extras" }) ) - local servers = require("mason-lspconfig.mappings.server").package_to_lspconfig + local lsp_to_pkg = require("mason-lspconfig.mappings.server").lspconfig_to_package + local pkg_to_lsp = require("mason-lspconfig.mappings.server").package_to_lspconfig local tsspec = Plugin.Spec.new({ import = "lazyvim.plugins.treesitter", @@ -43,16 +44,27 @@ describe("Extra", function() if extra.modname:find("%.lang%.") then assert(mod.recommended, "`recommended` not set for " .. extra.modname) - local mason = spec.plugins["mason.nvim"] - local opts = Plugin.values(mason, "opts", false) - for _, v in ipairs(opts.ensure_installed) do - assert( - not servers[v], - "LSP server " .. v .. " is installed automatically. Please remove from the mason.nvim spec" - ) + local lspconfig = spec.plugins["nvim-lspconfig"] + + if lspconfig then + local lspconfig_opts = Plugin.values(lspconfig, "opts", false) + local mason = spec.plugins["mason.nvim"] + local mason_opts = Plugin.values(mason, "opts", false) + + for lsp in pairs(lspconfig_opts.servers or {}) do + local lsp_pkg = pkg_to_lsp[lsp] + assert( + not (lsp_pkg and vim.tbl_contains(mason_opts.ensure_installed, lsp_pkg)), + "LSP server " + .. lsp + .. " with pkg " + .. (lsp_pkg or "foo") + .. " is installed automatically. Please remove from the mason.nvim spec" + ) + end end local ts = spec.plugins["nvim-treesitter"] - opts = Plugin.values(mason, "opts", false) + local opts = Plugin.values(ts, "opts", false) for _, v in ipairs(opts.ensure_installed) do assert( not vim.tbl_contains(tsensure, v), From 73c767c2f3e43cf7edd2964f951b7e574ee5b283 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 18:15:45 +0200 Subject: [PATCH 26/30] fix(util): don't print warning message in headless --- lua/lazyvim/util/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index e6927069..9b13b50d 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -245,7 +245,7 @@ function M.get_pkg_path(pkg, path, opts) opts.warn = opts.warn == nil and true or opts.warn path = path or "" local ret = root .. "/packages/" .. pkg .. "/" .. path - if opts.warn and not vim.loop.fs_stat(ret) then + if opts.warn and not vim.loop.fs_stat(ret) and not require("lazy.core.config").headless() then M.warn( ("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path) ) From 1d42e45fd244715b44c6a0416d280b53e33f154a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 18:24:52 +0200 Subject: [PATCH 27/30] ci: remove commit linter in favor of PR title linter --- .github/workflows/ci.yml | 6 ------ .github/workflows/pr.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93f48b12..fddf82ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,12 +4,6 @@ on: pull_request: jobs: - commit_msg: - name: Conventional Commit Messages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: webiny/action-conventional-commits@v1.3.0 stylua: name: Stylua Formatting runs-on: ubuntu-latest diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..0401a4d8 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,41 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +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 From 4cc586a3f16e3dd54ef66e74e952ba16cc45d5dc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 5 Jun 2024 19:53:50 +0200 Subject: [PATCH 28/30] tests: refactored tests a bit --- tests/extras/lang_spec.lua | 68 +++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/tests/extras/lang_spec.lua b/tests/extras/lang_spec.lua index faa43250..86cd0823 100644 --- a/tests/extras/lang_spec.lua +++ b/tests/extras/lang_spec.lua @@ -5,7 +5,6 @@ _G.LazyVim = require("lazyvim.util") describe("Extra", function() local Config = require("lazy.core.config") - local Loader = require("lazy.core.loader") assert(vim.tbl_count(Config.plugins) > 0, "Lazy not properly setup") ---@type {modname:string, modpath:string}[] @@ -19,8 +18,13 @@ describe("Extra", function() return name:match("%.lua$") end, { limit = math.huge, type = "file", path = "lua/lazyvim/plugins/extras" }) ) + + local ignore = { "lazyvim.plugins.extras.ui.treesitter-rewrite" } + extras = vim.tbl_filter(function(extra) + return not vim.tbl_contains(ignore, extra.modname) + end, extras) + local lsp_to_pkg = require("mason-lspconfig.mappings.server").lspconfig_to_package - local pkg_to_lsp = require("mason-lspconfig.mappings.server").package_to_lspconfig local tsspec = Plugin.Spec.new({ import = "lazyvim.plugins.treesitter", @@ -32,27 +36,37 @@ describe("Extra", function() assert(type(tsensure) == "table", "No ensure_installed in nvim-treesitter spec") for _, extra in ipairs(extras) do - it(extra.modname .. " is valid", function() - local mod = require(extra.modname) - local spec = Plugin.Spec.new({ - { "williamboman/mason.nvim", opts = { ensure_installed = {} } }, - { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } }, - mod, - }, { optional = true }) - assert.is_not_nil(mod) - assert(#spec.notifs == 0, "Invalid spec: " .. vim.inspect(spec.notifs)) + local name = extra.modname:sub(#"lazyvim.plugins.extras" + 2) + describe(name, function() + ---@type any, LazySpecLoader + local mod, spec + + it("spec is valid", function() + mod = require(extra.modname) + assert.is_not_nil(mod) + spec = Plugin.Spec.new({ + { "williamboman/mason.nvim", opts = { ensure_installed = {} } }, + { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } }, + mod, + }, { optional = true }) + assert(#spec.notifs == 0, "Invalid spec: " .. vim.inspect(spec.notifs)) + end) if extra.modname:find("%.lang%.") then - assert(mod.recommended, "`recommended` not set for " .. extra.modname) - local lspconfig = spec.plugins["nvim-lspconfig"] + it("has recommended set", function() + assert(mod.recommended, "`recommended` not set for " .. extra.modname) + end) + end - if lspconfig then + local lspconfig = spec.plugins["nvim-lspconfig"] + if lspconfig then + it("does not install LSP servers with mason.nvim", function() local lspconfig_opts = Plugin.values(lspconfig, "opts", false) local mason = spec.plugins["mason.nvim"] local mason_opts = Plugin.values(mason, "opts", false) for lsp in pairs(lspconfig_opts.servers or {}) do - local lsp_pkg = pkg_to_lsp[lsp] + local lsp_pkg = lsp_to_pkg[lsp] assert( not (lsp_pkg and vim.tbl_contains(mason_opts.ensure_installed, lsp_pkg)), "LSP server " @@ -62,15 +76,23 @@ describe("Extra", function() .. " is installed automatically. Please remove from the mason.nvim spec" ) end - end - local ts = spec.plugins["nvim-treesitter"] - local opts = Plugin.values(ts, "opts", false) - for _, v in ipairs(opts.ensure_installed) do - assert( - not vim.tbl_contains(tsensure, v), - "TS lang " .. v .. " is already a default. Please remove from the mason.nvim spec" + end) + end + + local ts = spec.plugins["nvim-treesitter"] + local opts = Plugin.values(ts, "opts", false) + + if not vim.tbl_isempty(opts.ensure_installed) then + it("does not install defaut Treesitter langs", function() + local invalid = vim.tbl_filter(function(v) + return vim.tbl_contains(tsensure, v) + end, opts.ensure_installed or {}) + assert.same( + {}, + invalid, + "These Treesitter langs are installed by default. Please remove them from the extra." ) - end + end) end end) end From 61689ad54326f205d3f681b44b33ee7d800f40cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:58:44 +0200 Subject: [PATCH 29/30] chore(main): release 12.5.0 (#3444) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e2899c6..0ee7de6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## [12.5.0](https://github.com/LazyVim/LazyVim/compare/v12.4.0...v12.5.0) (2024-06-05) + + +### Features + +* **bufferline:** add keymaps for BufferLineMovePrev / BufferLineMoveNext ([#1935](https://github.com/LazyVim/LazyVim/issues/1935)) ([1806ea7](https://github.com/LazyVim/LazyVim/commit/1806ea710fe391d5b00c1916ed9331bf58cfdb49)) +* **editor:** added extra for inc-rename.nvim ([#3432](https://github.com/LazyVim/LazyVim/issues/3432)) ([c50018b](https://github.com/LazyVim/LazyVim/commit/c50018b791a6295fb0f3219fe637209a381db4c4)) +* enabled `ts-plugin` support for `astro` and `svelte` ([d64d761](https://github.com/LazyVim/LazyVim/commit/d64d7615392d70c2ca1957f66725856d0a306b87)) +* **extras:** Add extra for angular lspconfig ([#2806](https://github.com/LazyVim/LazyVim/issues/2806)) ([987bd22](https://github.com/LazyVim/LazyVim/commit/987bd2207f7f2f7f72f65b0e7e811ec04c03aa32)) +* **keymaps:** add keymap to close all tab pages except the current one ([#2975](https://github.com/LazyVim/LazyVim/issues/2975)) ([de9e337](https://github.com/LazyVim/LazyVim/commit/de9e337f0dcd27a7621f6ab741ad3a5d769dbd7c)) +* **lazydev:** use lazydev with neodev types (not the plugin) on Neovim 0.9.x ([1677b3b](https://github.com/LazyVim/LazyVim/commit/1677b3b84f53d410d50c5a2aca32ca7c5e900917)) +* **python:** switch to regexp branch for a rewrite the venv selector plugin ([#3301](https://github.com/LazyVim/LazyVim/issues/3301)) ([1cdb5bd](https://github.com/LazyVim/LazyVim/commit/1cdb5bdf412933bb1be44a3ae5905202124718d9)) +* **statuscol:** statuscolumn options for open fold indicator and fold hl ([#2923](https://github.com/LazyVim/LazyVim/issues/2923)) ([fa706b3](https://github.com/LazyVim/LazyVim/commit/fa706b320b4c94da28136bdbab2ee1841974707c)) + + +### Bug Fixes + +* cleanup unnecessary treesitter langs and mason lsp servers ([f8268fa](https://github.com/LazyVim/LazyVim/commit/f8268faa7c705cca7047fbaef5984905b47a7324)) +* **extra.lang.scala:** Fix the always initializing regardless of file… ([#3455](https://github.com/LazyVim/LazyVim/issues/3455)) ([c1f5fcf](https://github.com/LazyVim/LazyVim/commit/c1f5fcf9c7ed2659c9d5ac41b3bb8a93e0a3c6a0)) +* **extras:** added recommended for helm/haskell ([ca0b9ee](https://github.com/LazyVim/LazyVim/commit/ca0b9ee915c7e5ddc4ca828688c2cb87f4f0c438)) +* **keymaps:** use root dir for git log ([662e2ff](https://github.com/LazyVim/LazyVim/commit/662e2ffe0ff8f43e15cf97029a5e1ec84bb1e376)) +* **lazydev:** add cmd ([ae0d94e](https://github.com/LazyVim/LazyVim/commit/ae0d94e048423903743b657be3a827d9685761c3)) +* **lsp:** Enable using `deno.enablePaths` in denols settings ([#3446](https://github.com/LazyVim/LazyVim/issues/3446)) ([9a635ef](https://github.com/LazyVim/LazyVim/commit/9a635ef8d690a3cfcf6d3bf54e8ad61156b9d150)) +* **python:** removed the `python-semshi` extra ([e32d191](https://github.com/LazyVim/LazyVim/commit/e32d1918ae676dbab3f5f121a9fa623cb4ee20bd)) +* **tex:** remove latex treesitter support since it's not needed with vimtex and it needs treesitter-cli ([3df8af3](https://github.com/LazyVim/LazyVim/commit/3df8af369c49e13763a7c8962a005aef7604d018)) +* **toggle:** Restore width/height values when closing while maximized is toggled on ([#3453](https://github.com/LazyVim/LazyVim/issues/3453)) ([8971ea2](https://github.com/LazyVim/LazyVim/commit/8971ea25f953f778c8db999da4de240a07713aaa)) +* **toggle:** slightly better maximize ([452b70a](https://github.com/LazyVim/LazyVim/commit/452b70ad15714593a91bed90448313228dd5135a)) +* **toggle:** un-maximize when quiting Neovim ([1c58365](https://github.com/LazyVim/LazyVim/commit/1c583650e66b6f468e8ece4292bfe8bd3f7e1c94)) +* **util:** don't print warning message in headless ([73c767c](https://github.com/LazyVim/LazyVim/commit/73c767c2f3e43cf7edd2964f951b7e574ee5b283)) + ## [12.4.0](https://github.com/LazyVim/LazyVim/compare/v12.3.0...v12.4.0) (2024-06-04) From e0a0123b1869cbb910f28582d345ca0e6287eb55 Mon Sep 17 00:00:00 2001 From: Daniel Mata <100956688+matadaniel@users.noreply.github.com> Date: Wed, 5 Jun 2024 13:28:23 -0500 Subject: [PATCH 30/30] fix(svelte): added organize imports and prettier (#3466) * feat(svelte): add key binding for organize imports * fix(svelte): solves sveltejs/language-tools#2008 * feat(svelte): add formatter for svelte --- lua/lazyvim/plugins/extras/lang/svelte.lua | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/svelte.lua b/lua/lazyvim/plugins/extras/lang/svelte.lua index 4319b509..cf824dda 100644 --- a/lua/lazyvim/plugins/extras/lang/svelte.lua +++ b/lua/lazyvim/plugins/extras/lang/svelte.lua @@ -27,7 +27,28 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - svelte = {}, + svelte = { + keys = { + { + "co", + function() + vim.lsp.buf.code_action({ + apply = true, + context = { + only = { "source.organizeImports" }, + diagnostics = {}, + }, + }) + end, + desc = "Organize Imports", + }, + }, + capabilities = { + workspace = { + didChangeWatchedFiles = vim.fn.has("nvim-0.10") == 0 and { dynamicRegistration = true }, + }, + }, + }, }, }, }, @@ -45,4 +66,14 @@ return { }) end, }, + + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + ["svelte"] = { "prettier" }, + }, + }, + }, }