From 86237bfd2d6272ce5e61f5064a43f2eb098be5a0 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Mon, 17 Jul 2023 23:31:21 +0200 Subject: [PATCH 01/20] feat: add transparency support for tokyonight docs: update release notes --- docs/release-notes/rl-0.5.adoc | 11 +++++++++++ modules/theme/supported_themes.nix | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 docs/release-notes/rl-0.5.adoc diff --git a/docs/release-notes/rl-0.5.adoc b/docs/release-notes/rl-0.5.adoc new file mode 100644 index 0000000..403e9a5 --- /dev/null +++ b/docs/release-notes/rl-0.5.adoc @@ -0,0 +1,11 @@ +[[sec-release-0.5]] +== Release 0.5 + + +[[sec-release-0.5-changelog]] +=== Changelog + + +https://github.com/horriblename[horriblename]: + +* Add transparency support for tokyonight theme diff --git a/modules/theme/supported_themes.nix b/modules/theme/supported_themes.nix index 7338edb..f4e2477 100644 --- a/modules/theme/supported_themes.nix +++ b/modules/theme/supported_themes.nix @@ -18,6 +18,9 @@ style ? "night", transparent, }: '' + require('tokyonight').setup { + transparent = ${lib.boolToString transparent}; + } vim.cmd[[colorscheme tokyonight-${style}]] ''; styles = ["day" "night" "storm" "moon"]; From f3f7082597eeffdc9a354380b5e4498d1e7d8925 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Thu, 20 Jul 2023 02:59:30 +0200 Subject: [PATCH 02/20] fix cmp abort keymap --- modules/completion/nvim-cmp/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/nvim-cmp/config.nix b/modules/completion/nvim-cmp/config.nix index 72c9a1a..f9cb24c 100644 --- a/modules/completion/nvim-cmp/config.nix +++ b/modules/completion/nvim-cmp/config.nix @@ -106,7 +106,7 @@ in { end '') (mkSetLuaBinding mappings.close '' - require('cmp').mapping.abort + require('cmp').mapping.abort() '') (mkSetLuaBinding mappings.scrollDocsUp '' function() From 507d824731cdd9540d4519b5b5102ac27f491055 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Thu, 20 Jul 2023 14:02:37 +0200 Subject: [PATCH 03/20] fix cmp scroll docs keybinds --- modules/completion/nvim-cmp/config.nix | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/modules/completion/nvim-cmp/config.nix b/modules/completion/nvim-cmp/config.nix index f9cb24c..e49fdb9 100644 --- a/modules/completion/nvim-cmp/config.nix +++ b/modules/completion/nvim-cmp/config.nix @@ -109,14 +109,10 @@ in { require('cmp').mapping.abort() '') (mkSetLuaBinding mappings.scrollDocsUp '' - function() - require('cmp').mapping.scroll_docs(-4) - end + require('cmp').mapping.scroll_docs(-4) '') (mkSetLuaBinding mappings.scrollDocsDown '' - function() - require('cmp').mapping.scroll_docs(4) - end + require('cmp').mapping.scroll_docs(4) '') ]; @@ -125,17 +121,13 @@ in { require('cmp').complete '') (mkSetLuaBinding mappings.close '' - require('cmp').mapping.close + require('cmp').mapping.close() '') (mkSetLuaBinding mappings.scrollDocsUp '' - function() - require('cmp').mapping.scroll_docs(-4) - end + require('cmp').mapping.scroll_docs(-4) '') (mkSetLuaBinding mappings.scrollDocsDown '' - function() - require('cmp').mapping.scroll_docs(4) - end + require('cmp').mapping.scroll_docs(4) '') ]; From 8c59ce32cf46b1e0f37d932e5cc55a07f96bc5df Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Thu, 20 Jul 2023 13:36:01 +0200 Subject: [PATCH 04/20] update release notes --- docs/release-notes/rl-0.5.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/rl-0.5.adoc b/docs/release-notes/rl-0.5.adoc index 403e9a5..0252074 100644 --- a/docs/release-notes/rl-0.5.adoc +++ b/docs/release-notes/rl-0.5.adoc @@ -8,4 +8,6 @@ https://github.com/horriblename[horriblename]: -* Add transparency support for tokyonight theme +* Add transparency support for tokyonight theme. + +* Fix bug where cmp's close and scrollDocs mappings wasn't working. From f8a46d68a7913e568b873c80dc2748c6f3584a95 Mon Sep 17 00:00:00 2001 From: AmanSe Date: Thu, 20 Jul 2023 22:19:27 +0530 Subject: [PATCH 05/20] feat: add daily note options for obsidian --- modules/notes/obsidian/config.nix | 12 ++++++++++++ modules/notes/obsidian/obsidian.nix | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/modules/notes/obsidian/config.nix b/modules/notes/obsidian/config.nix index 1107c35..8f9c2d1 100644 --- a/modules/notes/obsidian/config.nix +++ b/modules/notes/obsidian/config.nix @@ -23,6 +23,18 @@ in { if (auto.type == "nvim-cmp") then "true" else "false" + } + }, + daily_notes = { + folder = ${ + if (cfg.daily-notes.folder == "") + then "nil," + else "'${cfg.daily-notes.folder}'," + } + date_format = ${ + if (cfg.daily-notes.date-format == "") + then "nil," + else "'${cfg.daily-notes.date-format}'," } } }) diff --git a/modules/notes/obsidian/obsidian.nix b/modules/notes/obsidian/obsidian.nix index 674c66b..60ee71f 100644 --- a/modules/notes/obsidian/obsidian.nix +++ b/modules/notes/obsidian/obsidian.nix @@ -14,6 +14,19 @@ with builtins; { description = "Obsidian vault directory"; }; + daily-notes = { + folder = mkOption { + type = types.str; + default = ""; + description = "Directory in which daily notes should be created"; + }; + date-format = mkOption { + type = types.str; + default = ""; + description = "Date format used for creating daily notes"; + }; + }; + completion = { nvim_cmp = mkOption { # if using nvim-cmp, otherwise set to false From 38fcf69882711dc988924a12f41a851216689bd4 Mon Sep 17 00:00:00 2001 From: AmanSe Date: Thu, 20 Jul 2023 22:54:29 +0530 Subject: [PATCH 06/20] update obsidian plugin release notes --- docs/release-notes/rl-0.5.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/release-notes/rl-0.5.adoc b/docs/release-notes/rl-0.5.adoc index 0252074..967ce02 100644 --- a/docs/release-notes/rl-0.5.adoc +++ b/docs/release-notes/rl-0.5.adoc @@ -11,3 +11,7 @@ https://github.com/horriblename[horriblename]: * Add transparency support for tokyonight theme. * Fix bug where cmp's close and scrollDocs mappings wasn't working. + +https://github.com/amanse[amanse]: + +* Add daily notes options for obsidian plugin From f25098e3ce02275a704abd80439c5f00795ba1b6 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:05:08 -0400 Subject: [PATCH 07/20] fix: update bufferline from v3.0.1 branch to main --- flake.lock | 7 +++---- flake.nix | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 69727ee..cbd1ec7 100644 --- a/flake.lock +++ b/flake.lock @@ -919,16 +919,15 @@ "nvim-bufferline-lua": { "flake": false, "locked": { - "lastModified": 1666171880, - "narHash": "sha256-hueIGT7KOhca0kP0M1nUYzBrzMz+DpuZSOt5iyuEa40=", + "lastModified": 1689661992, + "narHash": "sha256-0BJXUDGeUhPALEnPgO4ix+GgI/3P/Foiqi0tf2mgUXg=", "owner": "akinsho", "repo": "nvim-bufferline.lua", - "rev": "e70be6232f632d16d2412b1faf85554285036278", + "rev": "d24378edc14a675c820a303b4512af3bbc5761e9", "type": "github" }, "original": { "owner": "akinsho", - "ref": "v3.0.1", "repo": "nvim-bufferline.lua", "type": "github" } diff --git a/flake.nix b/flake.nix index 67d3825..44af3f5 100644 --- a/flake.nix +++ b/flake.nix @@ -181,7 +181,7 @@ # Tablines nvim-bufferline-lua = { - url = "github:akinsho/nvim-bufferline.lua?ref=v3.0.1"; + url = "github:akinsho/nvim-bufferline.lua"; flake = false; }; From 48219eba744d4bb6361b3115737fa9e1327e3e25 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:18:19 +0300 Subject: [PATCH 08/20] docs: wording --- .github/CONTRIBUTING.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 19f0287..10371c9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -30,22 +30,21 @@ Here are the overall boundaries I would like you to follow while contributing to #### Documentation -If you are making a pull request to add a - +If you are making a pull request to add a #### Style **Nix** -We use Alejandra for formatting nix code, which can be invoked directly with `nix fmt` in the repository. +We use Alejandra for formatting nix code, which can be invoked directly by running `nix fmt` in the repository. While Alejandra is mostly opinionated on how code looks after formatting, certain formattings are done at the user's discretion. Please use one line code for attribute sets that contain only one subset. For example: -```nix +```nix # parent modules should always be unfolded -module = { +module = { value = mkEnableOption "some description" // { default = true; }; # same as parent modules, unfold submodules subModule = { @@ -65,15 +64,16 @@ If you move a line down after the merge operator, Alejandra will automatically u module = { key = mkEnableOption "some description" // { default = true; # we want this to be inline - }; + }; # ... } ``` For lists, it's up mostly to your discretion but please try to avoid unfolded lists if there is only one item in the list. + ```nix -# ok +# ok acceptableList = [ item1 item2 @@ -85,10 +85,11 @@ acceptableList = [ listToBeAvoided = [item1 item2 item3 item4]; ``` -*This will be moved elsewhere, disregard unless you are adding a new plugin with keybinds* +_This will be moved elsewhere, disregard unless you are adding a new plugin with keybinds_ + #### Keybinds -##### Custom key mappings support for a plugin +##### Custom key mappings support for a plugin To add custom keymappings to a plugin, a couple of helper functions are available in the project. @@ -237,5 +238,3 @@ in { ``` If you have come across a plugin that has an API that doesn't seem to easily allow custom keybindings, don't be scared to implement a draft PR. We'll help you get it done. - - From e719eb11760debeba813bdf78bf210c83e47fe2b Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:18:49 +0300 Subject: [PATCH 09/20] docs: fix typo in issue search URL --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 14e8cbe..c9270b2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -7,7 +7,7 @@ body: id: no-duplicate-issues attributes: label: "⚠️ Please verify that this bug has NOT been reported before." - description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake4/issues?q=)" + description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake/issues?q=)" options: - label: "I checked all existing issues and didn't find a similar issue" required: true From aaf57d02e75091f9d6ccb951fdc07831171f8e2a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:19:08 +0300 Subject: [PATCH 10/20] docs: cleanup --- .../pull_request_template.md | 5 +- docs/home-manager.adoc | 77 ------------------- 2 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 docs/home-manager.adoc diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index c50c5aa..ca65c8b 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -18,11 +18,10 @@ Please delete any options that are not relevant. ## Checklist -Please try to check at least a majority of the checklist before opening your pull request. PRs -Exceptions to this will be reviewed on a case by case basis. +Please try to check at least a majority of the checklist before opening your pull request. Exceptions to this will be reviewed on a case by case basis. - [ ] My code follows the style and contributing guidelines of this project. -- [ ] I ran Alejandra to format my code. +- [ ] I ran Alejandra to format my code (`nix fmt`). - [ ] I have performed a self-review of my own code and tested it. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] My changes generate no new warnings. diff --git a/docs/home-manager.adoc b/docs/home-manager.adoc deleted file mode 100644 index f238092..0000000 --- a/docs/home-manager.adoc +++ /dev/null @@ -1,77 +0,0 @@ -[[ch-hm-module]] -== Home Manager - -The Home Manager module allows us to customize the different `vim` options. To use it, we first add the input flake. - -[source,nix] ----- -{ - neovim-flake = { - url = github:notashelf/neovim-flake; - # you can override input nixpkgs - inputs.nixpkgs.follows = "nixpkgs"; - }; -} ----- - -Followed by importing the HM module. - -[source,nix] ----- -{ - imports = [ neovim-flake.homeManagerModules.default ]; -} ----- - -Then we should be able to use the given module. E.g. - -[source,nix] ----- -{ - programs.neovim-flake = { - - enable = true; - # your settings need to go into the settings attrset - settings = { - vim.viAlias = false; - vim.vimAlias = true; - vim.lsp = { - enable = true; - }; - }; - }; -} ----- - -=== Custom vim plugins - -It's possible to add custom vim plugins by using the startPlugins and lua DAG settings. First we install the plugin by adding it to startPlugins. This example uses nvim-surround, but the process will be similar for other plugins as well. - -[source,nix] ----- -{ - programs.neovim-flake = { - enable = true; - settings = { - vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ]; - }; - }; -} ----- - -Then we continue by requiring the plugin in lua using DAG settings. Please note that you're able to name this setting to however you want, the name will add a `--SECTION ` in the init.vim, under which it will be initialized. - -[source,nix] ----- -{ - programs.neovim-flake = { - enable = true; - settings = { - vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ]; - luaConfigRC.nvim-surround = nvim-flake.lib.nvim.dag.entryAnywhere '' # nvim-flake is a reference to the flake. Please change this accordingly to your config. - require("nvim-surround").setup() - ''; - }; - }; -} ----- \ No newline at end of file From 19f7c6732fb04e38250fefd4ed4ab13cd201c02a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:19:27 +0300 Subject: [PATCH 11/20] CI: clean up workflows --- .github/workflows/cachix.yml | 14 +++++++------- .github/workflows/check.yml | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 536061a..ee1327d 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -11,15 +11,15 @@ on: - .gitignore jobs: - cahix: - runs-on: ubuntu-latest + cachix: + wruns-on: ubuntu-latest strategy: matrix: package: - - default - - nix - - tidal - - maximal + - default + - nix + - tidal + - maximal steps: - uses: easimon/maximize-build-space@v6 with: @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v20 with: - extra_nix_config: | + extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} auto-optimise-store = true experimental-features = nix-command flakes diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 91bbb8f..c6d46d6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -20,10 +20,11 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - run: nix flake check + format-with-alejandra: name: Formatting via Alejandra runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v20 with: @@ -32,4 +33,3 @@ jobs: auto-optimise-store = true experimental-features = nix-command flakes - run: nix run nixpkgs#alejandra -- -c . - From 5d5aec5b8a48327f528ee791b3c646ab2f40345f Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:21:54 +0300 Subject: [PATCH 12/20] docs: add @FrothyMarrow to credits --- .github/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/README.md b/.github/README.md index 0020b1b..e7dcdb3 100644 --- a/.github/README.md +++ b/.github/README.md @@ -52,7 +52,7 @@

