Merge branch 'main' into v0.6

This commit is contained in:
NotAShelf 2024-04-27 16:09:37 +03:00
commit b397dcb430
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
5 changed files with 116 additions and 4 deletions

12
.github/README.md vendored
View file

@ -36,8 +36,14 @@
Nix code.
</a>
</div>
<br/>
</div>
> [!WARNING]
> Main branch is only updated for small, non-breaking changes. For the latest version of neovim-flake, please see
> [the list of branches](https://github.com/NotAShelf/neovim-flake/branches) or
> [open pull requests](https://github.com/NotAShelf/neovim-flake/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc).
> neovim-flake, at the time, is still being actively developed - and will continue to be so for the foreseeable
> future.
---
@ -177,3 +183,7 @@ Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-fla
are published under the [CC BY License].
---
<div align="right">
<a href="#readme">Back to the Top</a>
</div>

View file

@ -36,7 +36,7 @@ jobs:
cp -r result/share/doc/neovim-flake public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

View file

@ -37,6 +37,33 @@
'';
};
};
defaultFormat = "prettier";
formats = {
prettier = {
package = pkgs.nodePackages.prettier;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettier",
})
)
'';
};
prettierd = {
package = pkgs.prettierd;
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettierd",
})
)
'';
};
};
in {
options.vim.languages.css = {
enable = mkEnableOption "CSS language support";
@ -63,6 +90,22 @@ in {
default = servers.${cfg.lsp.server}.package;
};
};
format = {
enable = mkEnableOption "CSS formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
description = "CSS formatter to use";
type = with types; enum (attrNames formats);
default = defaultFormat;
};
package = mkOption {
description = "CSS formatter package";
type = types.package;
default = formats.${cfg.format.type}.package;
};
};
};
config = mkIf cfg.enable (mkMerge [
@ -73,7 +116,12 @@ in {
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig;
vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig;
})
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.css-format = formats.${cfg.format.type}.nullConfig;
})
]);
}

View file

@ -55,7 +55,7 @@ in {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig;
vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig;
})
]);
}

View file

@ -0,0 +1,54 @@
{
pkgs,
lib,
...
}: let
inherit (lib) mkMappingOption mkEnableOption mkOption types;
in {
options.vim.telescope = {
mappings = {
findProjects = mkMappingOption "Find files [Telescope]" "<leader>fp";
findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff";
liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg";
buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb";
helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh";
open = mkMappingOption "Open [Telescope]" "<leader>ft";
gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw";
gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb";
gitBranches = mkMappingOption "Git branches [Telescope]" "<leader>fvb";
gitStatus = mkMappingOption "Git status [Telescope]" "<leader>fvs";
gitStash = mkMappingOption "Git stash [Telescope]" "<leader>fvx";
lspDocumentSymbols = mkMappingOption "LSP Document Symbols [Telescope]" "<leader>flsb";
lspWorkspaceSymbols = mkMappingOption "LSP Workspace Symbols [Telescope]" "<leader>flsw";
lspReferences = mkMappingOption "LSP References [Telescope]" "<leader>flr";
lspImplementations = mkMappingOption "LSP Implementations [Telescope]" "<leader>fli";
lspDefinitions = mkMappingOption "LSP Definitions [Telescope]" "<leader>flD";
lspTypeDefinitions = mkMappingOption "LSP Type Definitions [Telescope]" "<leader>flt";
diagnostics = mkMappingOption "Diagnostics [Telescope]" "<leader>fld";
treesitter = mkMappingOption "Treesitter [Telescope]" "<leader>fs";
};
enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility";
vimgrep_arguments = mkOption {
description = "Arguments to use for the grep command";
type = types.listOf types.str;
default = [
"${pkgs.ripgrep}/bin/rg"
"--color=never"
"--no-heading"
"--with-filename"
"--line-number"
"--column"
"--smart-case"
"--hidden"
"--no-ignore"
];
};
};
}