Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui/edgy-nvim: init #380

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/release-notes/rl-0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ everyone.

[ts-error-translator.nvim]: https://github.com/dmmulroy/ts-error-translator.nvim
[credo]: https://github.com/rrrene/credo
[edgy.nvim]: https://github.com/folke/edgy.nvim

- Add `deno fmt` as the default Markdown formatter. This will be enabled
automatically if you have autoformatting enabled, but can be disabled manually
Expand Down Expand Up @@ -187,6 +188,10 @@ everyone.
- Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an
additional Python LSP server.

- Add support for [edgy.nvim]. This can be enabled with
[](#opt-vim.ui.edgy-nvim.enable). Support for `edgy.nvim` should be considered
diniamo marked this conversation as resolved.
Show resolved Hide resolved
**experimental** as it conflicts with other plugins that modify the UI.

[ppenguin](https://github.com/ppenguin):

- Telescope:
Expand Down
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,11 @@
flake = false;
};

plugin-edgy-nvim = {
url = "github:folke/edgy.nvim";
flake = false;
};

# Assistant
plugin-chatgpt = {
url = "github:jackMort/ChatGPT.nvim";
Expand Down
3 changes: 2 additions & 1 deletion modules/plugins/filetree/neo-tree/neo-tree.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ in {
description = ''
Must be either a boolean or a path to your log file.

Use :NeoTreeLogs to show the file
Use `:NeoTreeLogs` to show the file
'';
};

Expand All @@ -143,6 +143,7 @@ in {
'';
};

# https://github.com/folke/edgy.nvim/discussions/4
open_files_do_not_replace_types = mkOption {
type = listOf str;
default = ["terminal" "Trouble" "qf" "edgy"];
Expand Down
1 change: 1 addition & 0 deletions modules/plugins/ui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
./notifications
./smartcolumn
./colorizer
./edgy-nvim
./illuminate
./breadcrumbs
./borders
Expand Down
30 changes: 30 additions & 0 deletions modules/plugins/ui/edgy-nvim/config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryBefore;
inherit (lib.nvim.lua) toLuaObject;

cfg = config.vim.ui.edgy-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["edgy-nvim"];
pluginRC.edgy-nvim = entryBefore ["basic"] ''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect, pluginRC doesn't have a section called basic. You can either:

  1. Use entryAnywhere, which should be fine
  2. Put the variables in luaConfigRC instead, and change entryBefore to entryAfter, since later takes precedence, and we want to be overriding the values in basic, if there are any.

${optionalString cfg.setRecommendedNeovimOpts ''
-- Neovim options recommended by upstream.
-- Views can only be fully collapsed with the global statusline.
vim.o.laststatus = 3
-- Default splitting will cause your main splits to jump when opening an edgebar.
-- To prevent this, set `splitkeep` to either `screen` or `topline`.
vim.o.splitkeep = "screen"
Comment on lines +18 to +23
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very important, but I'm not sure if comments are very useful/necessary in the generated lua file.

''}

require('edgy').setup(${toLuaObject cfg.setupOpts})
'';
};
};
}
6 changes: 6 additions & 0 deletions modules/plugins/ui/edgy-nvim/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
imports = [
./edgy-nvim.nix
./config.nix
];
}
21 changes: 21 additions & 0 deletions modules/plugins/ui/edgy-nvim/edgy-nvim.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) bool;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.ui.edgy-nvim = {
enable = mkEnableOption "edgy.nvim for predefined window layouts";
setRecommendedNeovimOpts = mkOption {
type = bool;
default = false;
description = ''
Whether nvf should set `vim.opt.laststatus` and `vim.opt.splitkeep` to
values recommended by upstream to ensure maximum compatibility.
'';
};
NotAShelf marked this conversation as resolved.
Show resolved Hide resolved

setupOpts = mkPluginSetupOption "edgy" {
animate.enabled = mkEnableOption "animation support. Requires an animation library such as `mini.animate`";
};
};
}
Loading