-[Get Started]: #try-it-out +[Get Started]: #get-started [Documentation]: #documentation [Help]: #help [Contribute]: #contributing @@ -144,8 +144,8 @@ Special thanks to - [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work - [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible - [@horriblename](https://github.com/horriblename) - For actively implementing planned features and quality of life updates -- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work - [@Yavko](https://github.com/Yavko) - For the amazing neovim-flake logo +- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I could not and everyone who has submitted issues or pull requests! From df310b3e252948355f7ea0feb48eb2aee0e9b29a Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Sat, 22 Jul 2023 16:05:08 -0400 Subject: [PATCH 13/20] fix: update bufferline from v3.0.1 branch to main --- flake.lock | 7 +++---- flake.nix | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 69727ee..cbd1ec7 100644 --- a/flake.lock +++ b/flake.lock @@ -919,16 +919,15 @@ "nvim-bufferline-lua": { "flake": false, "locked": { - "lastModified": 1666171880, - "narHash": "sha256-hueIGT7KOhca0kP0M1nUYzBrzMz+DpuZSOt5iyuEa40=", + "lastModified": 1689661992, + "narHash": "sha256-0BJXUDGeUhPALEnPgO4ix+GgI/3P/Foiqi0tf2mgUXg=", "owner": "akinsho", "repo": "nvim-bufferline.lua", - "rev": "e70be6232f632d16d2412b1faf85554285036278", + "rev": "d24378edc14a675c820a303b4512af3bbc5761e9", "type": "github" }, "original": { "owner": "akinsho", - "ref": "v3.0.1", "repo": "nvim-bufferline.lua", "type": "github" } diff --git a/flake.nix b/flake.nix index 67d3825..44af3f5 100644 --- a/flake.nix +++ b/flake.nix @@ -181,7 +181,7 @@ # Tablines nvim-bufferline-lua = { - url = "github:akinsho/nvim-bufferline.lua?ref=v3.0.1"; + url = "github:akinsho/nvim-bufferline.lua"; flake = false; }; From 16340dc8b7fd77c247f434e438557a1fe50a2297 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:18:19 +0300 Subject: [PATCH 14/20] docs: wording --- .github/CONTRIBUTING.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 19f0287..10371c9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -30,22 +30,21 @@ Here are the overall boundaries I would like you to follow while contributing to #### Documentation -If you are making a pull request to add a - +If you are making a pull request to add a #### Style **Nix** -We use Alejandra for formatting nix code, which can be invoked directly with `nix fmt` in the repository. +We use Alejandra for formatting nix code, which can be invoked directly by running `nix fmt` in the repository. While Alejandra is mostly opinionated on how code looks after formatting, certain formattings are done at the user's discretion. Please use one line code for attribute sets that contain only one subset. For example: -```nix +```nix # parent modules should always be unfolded -module = { +module = { value = mkEnableOption "some description" // { default = true; }; # same as parent modules, unfold submodules subModule = { @@ -65,15 +64,16 @@ If you move a line down after the merge operator, Alejandra will automatically u module = { key = mkEnableOption "some description" // { default = true; # we want this to be inline - }; + }; # ... } ``` For lists, it's up mostly to your discretion but please try to avoid unfolded lists if there is only one item in the list. + ```nix -# ok +# ok acceptableList = [ item1 item2 @@ -85,10 +85,11 @@ acceptableList = [ listToBeAvoided = [item1 item2 item3 item4]; ``` -*This will be moved elsewhere, disregard unless you are adding a new plugin with keybinds* +_This will be moved elsewhere, disregard unless you are adding a new plugin with keybinds_ + #### Keybinds -##### Custom key mappings support for a plugin +##### Custom key mappings support for a plugin To add custom keymappings to a plugin, a couple of helper functions are available in the project. @@ -237,5 +238,3 @@ in { ``` If you have come across a plugin that has an API that doesn't seem to easily allow custom keybindings, don't be scared to implement a draft PR. We'll help you get it done. - - From b52d0a802a28f2800eddaf454eb02d47738226f8 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:18:49 +0300 Subject: [PATCH 15/20] docs: fix typo in issue search URL --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 14e8cbe..c9270b2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -7,7 +7,7 @@ body: id: no-duplicate-issues attributes: label: "⚠️ Please verify that this bug has NOT been reported before." - description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake4/issues?q=)" + description: "Search in the issues sections by clicking [HERE](https://github.com/notashelf/neovim-flake/issues?q=)" options: - label: "I checked all existing issues and didn't find a similar issue" required: true From caef26936a7f612d53ea8f5c39611026730c4e4a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:19:08 +0300 Subject: [PATCH 16/20] docs: cleanup --- .../pull_request_template.md | 5 +- docs/home-manager.adoc | 77 ------------------- 2 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 docs/home-manager.adoc diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md index c50c5aa..ca65c8b 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -18,11 +18,10 @@ Please delete any options that are not relevant. ## Checklist -Please try to check at least a majority of the checklist before opening your pull request. PRs -Exceptions to this will be reviewed on a case by case basis. +Please try to check at least a majority of the checklist before opening your pull request. Exceptions to this will be reviewed on a case by case basis. - [ ] My code follows the style and contributing guidelines of this project. -- [ ] I ran Alejandra to format my code. +- [ ] I ran Alejandra to format my code (`nix fmt`). - [ ] I have performed a self-review of my own code and tested it. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] My changes generate no new warnings. diff --git a/docs/home-manager.adoc b/docs/home-manager.adoc deleted file mode 100644 index f238092..0000000 --- a/docs/home-manager.adoc +++ /dev/null @@ -1,77 +0,0 @@ -[[ch-hm-module]] -== Home Manager - -The Home Manager module allows us to customize the different `vim` options. To use it, we first add the input flake. - -[source,nix] ----- -{ - neovim-flake = { - url = github:notashelf/neovim-flake; - # you can override input nixpkgs - inputs.nixpkgs.follows = "nixpkgs"; - }; -} ----- - -Followed by importing the HM module. - -[source,nix] ----- -{ - imports = [ neovim-flake.homeManagerModules.default ]; -} ----- - -Then we should be able to use the given module. E.g. - -[source,nix] ----- -{ - programs.neovim-flake = { - - enable = true; - # your settings need to go into the settings attrset - settings = { - vim.viAlias = false; - vim.vimAlias = true; - vim.lsp = { - enable = true; - }; - }; - }; -} ----- - -=== Custom vim plugins - -It's possible to add custom vim plugins by using the startPlugins and lua DAG settings. First we install the plugin by adding it to startPlugins. This example uses nvim-surround, but the process will be similar for other plugins as well. - -[source,nix] ----- -{ - programs.neovim-flake = { - enable = true; - settings = { - vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ]; - }; - }; -} ----- - -Then we continue by requiring the plugin in lua using DAG settings. Please note that you're able to name this setting to however you want, the name will add a `--SECTION ` in the init.vim, under which it will be initialized. - -[source,nix] ----- -{ - programs.neovim-flake = { - enable = true; - settings = { - vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ]; - luaConfigRC.nvim-surround = nvim-flake.lib.nvim.dag.entryAnywhere '' # nvim-flake is a reference to the flake. Please change this accordingly to your config. - require("nvim-surround").setup() - ''; - }; - }; -} ----- \ No newline at end of file From e9e6ed82b0c0729afeddfa1e8769801f83ab72b4 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:19:27 +0300 Subject: [PATCH 17/20] CI: clean up workflows --- .github/workflows/cachix.yml | 12 ++++++------ .github/workflows/check.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 536061a..c6be3e8 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -11,15 +11,15 @@ on: - .gitignore jobs: - cahix: + cachix: runs-on: ubuntu-latest strategy: matrix: package: - - default - - nix - - tidal - - maximal + - default + - nix + - tidal + - maximal steps: - uses: easimon/maximize-build-space@v6 with: @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v20 with: - extra_nix_config: | + extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} auto-optimise-store = true experimental-features = nix-command flakes diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 91bbb8f..c6d46d6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -20,10 +20,11 @@ jobs: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - run: nix flake check + format-with-alejandra: name: Formatting via Alejandra runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v20 with: @@ -32,4 +33,3 @@ jobs: auto-optimise-store = true experimental-features = nix-command flakes - run: nix run nixpkgs#alejandra -- -c . - From 111c2ad3177787aa215b52e29c162b9758c7c0c1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 08:21:54 +0300 Subject: [PATCH 18/20] docs: add @FrothyMarrow to credits --- .github/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/README.md b/.github/README.md index 0020b1b..e7dcdb3 100644 --- a/.github/README.md +++ b/.github/README.md @@ -52,7 +52,7 @@

