mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-23 20:08:30 +00:00
Compare commits
7 commits
bacd3f6cbf
...
679cfcae22
Author | SHA1 | Date | |
---|---|---|---|
![]() |
679cfcae22 | ||
![]() |
cc14a1c1f6 | ||
![]() |
108cfd8383 | ||
9ea9995b92 | |||
7417c6e4f3 | |||
![]() |
55cdd6db48 | ||
![]() |
cb0f831efd |
9 changed files with 167 additions and 6 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.
|
||||
|
|
|
@ -72,6 +72,7 @@ isMaximal: {
|
|||
enable = isMaximal;
|
||||
crates.enable = isMaximal;
|
||||
};
|
||||
nu.enable = isMaximal;
|
||||
};
|
||||
|
||||
visuals = {
|
||||
|
|
|
@ -80,13 +80,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):
|
||||
|
||||
|
@ -193,6 +196,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:
|
||||
|
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -799,11 +799,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": {
|
||||
|
|
|
@ -20,6 +20,8 @@ in {
|
|||
"neo-tree-nvim"
|
||||
];
|
||||
|
||||
visuals.nvimWebDevicons.enable = true;
|
||||
|
||||
pluginRC.neo-tree = entryAnywhere ''
|
||||
require("neo-tree").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
|
|
|
@ -26,6 +26,7 @@ in {
|
|||
./ts.nix
|
||||
./typst.nix
|
||||
./zig.nix
|
||||
./nu.nix
|
||||
];
|
||||
|
||||
options.vim.languages = {
|
||||
|
|
137
modules/plugins/languages/nu.nix
Normal file
137
modules/plugins/languages/nu.nix
Normal file
|
@ -0,0 +1,137 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption mkPackageOption;
|
||||
inherit (lib.types) str either package listOf enum;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (pkgs) fetchFromGitHub;
|
||||
inherit (builtins) attrNames isList;
|
||||
|
||||
defaultServer = "nushell";
|
||||
servers = {
|
||||
nushell = {
|
||||
package = pkgs.nushell;
|
||||
lspConfig = ''
|
||||
lspconfig.nushell.setup{
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/nu", "--no-config-file", "--lsp"}''
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
# FIX: uncomment formatting parts, once https://github.com/NixOS/nixpkgs/pull/341647 makes it into nixos-unstable
|
||||
# defaultFormat = "nufmt";
|
||||
# formats = {
|
||||
# nufmt = {
|
||||
# package = pkgs.nufmt.overrideAttrs {
|
||||
# src = fetchFromGitHub {
|
||||
# owner = "nushell";
|
||||
# repo = "nufmt";
|
||||
# rev = "63549df4406216cce7e744576b1ee8fcaba9a30a";
|
||||
# hash = "sha256-Y7LvsCuirhYPjuQSF0w7me8vYrV39i4OhVvyI3XskpE=";
|
||||
# };
|
||||
# };
|
||||
# nullConfig = ''
|
||||
# table.insert(
|
||||
# ls_sources,
|
||||
# {
|
||||
# name = "nufmt",
|
||||
# method = null_methods.internal.FORMATTING,
|
||||
# filetypes = { "nu" },
|
||||
# generator_opts = {
|
||||
# command = "${cfg.format.package}/bin/nufmt",
|
||||
# args = { "--stdin" },
|
||||
# to_stdin = true
|
||||
# },
|
||||
# factory = null_helpers.formatter_factory
|
||||
# }
|
||||
# )
|
||||
# '';
|
||||
# };
|
||||
# };
|
||||
|
||||
cfg = config.vim.languages.nu;
|
||||
in {
|
||||
options.vim.languages.nu = {
|
||||
enable = mkEnableOption "Nu language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Nu treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkOption {
|
||||
description = "The Nu treesitter package to use.";
|
||||
type = package;
|
||||
# FIX: this doesn't work, unofficial grammars probably need some extra lua code
|
||||
default = pkgs.tree-sitter.buildGrammar {
|
||||
language = "nu";
|
||||
version = "0.0.0+rev=0bb9a60";
|
||||
src = fetchFromGitHub {
|
||||
owner = "nushell";
|
||||
repo = "tree-sitter-nu";
|
||||
rev = "0bb9a602d9bc94b66fab96ce51d46a5a227ab76c";
|
||||
hash = "sha256-A5GiOpITOv3H0wytCv6t43buQ8IzxEXrk3gTlOrO0K0=";
|
||||
};
|
||||
meta.homepage = "https://github.com/nushell/tree-sitter-nu";
|
||||
};
|
||||
defaultText = "See code";
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Nu LSP support" // {default = config.vim.languages.enableLSP;};
|
||||
server = mkOption {
|
||||
description = "Nu LSP server to use";
|
||||
type = str;
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Nu LSP server package, or the command to run as a list of strings";
|
||||
example = ''[(lib.getExe pkgs.nushell) "--lsp"]'';
|
||||
type = either package (listOf str);
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
||||
# format = {
|
||||
# enable = mkEnableOption "Nu formatting" // {default = config.vim.languages.enableFormat;};
|
||||
#
|
||||
# type = mkOption {
|
||||
# description = "Nu formatter to use";
|
||||
# type = enum (attrNames formats);
|
||||
# default = defaultFormat;
|
||||
# };
|
||||
# package = mkOption {
|
||||
# description = "Nu formatter package";
|
||||
# type = package;
|
||||
# default = formats.${cfg.format.type}.package;
|
||||
# };
|
||||
# };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.nu-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
|
||||
# (mkIf cfg.format.enable {
|
||||
# vim.lsp.null-ls.enable = true;
|
||||
# vim.lsp.null-ls.sources.nu-format = formats.${cfg.format.type}.nullConfig;
|
||||
# })
|
||||
]);
|
||||
}
|
|
@ -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"
|
||||
];
|
||||
|
|
|
@ -69,7 +69,7 @@ in {
|
|||
notify = true, -- nvim-notify
|
||||
which_key = true,
|
||||
navic = {
|
||||
enabled = false,
|
||||
enabled = true,
|
||||
custom_bg = "NONE", -- "lualine" will set background to mantle
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue