mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-23 20:08:30 +00:00
Compare commits
11 commits
295eca2083
...
957b3606dd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
957b3606dd | ||
![]() |
8154c3e68f | ||
![]() |
f4ff635a65 | ||
![]() |
40e5e5079e | ||
3299facbaa | |||
![]() |
bdf777dc8a | ||
![]() |
cc14a1c1f6 | ||
![]() |
108cfd8383 | ||
9ea9995b92 | |||
7417c6e4f3 | |||
3cba3ca30c |
12 changed files with 119 additions and 41 deletions
8
.github/README.md
vendored
8
.github/README.md
vendored
|
@ -124,10 +124,16 @@ The _recommended_ way of installing **nvf** is using either the NixOS or the
|
|||
Home-Manager module, though it is completely possible and no less supported to
|
||||
install **nvf** as a standalone package, or a flake output.
|
||||
|
||||
See the [**nvf** manual] for detailed and up-to-date installation guides,
|
||||
See the rendered [nvf manual] for detailed and up-to-date installation guides,
|
||||
configurations, available options, release notes and more. Tips for installing
|
||||
userspace plugins is also contained in the documentation.
|
||||
|
||||
> [!TIP]
|
||||
> While using NixOS or Home-Manager modules,
|
||||
> `programs.nvf.enableManpages = true;` will allow you to view option
|
||||
> documentation from the comfort of your terminal via `man 5 nvf`. The more you
|
||||
> know.
|
||||
|
||||
Please create an issue on the [issue tracker] if you find the documentation
|
||||
lacking or confusing. Any improvements to the documentation through pull
|
||||
requests are also welcome, and appreciated.
|
||||
|
|
|
@ -106,13 +106,16 @@ everyone.
|
|||
|
||||
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
||||
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
||||
[neo-tree.nvim]: https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
|
||||
- Add [ocaml-lsp] support
|
||||
|
||||
- Fix "Emac" typo
|
||||
|
||||
- Add [new-file-template.nvim] to automatically fill new file contents using
|
||||
templates.
|
||||
templates
|
||||
|
||||
- Make [neo-tree.nvim] display file icons properly by enabling `visuals.nvimWebDevicons`
|
||||
|
||||
[diniamo](https://github.com/diniamo):
|
||||
|
||||
|
@ -221,6 +224,10 @@ everyone.
|
|||
- Add [](#opt-vim.dashboard.dashboard-nvim.setupOpts) to allow user
|
||||
configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim)
|
||||
|
||||
- Update `lualine.nvim` input and add missing themes:
|
||||
- Adds `ayu`, `gruvbox_dark`, `iceberg`, `moonfly`, `onedark`,
|
||||
`powerline_dark` and `solarized_light` themes.
|
||||
|
||||
[ppenguin](https://github.com/ppenguin):
|
||||
|
||||
- Telescope:
|
||||
|
@ -232,3 +239,8 @@ everyone.
|
|||
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
||||
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
||||
ccc
|
||||
|
||||
[Bloxx12](https://github.com/Bloxx12)
|
||||
|
||||
- Add support for [base16 theming](https://github.com/RRethy/base16-nvim) under
|
||||
`vim.theme`
|
||||
|
|
23
flake.lock
generated
23
flake.lock
generated
|
@ -172,6 +172,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-base16": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1716483968,
|
||||
"narHash": "sha256-GRF/6AobXHamw8TZ3FjL7SI6ulcpwpcohsIuZeCSh2A=",
|
||||
"owner": "rrethy",
|
||||
"repo": "base16-nvim",
|
||||
"rev": "6ac181b5733518040a33017dde654059cd771b7c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "rrethy",
|
||||
"repo": "base16-nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugin-bufdelete-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -799,11 +815,11 @@
|
|||
"plugin-lualine": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1712310396,
|
||||
"narHash": "sha256-WcH2dWdRDgMkwBQhcgT+Z/ArMdm+VbRhmQftx4t2kNI=",
|
||||
"lastModified": 1723473562,
|
||||
"narHash": "sha256-gCm7m96PkZyrgjmt7Efc+NMZKStAq1zr7JRCYOgGDuE=",
|
||||
"owner": "hoob3rt",
|
||||
"repo": "lualine.nvim",
|
||||
"rev": "0a5a66803c7407767b799067986b4dc3036e1983",
|
||||
"rev": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -1802,6 +1818,7 @@
|
|||
"nixpkgs": "nixpkgs",
|
||||
"nmd": "nmd",
|
||||
"plugin-alpha-nvim": "plugin-alpha-nvim",
|
||||
"plugin-base16": "plugin-base16",
|
||||
"plugin-bufdelete-nvim": "plugin-bufdelete-nvim",
|
||||
"plugin-catppuccin": "plugin-catppuccin",
|
||||
"plugin-ccc": "plugin-ccc",
|
||||
|
|
|
@ -349,6 +349,11 @@
|
|||
};
|
||||
|
||||
# Themes
|
||||
plugin-base16 = {
|
||||
url = "github:rrethy/base16-nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-tokyonight = {
|
||||
url = "github:folke/tokyonight.nvim";
|
||||
flake = false;
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
typesDag = import ./dag.nix {inherit lib;};
|
||||
typesPlugin = import ./plugins.nix {inherit inputs lib;};
|
||||
typesLanguage = import ./languages.nix {inherit lib;};
|
||||
typesCustom = import ./custom.nix {inherit lib;};
|
||||
typesTypes = import ./types.nix {inherit lib;};
|
||||
in {
|
||||
inherit (typesDag) dagOf;
|
||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||
inherit (typesCustom) anythingConcatLists char;
|
||||
inherit (typesTypes) anythingConcatLists char hexColor;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{lib}: let
|
||||
inherit (lib) isStringLike showOption showFiles getFiles mergeOneOption mergeEqualOption mkOptionType;
|
||||
inherit (lib.strings) isString;
|
||||
inherit (lib.types) anything attrsOf;
|
||||
inherit (lib.nvim.types) anythingConcatLists;
|
||||
inherit (builtins) typeOf isAttrs any head concatLists stringLength;
|
||||
inherit (builtins) typeOf isAttrs any head concatLists stringLength match;
|
||||
in {
|
||||
# HACK: Does this break anything in our case?
|
||||
# A modified version of the nixpkgs anything type that concatenates lists
|
||||
|
@ -58,4 +59,11 @@ in {
|
|||
check = value: stringLength value < 2;
|
||||
merge = mergeEqualOption;
|
||||
};
|
||||
|
||||
hexColor = mkOptionType {
|
||||
name = "hex-color";
|
||||
descriptionClass = "noun";
|
||||
description = "RGB color in hex format";
|
||||
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
|
||||
};
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.types) either str listOf attrsOf nullOr submodule bool;
|
||||
inherit (lib.types) either str listOf attrsOf nullOr submodule;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
|
||||
mapConfigOptions = {
|
||||
|
@ -33,9 +33,7 @@
|
|||
// {
|
||||
key = mkOption {
|
||||
type = str;
|
||||
description = ''
|
||||
Key that triggers this keybind.
|
||||
'';
|
||||
description = "The key that triggers this keybind.";
|
||||
};
|
||||
mode = mkOption {
|
||||
type = either str (listOf str);
|
||||
|
@ -44,20 +42,17 @@
|
|||
|
||||
See `:help map-modes` for a list of modes.
|
||||
'';
|
||||
example = ''"nvc" for normal, visual and command mode'';
|
||||
example = ''`["n" "v" "c"]` for normal, visual and command mode'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# legacy stuff
|
||||
legacyMapOption = submodule {
|
||||
options = mapConfigOptions;
|
||||
};
|
||||
|
||||
mapOptions = mode:
|
||||
legacyMapOption = mode:
|
||||
mkOption {
|
||||
description = "Mappings for ${mode} mode";
|
||||
type = attrsOf legacyMapOption;
|
||||
type = attrsOf (submodule {
|
||||
options = mapConfigOptions;
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
in {
|
||||
|
@ -85,18 +80,18 @@ in {
|
|||
};
|
||||
|
||||
maps = {
|
||||
normal = mapOptions "normal";
|
||||
insert = mapOptions "insert";
|
||||
select = mapOptions "select";
|
||||
visual = mapOptions "visual and select";
|
||||
terminal = mapOptions "terminal";
|
||||
normalVisualOp = mapOptions "normal, visual, select and operator-pending (same as plain 'map')";
|
||||
normal = legacyMapOption "normal";
|
||||
insert = legacyMapOption "insert";
|
||||
select = legacyMapOption "select";
|
||||
visual = legacyMapOption "visual and select";
|
||||
terminal = legacyMapOption "terminal";
|
||||
normalVisualOp = legacyMapOption "normal, visual, select and operator-pending (same as plain 'map')";
|
||||
|
||||
visualOnly = mapOptions "visual only";
|
||||
operator = mapOptions "operator-pending";
|
||||
insertCommand = mapOptions "insert and command-line";
|
||||
lang = mapOptions "insert, command-line and lang-arg";
|
||||
command = mapOptions "command-line";
|
||||
visualOnly = legacyMapOption "visual only";
|
||||
operator = legacyMapOption "operator-pending";
|
||||
insertCommand = legacyMapOption "insert and command-line";
|
||||
lang = legacyMapOption "insert, command-line and lang-arg";
|
||||
command = legacyMapOption "command-line";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ in {
|
|||
"neo-tree-nvim"
|
||||
];
|
||||
|
||||
visuals.nvimWebDevicons.enable = true;
|
||||
|
||||
pluginRC.neo-tree = entryAnywhere ''
|
||||
require("neo-tree").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
|
|
|
@ -17,29 +17,36 @@
|
|||
"ayu_dark"
|
||||
"ayu_light"
|
||||
"ayu_mirage"
|
||||
"ayu"
|
||||
"codedark"
|
||||
"dracula"
|
||||
"everforest"
|
||||
"gruvbox"
|
||||
"gruvbox_dark"
|
||||
"gruvbox_light"
|
||||
"gruvbox_material"
|
||||
"horizon"
|
||||
"iceberg_dark"
|
||||
"iceberg_light"
|
||||
"iceberg"
|
||||
"jellybeans"
|
||||
"material"
|
||||
"modus_vivendi"
|
||||
"molokai"
|
||||
"moonfly"
|
||||
"nightfly"
|
||||
"nord"
|
||||
"oceanicnext"
|
||||
"onedark"
|
||||
"onelight"
|
||||
"palenight"
|
||||
"papercolor_dark"
|
||||
"papercolor_light"
|
||||
"powerline_dark"
|
||||
"powerline"
|
||||
"seoul256"
|
||||
"solarized_dark"
|
||||
"solarized_light"
|
||||
"tomorrow"
|
||||
"wombat"
|
||||
];
|
||||
|
@ -224,7 +231,7 @@ in {
|
|||
local buf_ft = vim.api.nvim_get_option_value('filetype', {})
|
||||
|
||||
-- List of buffer types to exclude
|
||||
local excluded_buf_ft = {"toggleterm", "NvimTree", "TelescopePrompt"}
|
||||
local excluded_buf_ft = {"toggleterm", "NvimTree", "neo-tree", "TelescopePrompt"}
|
||||
|
||||
-- Check if the current buffer type is in the excluded list
|
||||
for _, excluded_type in ipairs(excluded_buf_ft) do
|
||||
|
|
|
@ -4,7 +4,14 @@
|
|||
}: let
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.trivial) boolToString warnIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
in {
|
||||
base16 = {
|
||||
setup = {base16-colors, ...}: ''
|
||||
-- Base16 theme
|
||||
require('base16-colorscheme').setup(${toLuaObject base16-colors})
|
||||
'';
|
||||
};
|
||||
onedark = {
|
||||
setup = {style ? "dark", ...}: ''
|
||||
-- OneDark theme
|
||||
|
@ -20,6 +27,7 @@ in {
|
|||
setup = {
|
||||
style ? "night",
|
||||
transparent,
|
||||
...
|
||||
}: ''
|
||||
require('tokyonight').setup {
|
||||
transparent = ${boolToString transparent};
|
||||
|
@ -42,6 +50,7 @@ in {
|
|||
setup = {
|
||||
style ? "mocha",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
-- Catppuccin theme
|
||||
require('catppuccin').setup {
|
||||
|
@ -69,7 +78,7 @@ in {
|
|||
notify = true, -- nvim-notify
|
||||
which_key = true,
|
||||
navic = {
|
||||
enabled = false,
|
||||
enabled = true,
|
||||
custom_bg = "NONE", -- "lualine" will set background to mantle
|
||||
},
|
||||
},
|
||||
|
|
|
@ -4,32 +4,51 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.attrsets) attrNames;
|
||||
inherit (lib.attrsets) attrNames listToAttrs;
|
||||
inherit (lib.strings) hasPrefix;
|
||||
inherit (lib.types) bool lines enum;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryBefore;
|
||||
inherit (lib.nvim.types) hexColor;
|
||||
|
||||
cfg = config.vim.theme;
|
||||
supportedThemes = import ./supported-themes.nix {
|
||||
inherit lib config;
|
||||
};
|
||||
|
||||
numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"];
|
||||
base16Options = listToAttrs (map (n: {
|
||||
name = "base0${n}";
|
||||
value = mkOption {
|
||||
description = "The base0${n} color to use";
|
||||
type = hexColor;
|
||||
apply = v:
|
||||
if hasPrefix "#" v
|
||||
then v
|
||||
else "#${v}";
|
||||
};
|
||||
})
|
||||
numbers);
|
||||
in {
|
||||
options.vim.theme = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
description = "Enable theming";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = enum (attrNames supportedThemes);
|
||||
description = "Supported themes can be found in `supportedThemes.nix`";
|
||||
description = ''
|
||||
Supported themes can be found in {file}`supportedThemes.nix`.
|
||||
Setting the theme to "base16" enables base16 theming and
|
||||
requires all of the colors in {option}`vim.theme.base16-colors` to be set.
|
||||
'';
|
||||
};
|
||||
base16-colors = base16Options;
|
||||
|
||||
style = mkOption {
|
||||
type = enum supportedThemes.${cfg.name}.styles;
|
||||
description = "Specific style for theme if it supports it";
|
||||
};
|
||||
|
||||
transparent = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
|
@ -47,7 +66,7 @@ in {
|
|||
startPlugins = [cfg.name];
|
||||
luaConfigRC.theme = entryBefore ["pluginConfigs"] ''
|
||||
${cfg.extraConfig}
|
||||
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}}
|
||||
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent base16-colors;}}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -43,9 +43,7 @@ in {
|
|||
|
||||
toLuaKeymap = bind: "vim.keymap.set(${toLuaObject bind.mode}, ${toLuaObject bind.key}, ${toLuaObject (getAction bind)}, ${toLuaObject (getOpts bind)})";
|
||||
|
||||
maps = concatLines (map toLuaKeymap cfg.keymaps);
|
||||
|
||||
keymaps = maps;
|
||||
keymaps = concatLines (map toLuaKeymap cfg.keymaps);
|
||||
in {
|
||||
vim = {
|
||||
luaConfigRC = {
|
||||
|
|
Loading…
Add table
Reference in a new issue