-[Get Started]: #try-it-out +[Get Started]: #get-started [Documentation]: #documentation [Help]: #help [Contribute]: #contributing @@ -144,8 +144,8 @@ Special thanks to - [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work - [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible - [@horriblename](https://github.com/horriblename) - For actively implementing planned features and quality of life updates -- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work - [@Yavko](https://github.com/Yavko) - For the amazing neovim-flake logo +- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I could not and everyone who has submitted issues or pull requests! From 4233a2c20d77e054b4c783263878354a905ddafe Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 16:51:24 +0300 Subject: [PATCH 19/20] feat: copilot completions in nvim-cmp sources --- configuration.nix | 5 ++++- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ lib/types/plugins.nix | 1 + modules/assistant/copilot/config.nix | 20 +++++++++++++++----- modules/assistant/copilot/copilot.nix | 17 ++++++++++++----- modules/completion/nvim-cmp/config.nix | 1 + 7 files changed, 55 insertions(+), 11 deletions(-) diff --git a/configuration.nix b/configuration.nix index a38a2da..250fafd 100644 --- a/configuration.nix +++ b/configuration.nix @@ -202,7 +202,10 @@ inputs: let }; vim.assistant = { - copilot.enable = isMaximal; + copilot = { + enable = isMaximal; + cmp.enable = isMaximal; + }; }; vim.session = { diff --git a/flake.lock b/flake.lock index cbd1ec7..3741f25 100644 --- a/flake.lock +++ b/flake.lock @@ -224,6 +224,22 @@ "type": "github" } }, + "copilot-cmp": { + "flake": false, + "locked": { + "lastModified": 1683831407, + "narHash": "sha256-+MzEGnhlrYRvAfskOwmw69OC1CsPXt7s3z+xPe9XPqs=", + "owner": "zbirenbaum", + "repo": "copilot-cmp", + "rev": "c2cdb3c0f5078b0619055af192295830a7987790", + "type": "github" + }, + "original": { + "owner": "zbirenbaum", + "repo": "copilot-cmp", + "type": "github" + } + }, "copilot-lua": { "flake": false, "locked": { @@ -1352,6 +1368,7 @@ "cmp-vsnip": "cmp-vsnip", "codewindow-nvim": "codewindow-nvim", "comment-nvim": "comment-nvim", + "copilot-cmp": "copilot-cmp", "copilot-lua": "copilot-lua", "crates-nvim": "crates-nvim", "dashboard-nvim": "dashboard-nvim", diff --git a/flake.nix b/flake.nix index 44af3f5..d207bff 100644 --- a/flake.nix +++ b/flake.nix @@ -481,6 +481,11 @@ flake = false; }; + copilot-cmp = { + url = "github:zbirenbaum/copilot-cmp"; + flake = false; + }; + # Session management nvim-session-manager = { url = "github:Shatur/neovim-session-manager"; diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 111fd8c..aed65f4 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -87,6 +87,7 @@ with lib; let "nvim-surround" "nvim-dap" "nvim-dap-ui" + "copilot-cmp" ]; # You can either use the name of the plugin or a package. pluginsType = with types; diff --git a/modules/assistant/copilot/config.nix b/modules/assistant/copilot/config.nix index c920e35..349d610 100644 --- a/modules/assistant/copilot/config.nix +++ b/modules/assistant/copilot/config.nix @@ -21,16 +21,21 @@ with builtins; let ''; in { config = mkIf cfg.enable { - vim.startPlugins = [ - "copilot-lua" - cfg.copilotNodePackage - ]; + vim.startPlugins = + [ + "copilot-lua" + cfg.copilotNodePackage + ] + ++ lib.optionals (cfg.cmp.enable) [ + "copilot-cmp" + ]; vim.luaConfigRC.copilot = nvim.dag.entryAnywhere '' require("copilot").setup({ -- available options: https://github.com/zbirenbaum/copilot.lua - copilot_node_command = "${cfg.copilot_node_command}", + copilot_node_command = "${cfg.copilotNodeCommand}", panel = { + enabled = ${lib.boolToString (!cfg.cmp.enable)}, keymap = { jump_prev = false, jump_next = false, @@ -44,6 +49,7 @@ in { }, }, suggestion = { + enabled = ${lib.boolToString (!cfg.cmp.enable)}, keymap = { accept = false, accept_word = false, @@ -54,6 +60,10 @@ in { }, }, }) + + ${lib.optionalString (cfg.cmp.enable) '' + require("copilot_cmp").setup() + ''} ''; vim.maps.normal = mkMerge [ diff --git a/modules/assistant/copilot/copilot.nix b/modules/assistant/copilot/copilot.nix index 003308a..927604c 100644 --- a/modules/assistant/copilot/copilot.nix +++ b/modules/assistant/copilot/copilot.nix @@ -10,6 +10,7 @@ with builtins; let in { options.vim.assistant.copilot = { enable = mkEnableOption "GitHub Copilot AI assistant"; + cmp.enable = mkEnableOption "nvim-cmp integration for GitHub Copilot"; panel = { position = mkOption { @@ -91,16 +92,22 @@ in { }; }; - copilot_node_command = mkOption { + copilotNodeCommand = mkOption { type = types.str; default = "${lib.getExe cfg.copilotNodePackage}"; - description = "Path to nodejs"; + description = '' + The command that will be executed to initiate nodejs for GitHub Copilot. + Recommended to leave as default. + ''; }; copilotNodePackage = mkOption { - type = with types; nullOr package; # TODO - maybe accept a path as well? imperative users might want to use something like nvm - default = pkgs.nodejs-slim; # this will likely need to be downgraded because Copilot does not stay up to date with NodeJS - description = "The package that will be used for Copilot. NodeJS v18 is recommended."; + type = with types; nullOr package; + default = pkgs.nodejs-slim; + description = '' + The nodeJS package that will be used for GitHub Copilot. If you are using a custom node command + you may want to set this option to null so that the package is not pulled from nixpkgs. + ''; }; }; } diff --git a/modules/completion/nvim-cmp/config.nix b/modules/completion/nvim-cmp/config.nix index e49fdb9..52e8972 100644 --- a/modules/completion/nvim-cmp/config.nix +++ b/modules/completion/nvim-cmp/config.nix @@ -49,6 +49,7 @@ in { "buffer" = "[Buffer]"; "crates" = "[Crates]"; "path" = "[Path]"; + "copilot" = "[Copilot]"; }; vim.maps.insert = mkMerge [ From 3c0779601058b7c00e4227fcf94f269d9f983202 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Jul 2023 17:29:01 +0300 Subject: [PATCH 20/20] docs: add missing changelog entry for copilot in nvim-cmp completions --- docs/release-notes/rl-0.5.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/release-notes/rl-0.5.adoc b/docs/release-notes/rl-0.5.adoc index 967ce02..865ee3f 100644 --- a/docs/release-notes/rl-0.5.adoc +++ b/docs/release-notes/rl-0.5.adoc @@ -15,3 +15,7 @@ https://github.com/horriblename[horriblename]: https://github.com/amanse[amanse]: * Add daily notes options for obsidian plugin + +https://github.com/notashelf[notashelf]: + +* Add GitHub Copilot to completion sources