Compare commits

...

4 commits

Author SHA1 Message Date
raf
77f6fa85a0
Merge 41e5633550 into aa7b55fa49 2025-01-07 08:15:46 +01:00
aa7b55fa49
docs: liberapay URL for @horriblename
Some checks failed
Check for typos in the source tree / check-typos (push) Has been cancelled
2025-01-07 06:10:15 +03:00
2728e65a5e
docs/installation: mark additional inputs as 'optional'
Some checks failed
Check for typos in the source tree / check-typos (push) Waiting to run
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check documentation / Validate hyperlinks in documentation sources (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
2025-01-07 04:19:57 +03:00
41e5633550
statusline/feline: init 2025-01-05 12:26:55 +03:00
9 changed files with 214 additions and 18 deletions

28
.github/README.md vendored
View file

@ -210,12 +210,16 @@ features.
Alongside myself, nvf is developed by those talented folk: Alongside myself, nvf is developed by those talented folk:
- [**@horriblename**](https://github.com/horriblename) - For actively - [**@horriblename**](https://github.com/horriblename)
implementing planned features and quality of life updates. ([Liberapay](https://liberapay.com/horriblename/))- For actively implementing
planned features and quality of life updates.
- [**@Diniamo**](https://github.com/Diniamo) - [**@Diniamo**](https://github.com/Diniamo)
([Liberapay](https://en.liberapay.com/diniamo/)) - For actively submitting ([Liberapay](https://en.liberapay.com/diniamo/)) - For actively submitting
pull requests, issues and assistance with maintenance of nvf. pull requests, issues and assistance with maintenance of nvf.
Please do remember to extend your thanks (financially or otherwise) if this
project has been helpful to you.
### Contributors ### Contributors
[mnw]: https://github.com/gerg-l/mnw [mnw]: https://github.com/gerg-l/mnw
@ -245,17 +249,17 @@ This configuration borrows from and is based on a few other configurations,
including: including:
- [@jordanisaacs's](https://github.com/jordanisaacs) - [@jordanisaacs's](https://github.com/jordanisaacs)
[neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake [**neovim-flake**](https://github.com/jordanisaacs/neovim-flake) that this
is originally based on. flake is originally based on.
- [@sioodmy's](https://github.com/sioodmy)
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
choices for UI and plugin defaults.
- [@wiltaylor's](https://github.com/wiltaylor) - [@wiltaylor's](https://github.com/wiltaylor)
[neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and [neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and
design ideas. design ideas.
- [@gvolpe's](https://github.com/gvolpe) - [@gvolpe's](https://github.com/gvolpe)
[neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and [neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and
nix concepts. nix concepts.
- [@sioodmy's](https://github.com/sioodmy)
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
choices for UI and plugin defaults.
I am grateful for their previous work and inspiration, and I wholeheartedly I am grateful for their previous work and inspiration, and I wholeheartedly
recommend checking their work out. recommend checking their work out.
@ -263,12 +267,12 @@ recommend checking their work out.
## License ## License
Following the license of the Following the license of
[original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf has [the original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf
been made available under the [**MIT License**](LICENSE). However, all assets has been made available under the [**MIT License**](LICENSE). However, all
and documentation are published under the assets and documentation are published under the
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE) [**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE)
under explicit permission by the artist. under explicit permission by the author or authors.
<h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6> <h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6>

View file

@ -10,12 +10,18 @@ To use it, we first add the input flake.
```nix ```nix
{ {
inputs = { inputs = {
# Optional, if you intend to follow nvf's obsidian-nvim input
# you must also add it as a flake input.
obsidian-nvim.url = "github:epwalsh/obsidian.nvim"; obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
# Required, nvf works best and only directly supports flakes
nvf = { nvf = {
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
# you can override input nixpkgs # You can override the input nixpkgs to follow your system's
# instance of nixpkgs. This is safe to do as nvf does not depend
# on a binary cache.
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
# you can also override individual plugins # Optionally, you can also override individual plugins
# for example: # for example:
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
}; };
@ -27,8 +33,8 @@ Followed by importing the home-manager module somewhere in your configuration.
```nix ```nix
{ {
# assuming nvf is in your inputs and inputs is in the argset # Assuming "nvf" is in your inputs and inputs is in the argument set.
# see example below # See example installation below
imports = [ inputs.nvf.homeManagerModules.default ]; imports = [ inputs.nvf.homeManagerModules.default ];
} }
``` ```

View file

@ -10,12 +10,18 @@ To use it, we first add the input flake.
```nix ```nix
{ {
inputs = { inputs = {
# Optional, if you intend to follow nvf's obsidian-nvim input
# you must also add it as a flake input.
obsidian-nvim.url = "github:epwalsh/obsidian.nvim"; obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
# Required, nvf works best and only directly supports flakes
nvf = { nvf = {
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
# you can override input nixpkgs # You can override the input nixpkgs to follow your system's
# instance of nixpkgs. This is safe to do as nvf does not depend
# on a binary cache.
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
# you can also override individual plugins # Optionally, you can also override individual plugins
# for example: # for example:
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
}; };

17
flake.lock generated
View file

@ -588,6 +588,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-feline-nvim": {
"flake": false,
"locked": {
"lastModified": 1731467236,
"narHash": "sha256-/TqgHJo2ej/V5bubTdTlf5S+EZmSpU5F2Mdi0SHCD30=",
"owner": "freddiehaddad",
"repo": "feline.nvim",
"rev": "9f1313f61a75ec5ebe805fedd46bdc130c420963",
"type": "github"
},
"original": {
"owner": "freddiehaddad",
"repo": "feline.nvim",
"type": "github"
}
},
"plugin-fidget-nvim": { "plugin-fidget-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -2133,6 +2149,7 @@
"plugin-dressing-nvim": "plugin-dressing-nvim", "plugin-dressing-nvim": "plugin-dressing-nvim",
"plugin-elixir-tools": "plugin-elixir-tools", "plugin-elixir-tools": "plugin-elixir-tools",
"plugin-fastaction-nvim": "plugin-fastaction-nvim", "plugin-fastaction-nvim": "plugin-fastaction-nvim",
"plugin-feline-nvim": "plugin-feline-nvim",
"plugin-fidget-nvim": "plugin-fidget-nvim", "plugin-fidget-nvim": "plugin-fidget-nvim",
"plugin-flutter-tools": "plugin-flutter-tools", "plugin-flutter-tools": "plugin-flutter-tools",
"plugin-friendly-snippets": "plugin-friendly-snippets", "plugin-friendly-snippets": "plugin-friendly-snippets",

View file

@ -288,6 +288,12 @@
flake = false; flake = false;
}; };
plugin-feline-nvim = {
url = "github:freddiehaddad/feline.nvim";
flake = false;
};
# Completion
plugin-nvim-cmp = { plugin-nvim-cmp = {
url = "github:hrsh7th/nvim-cmp"; url = "github:hrsh7th/nvim-cmp";
flake = false; flake = false;

View file

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./feline
./lualine ./lualine
]; ];
} }

View file

@ -0,0 +1,21 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.statusline.feline-nvim;
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins.feline-nvim = {
event = "UIEnter";
package = "feline-nvim";
setupModule = "feline";
inherit (cfg) setupOpts;
};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./feline.nix
];
}

View file

@ -0,0 +1,129 @@
{
config,
lib,
...
}: let
inherit (builtins) elem;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) str listOf attrsOf anything either submodule;
inherit (lib.lists) optional;
inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.types) mkPluginSetupOption;
conditionalRenderers = {
options = {
filetypes = mkOption {
type = listOf str;
default = [
"^NvimTree$"
"^neo-tree$"
"^startify$"
"^fugitive$"
"^fugitiveblame$"
"^qf$"
"^help$"
];
description = "Filetypes in which to force render inactive statusline";
};
buftypes = mkOption {
type = listOf str;
default = ["^terminal$"];
description = "Buffer types in which to force render inactive statusline";
};
bufnames = mkOption {
type = listOf str;
default = [];
description = "Buffer names in which to force render inactive statusline";
};
};
};
in {
options.vim.statusline.feline-nvim = {
enable = mkEnableOption "minimal, stylish and customizable statusline, statuscolumn, and winbar [feline.nvim]";
setupOpts = mkPluginSetupOption "feline-nvim" {
custom_providers = mkOption {
type = attrsOf anything;
default = {};
example = literalExpression ''
{
window_number = mkLuaInline ''''
function()
return tostring(vim.api.nvim_win_get_number(0))
end
'''';
}
'';
description = "User-defined feline provider functions";
};
theme = mkOption {
type = either str (attrsOf str);
default = {};
example = {
fg = "#fff";
bg = "#111";
};
description = ''
Either a string containing the color theme name or an attribute set of
strings, containing the colors.
The themes `fg` and `bg` values also represent the default foreground
and background colors, respectively.
'';
};
separators = mkOption {
type = listOf str;
default = [];
example = ["slant_right_2"];
description = ''
A table containing custom Feline separator prests.
:::{.warning}
This option is not type-checked! Before setting this option, please take
a look at {command}`:help feline-separator-preset` for a list of
available separator presets.
:::
'';
};
force_inactive = mkOption {
default = {};
type = attrsOf (submodule conditionalRenderers);
description = ''
A table that determines which buffers should always have the inactive
statusline, even when they are active.
'';
};
disable = mkOption {
default = {};
type = attrsOf (submodule conditionalRenderers);
description = ''
A table that determines which buffers should always have the statusline
disabled, even when they are active.
'';
};
vi_mode_colors = mkOption {
type = attrsOf str;
default = {};
description = ''
Attribute set containing colors associated with specific Vi modes.
It can later be used to get the color associated with the current Vim
mode using `require('feline.providers.vi_mode').get_mode_color()`.
See `:help feline-vi-mode` for more details on vi mode.
'';
};
};
};
}