mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-10-02 23:13:30 +00:00
Merge branch 'v0.8' into markdown-oxide
This commit is contained in:
commit
ef508ea10d
22 changed files with 583 additions and 394 deletions
2
.github/workflows/labeler.yml
vendored
2
.github/workflows/labeler.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
if: "!contains(github.event.pull_request.title, '[skip ci]')"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v5
|
- uses: actions/labeler@v6
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
configuration-path: .github/labels.yml
|
configuration-path: .github/labels.yml
|
||||||
|
|
|
@ -38,17 +38,17 @@ Autocommands (`autocmd`) trigger actions based on events happening within Neovim
|
||||||
(e.g., saving a file, entering a buffer). Each entry in the list is a submodule
|
(e.g., saving a file, entering a buffer). Each entry in the list is a submodule
|
||||||
with the following options:
|
with the following options:
|
||||||
|
|
||||||
| Option | Type | Default | Description | Example |
|
| Option | Type | Default | Description | Example |
|
||||||
| :--------- | :-------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- |
|
| :--------- | :-------------------- | :------ | :---------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------- |
|
||||||
| `enable` | `bool` | `true` | Enables or disables this autocommand definition. | `true` |
|
| `enable` | `bool` | `true` | Enables or disables this autocommand definition. | `true` |
|
||||||
| `event` | `nullOr (listOf str)` | `null` | **Required.** List of Neovim events that trigger this autocommand (e.g., `BufWritePre`, `FileType`). | `[ "BufWritePre" ]` |
|
| `event` | `nullOr (listOf str)` | `null` | **Required.** List of Neovim events that trigger this autocommand (e.g., `BufWritePre`, `FileType`). | `[ "BufWritePre" ]` |
|
||||||
| `pattern` | `nullOr (listOf str)` | `null` | List of file patterns (globs) to match against (e.g., `*.py`, `*`). If `null`, matches all files for the given event. | `[ "*.lua", "*.nix" ]` |
|
| `pattern` | `nullOr (listOf str)` | `null` | List of file patterns (globs) to match against (e.g., `*.py`, `*`). If `null`, matches all files for the given event. | `[ "*.lua", "*.nix" ]` |
|
||||||
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.nvim.types.luaInline` or `lib.options.literalExpression "mkLuaInline '''...'''"`. **Cannot be used with `command`.** | `lib.nvim.types.luaInline "function() print('File saved!') end"` |
|
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.generators.mkLuaInline`. **Cannot be used with `command`.** | `lib.generators.mkLuaInline "function() print('File saved!') end"` |
|
||||||
| `command` | `nullOr str` | `null` | A Vimscript command to execute when the event triggers. **Cannot be used with `callback`.** | `"echo 'File saved!'"` |
|
| `command` | `nullOr str` | `null` | A Vimscript command to execute when the event triggers. **Cannot be used with `callback`.** | `"echo 'File saved!'"` |
|
||||||
| `group` | `nullOr str` | `null` | The name of an `augroup` (defined in `vim.augroups`) to associate this autocommand with. | `"MyCustomAuGroup"` |
|
| `group` | `nullOr str` | `null` | The name of an `augroup` (defined in `vim.augroups`) to associate this autocommand with. | `"MyCustomAuGroup"` |
|
||||||
| `desc` | `nullOr str` | `null` | A description for the autocommand (useful for introspection). | `"Format buffer on save"` |
|
| `desc` | `nullOr str` | `null` | A description for the autocommand (useful for introspection). | `"Format buffer on save"` |
|
||||||
| `once` | `bool` | `false` | If `true`, the autocommand runs only once and then automatically removes itself. | `false` |
|
| `once` | `bool` | `false` | If `true`, the autocommand runs only once and then automatically removes itself. | `false` |
|
||||||
| `nested` | `bool` | `false` | If `true`, allows this autocommand to trigger other autocommands. | `false` |
|
| `nested` | `bool` | `false` | If `true`, allows this autocommand to trigger other autocommands. | `false` |
|
||||||
|
|
||||||
:::{.warning}
|
:::{.warning}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ Vimscript) for the same autocommand. Choose one.
|
||||||
pattern = [ "*.lua" ];
|
pattern = [ "*.lua" ];
|
||||||
group = "UserSetup";
|
group = "UserSetup";
|
||||||
desc = "Notify after saving Lua file";
|
desc = "Notify after saving Lua file";
|
||||||
callback = lib.nvim.types.luaInline ''
|
callback = lib.generators.mkLuaInline ''
|
||||||
function()
|
function()
|
||||||
vim.notify("Lua file saved!", vim.log.levels.INFO)
|
vim.notify("Lua file saved!", vim.log.levels.INFO)
|
||||||
end
|
end
|
||||||
|
|
|
@ -291,6 +291,10 @@
|
||||||
`null` value to disable them if conform is enabled.
|
`null` value to disable them if conform is enabled.
|
||||||
- Add [markdown-oxide](https://github.com/Feel-ix-343/markdown-oxide) option to
|
- Add [markdown-oxide](https://github.com/Feel-ix-343/markdown-oxide) option to
|
||||||
markdown language module.
|
markdown language module.
|
||||||
|
- Fix Helm-YAML language module integration. YAML diagnostics will now remain in
|
||||||
|
`helmfile`s when both are enabled.
|
||||||
|
- Fix YAML language module not activating LSP keybinds if the Helm language
|
||||||
|
module was also enabled.
|
||||||
|
|
||||||
[TheColorman](https://github.com/TheColorman):
|
[TheColorman](https://github.com/TheColorman):
|
||||||
|
|
||||||
|
@ -546,3 +550,16 @@
|
||||||
[derethil](https://github.com/derethil):
|
[derethil](https://github.com/derethil):
|
||||||
|
|
||||||
- Fix `vim.lazy.plugins.<name>.enabled` Lua evaluation.
|
- Fix `vim.lazy.plugins.<name>.enabled` Lua evaluation.
|
||||||
|
|
||||||
|
[Jules](https://github.com/jules-sommer):
|
||||||
|
|
||||||
|
[nvim-highlight-colors]: https://github.com/brenoprata10/nvim-highlight-colors
|
||||||
|
|
||||||
|
- Add [nvim-highlight-colors] plugin in `vim.ui.nvim-highlight-colors` with
|
||||||
|
`enable` and `setupOpts`
|
||||||
|
|
||||||
|
[simon-wg](https://github.com/simon-wg):
|
||||||
|
|
||||||
|
- Update `python` language module to use correct lsp binary.
|
||||||
|
- Fix `python` pyright and basedpyright language servers not using default on
|
||||||
|
attach behavior.
|
||||||
|
|
18
flake.lock
generated
18
flake.lock
generated
|
@ -23,11 +23,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754487366,
|
"lastModified": 1756770412,
|
||||||
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
|
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
|
"rev": "4524271976b625a4a605beefd893f270620fd751",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -38,11 +38,11 @@
|
||||||
},
|
},
|
||||||
"mnw": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1748710831,
|
"lastModified": 1756659871,
|
||||||
"narHash": "sha256-eZu2yH3Y2eA9DD3naKWy/sTxYS5rPK2hO7vj8tvUCSU=",
|
"narHash": "sha256-v6Rh4aQ6RKjM2N02kK9Usn0Ix7+OY66vNpeklc1MnGE=",
|
||||||
"owner": "Gerg-L",
|
"owner": "Gerg-L",
|
||||||
"repo": "mnw",
|
"repo": "mnw",
|
||||||
"rev": "cff958a4e050f8d917a6ff3a5624bc4681c6187d",
|
"rev": "ed6cc3e48557ba18266e598a5ebb6602499ada16",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -53,11 +53,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1755049066,
|
"lastModified": 1756696532,
|
||||||
"narHash": "sha256-ANrc15FSoOAdNbfKHxqEJjZLftIwIsenJGRb/04K41s=",
|
"narHash": "sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e45f8f193029378d0aaee5431ba098dc80054e9a",
|
"rev": "58dcbf1ec551914c3756c267b8b9c8c86baa1b2f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
pname = "avante-nvim-lib";
|
pname = "avante-nvim-lib";
|
||||||
inherit version src;
|
inherit version src;
|
||||||
|
|
||||||
cargoHash = "sha256-8mBpzndz34RrmhJYezd4hLrJyhVL4S4IHK3plaue1k8=";
|
cargoHash = "sha256-pTWCT2s820mjnfTscFnoSKC37RE7DAPKxP71QuM+JXQ=";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
|
@ -46,7 +46,7 @@ in {
|
||||||
capabilities = mkOption {
|
capabilities = mkOption {
|
||||||
type = nullOr (either luaInline (attrsOf anything));
|
type = nullOr (either luaInline (attrsOf anything));
|
||||||
default = null;
|
default = null;
|
||||||
description = "LSP capabilitiess to pass to lspconfig";
|
description = "LSP capabilities to pass to LSP server configuration";
|
||||||
};
|
};
|
||||||
|
|
||||||
on_attach = mkOption {
|
on_attach = mkOption {
|
||||||
|
@ -58,7 +58,7 @@ in {
|
||||||
filetypes = mkOption {
|
filetypes = mkOption {
|
||||||
type = nullOr (listOf str);
|
type = nullOr (listOf str);
|
||||||
default = null;
|
default = null;
|
||||||
description = "Filetypes to auto-attach LSP in";
|
description = "Filetypes to auto-attach LSP server in";
|
||||||
};
|
};
|
||||||
|
|
||||||
cmd = mkOption {
|
cmd = mkOption {
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
type = nullOr luaInline;
|
type = nullOr luaInline;
|
||||||
default = null;
|
default = null;
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
mkLuaInline '''
|
lib.generators.mkLuaInline '''
|
||||||
function()
|
function()
|
||||||
print("Saving a Lua file...")
|
print("Saving a Lua file...")
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames head;
|
inherit (builtins) attrNames head;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkDefault mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.types) enum;
|
inherit (lib.types) enum;
|
||||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||||
|
@ -27,11 +27,13 @@
|
||||||
dynamicRegistration = true;
|
dynamicRegistration = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
settings = {
|
settings = mkIf (yamlCfg.enable && yamlCfg.lsp.enable) {
|
||||||
helm-ls = {
|
helm-ls = {
|
||||||
yamlls = {
|
yamlls = {
|
||||||
# TODO: Determine if this is a good enough solution
|
# Without this being enabled, the YAML language module will look broken in helmfiles
|
||||||
path = (head yamlCfg.lsp.servers).cmd;
|
# if both modules are enabled at once.
|
||||||
|
enabled = mkDefault yamlCfg.lsp.enable;
|
||||||
|
path = head config.vim.lsp.servers.${head yamlCfg.lsp.servers}.cmd;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe getExe';
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.types) enum package bool;
|
inherit (lib.types) enum package bool;
|
||||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
servers = {
|
servers = {
|
||||||
pyright = {
|
pyright = {
|
||||||
enable = true;
|
enable = true;
|
||||||
cmd = [(getExe pkgs.pyright) "--stdio"];
|
cmd = [(getExe' pkgs.pyright "pyright-langserver") "--stdio"];
|
||||||
filetypes = ["python"];
|
filetypes = ["python"];
|
||||||
root_markers = [
|
root_markers = [
|
||||||
"pyproject.toml"
|
"pyproject.toml"
|
||||||
|
@ -42,18 +42,22 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr);
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||||
client:exec_cmd({
|
local params = {
|
||||||
command = 'pyright.organizeimports',
|
command = 'pyright.organizeimports',
|
||||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
arguments = { vim.uri_from_bufnr(bufnr) },
|
||||||
})
|
}
|
||||||
|
|
||||||
|
-- Using client.request() directly because "pyright.organizeimports" is private
|
||||||
|
-- (not advertised via capabilities), which client:exec_cmd() refuses to call.
|
||||||
|
-- https://github.com/neovim/neovim/blob/c333d64663d3b6e0dd9aa440e433d346af4a3d81/runtime/lua/vim/lsp/client.lua#L1024-L1030
|
||||||
|
client.request('workspace/executeCommand', params, nil, bufnr)
|
||||||
end, {
|
end, {
|
||||||
desc = 'Organize Imports',
|
desc = 'Organize Imports',
|
||||||
})
|
})
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', function(opts)
|
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
||||||
set_python_path('pyright', opts.args)
|
desc = 'Reconfigure basedpyright with the provided python path',
|
||||||
end, {
|
|
||||||
desc = 'Reconfigure pyright with the provided python path',
|
|
||||||
nargs = 1,
|
nargs = 1,
|
||||||
complete = 'file',
|
complete = 'file',
|
||||||
})
|
})
|
||||||
|
@ -63,7 +67,7 @@
|
||||||
|
|
||||||
basedpyright = {
|
basedpyright = {
|
||||||
enable = true;
|
enable = true;
|
||||||
cmd = [(getExe pkgs.basedpyright) "--stdio"];
|
cmd = [(getExe' pkgs.basedpyright "basedpyright-langserver") "--stdio"];
|
||||||
filetypes = ["python"];
|
filetypes = ["python"];
|
||||||
root_markers = [
|
root_markers = [
|
||||||
"pyproject.toml"
|
"pyproject.toml"
|
||||||
|
@ -85,18 +89,22 @@
|
||||||
};
|
};
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach(client, bufnr);
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||||
client:exec_cmd({
|
local params = {
|
||||||
command = 'basedpyright.organizeimports',
|
command = 'basedpyright.organizeimports',
|
||||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
arguments = { vim.uri_from_bufnr(bufnr) },
|
||||||
})
|
}
|
||||||
|
|
||||||
|
-- Using client.request() directly because "basedpyright.organizeimports" is private
|
||||||
|
-- (not advertised via capabilities), which client:exec_cmd() refuses to call.
|
||||||
|
-- https://github.com/neovim/neovim/blob/c333d64663d3b6e0dd9aa440e433d346af4a3d81/runtime/lua/vim/lsp/client.lua#L1024-L1030
|
||||||
|
client.request('workspace/executeCommand', params, nil, bufnr)
|
||||||
end, {
|
end, {
|
||||||
desc = 'Organize Imports',
|
desc = 'Organize Imports',
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', function(opts)
|
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
||||||
set_python_path('basedpyright', opts.args)
|
|
||||||
end, {
|
|
||||||
desc = 'Reconfigure basedpyright with the provided python path',
|
desc = 'Reconfigure basedpyright with the provided python path',
|
||||||
nargs = 1,
|
nargs = 1,
|
||||||
complete = 'file',
|
complete = 'file',
|
||||||
|
@ -301,7 +309,8 @@ in {
|
||||||
lua
|
lua
|
||||||
*/
|
*/
|
||||||
''
|
''
|
||||||
local function set_python_path(server_name, path)
|
local function set_python_path(server_name, command)
|
||||||
|
local path = command.args
|
||||||
local clients = vim.lsp.get_clients {
|
local clients = vim.lsp.get_clients {
|
||||||
bufnr = vim.api.nvim_get_current_buf(),
|
bufnr = vim.api.nvim_get_current_buf(),
|
||||||
name = server_name,
|
name = server_name,
|
||||||
|
@ -312,7 +321,7 @@ in {
|
||||||
else
|
else
|
||||||
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
|
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
|
||||||
end
|
end
|
||||||
client.notify('workspace/didChangeConfiguration', { settings = nil })
|
client:notify('workspace/didChangeConfiguration', { settings = nil })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
|
@ -14,16 +15,18 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.yaml;
|
cfg = config.vim.languages.yaml;
|
||||||
|
|
||||||
onAttach =
|
on_attach = mkLuaInline (
|
||||||
if config.vim.languages.helm.lsp.enable
|
if config.vim.languages.helm.lsp.enable && config.vim.languages.helm.enable
|
||||||
then ''
|
then ''
|
||||||
on_attach = function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach()
|
||||||
local filetype = vim.bo[bufnr].filetype
|
local filetype = vim.bo[bufnr].filetype
|
||||||
if filetype == "helm" then
|
if filetype == "helm" then
|
||||||
client.stop()
|
client.stop()
|
||||||
end
|
end
|
||||||
end''
|
end''
|
||||||
else "on_attach = default_on_attach";
|
else "default_on_attach"
|
||||||
|
);
|
||||||
|
|
||||||
defaultServers = ["yaml-language-server"];
|
defaultServers = ["yaml-language-server"];
|
||||||
servers = {
|
servers = {
|
||||||
|
@ -32,7 +35,7 @@
|
||||||
cmd = [(getExe pkgs.yaml-language-server) "--stdio"];
|
cmd = [(getExe pkgs.yaml-language-server) "--stdio"];
|
||||||
filetypes = ["yaml" "yaml.docker-compose" "yaml.gitlab" "yaml.helm-values"];
|
filetypes = ["yaml" "yaml.docker-compose" "yaml.gitlab" "yaml.helm-values"];
|
||||||
root_markers = [".git"];
|
root_markers = [".git"];
|
||||||
on_attach = onAttach;
|
inherit on_attach;
|
||||||
# -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting
|
# -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting
|
||||||
settings = {
|
settings = {
|
||||||
redhat = {
|
redhat = {
|
||||||
|
|
|
@ -15,7 +15,7 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [
|
startPlugins = [
|
||||||
"nvim-bufferline-lua"
|
"bufferline-nvim"
|
||||||
"bufdelete-nvim"
|
"bufdelete-nvim"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression literalMD;
|
||||||
inherit (lib.types) enum bool either nullOr str int listOf attrs;
|
inherit (lib.types) enum bool either nullOr str int listOf attrs;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
@ -24,17 +24,28 @@ in {
|
||||||
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
|
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
|
||||||
};
|
};
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "Bufferline-nvim" {
|
setupOpts = mkPluginSetupOption "bufferline-nvim" {
|
||||||
highlights = mkOption {
|
highlights = mkOption {
|
||||||
type = either attrs luaInline;
|
type = either attrs luaInline;
|
||||||
default =
|
default =
|
||||||
if config.vim.theme.enable && config.vim.theme.name == "catppuccin"
|
if config.vim.theme.enable && config.vim.theme.name == "catppuccin"
|
||||||
then
|
then
|
||||||
mkLuaInline
|
mkLuaInline ''
|
||||||
''
|
(function()
|
||||||
require("catppuccin.groups.integrations.bufferline").get()
|
local integration = require("catppuccin.groups.integrations.bufferline")
|
||||||
|
return (integration.get_theme or integration.get)()
|
||||||
|
end)()
|
||||||
''
|
''
|
||||||
else {};
|
else {};
|
||||||
|
defaultText = literalMD ''
|
||||||
|
```lua
|
||||||
|
(function()
|
||||||
|
local integration = require("catppuccin.groups.integrations.bufferline")
|
||||||
|
return (integration.get_theme or integration.get)()
|
||||||
|
end)()
|
||||||
|
```
|
||||||
|
if the active theme is Catppuccin, `{}` otherwise.
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Overrides the highlight groups of bufferline.
|
Overrides the highlight groups of bufferline.
|
||||||
|
|
||||||
|
@ -59,10 +70,11 @@ in {
|
||||||
themable = mkOption {
|
themable = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
example = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether or not to allow highlight groups to be overridden.
|
Whether or not to allow highlight groups to be overridden.
|
||||||
|
|
||||||
While false, bufferline.nvim sets highlights as default.
|
While `false`, bufferline.nvim sets highlights as default.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,9 @@ in {
|
||||||
require('catppuccin').setup {
|
require('catppuccin').setup {
|
||||||
flavour = "${style}",
|
flavour = "${style}",
|
||||||
transparent_background = ${boolToString transparent},
|
transparent_background = ${boolToString transparent},
|
||||||
|
float = {
|
||||||
|
transparent = ${boolToString transparent},
|
||||||
|
},
|
||||||
term_colors = true,
|
term_colors = true,
|
||||||
integrations = {
|
integrations = {
|
||||||
nvimtree = {
|
nvimtree = {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
./borders
|
./borders
|
||||||
./breadcrumbs
|
./breadcrumbs
|
||||||
./colorful-menu-nvim
|
./colorful-menu-nvim
|
||||||
|
./nvim-highlight-colors
|
||||||
./colorizer
|
./colorizer
|
||||||
./fastaction
|
./fastaction
|
||||||
./illuminate
|
./illuminate
|
||||||
|
|
28
modules/plugins/ui/nvim-highlight-colors/config.nix
Normal file
28
modules/plugins/ui/nvim-highlight-colors/config.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.ui.nvim-highlight-colors;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = [
|
||||||
|
"nvim-highlight-colors"
|
||||||
|
];
|
||||||
|
|
||||||
|
# enable display of 24-bit RGB colors in neovim
|
||||||
|
# via the terminal. This is required for nvim-highlight-colors
|
||||||
|
# to display arbitrary RGB highlights.
|
||||||
|
options.termguicolors = true;
|
||||||
|
|
||||||
|
pluginRC.nvim-highlight-colors = entryAnywhere ''
|
||||||
|
require('nvim-highlight-colors').setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/ui/nvim-highlight-colors/default.nix
Normal file
6
modules/plugins/ui/nvim-highlight-colors/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./nvim-highlight-colors.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) attrsOf enum nullOr submodule bool str;
|
||||||
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
inherit (lib.nvim.config) mkBool;
|
||||||
|
in {
|
||||||
|
options.vim.ui.nvim-highlight-colors = {
|
||||||
|
enable = mkEnableOption "color highlighting [nvim-highlight-colors.lua]";
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "nvim-highlight-colors" {
|
||||||
|
render = mkOption {
|
||||||
|
type = enum ["background" "foreground" "virtual"];
|
||||||
|
default = "background";
|
||||||
|
example = "virtual";
|
||||||
|
description = ''
|
||||||
|
Style to render color highlighting with.
|
||||||
|
|
||||||
|
::: {.note}
|
||||||
|
Each render style works as follows:
|
||||||
|
- 'background' sets the background
|
||||||
|
highlight of the matched color string
|
||||||
|
to the RGB color it describes.
|
||||||
|
|
||||||
|
- 'foreground' sets the foreground
|
||||||
|
highlight of the matched color string
|
||||||
|
to the RGB color it describes.
|
||||||
|
|
||||||
|
- 'virtual' displays the matched color
|
||||||
|
with virtual text alongside the color
|
||||||
|
string in the buffer. Virtual text can
|
||||||
|
be configured to display the color in
|
||||||
|
various ways, i.e custom virtual symbol
|
||||||
|
(via `virtual_symbol`) positioning
|
||||||
|
relative to string, suffix/prefix, etc.
|
||||||
|
:::
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual_symbol_position = mkOption {
|
||||||
|
type = enum ["inline" "eol" "eow"];
|
||||||
|
default = "inline";
|
||||||
|
example = "eol";
|
||||||
|
description = ''
|
||||||
|
Where to render the virtual symbol in
|
||||||
|
relation to the color string.
|
||||||
|
|
||||||
|
::: {.note}
|
||||||
|
Each render style works as follows:
|
||||||
|
- 'inline' render virtual text inline,
|
||||||
|
similar to the style of VSCode color
|
||||||
|
hinting.
|
||||||
|
|
||||||
|
- 'eol' render virtual text at the end
|
||||||
|
of the line which the color string
|
||||||
|
occurs (last column). Recommended to
|
||||||
|
set `virtual_symbol_suffix` to an
|
||||||
|
empty string when used.
|
||||||
|
|
||||||
|
- 'eow' render virtual text at the end
|
||||||
|
of the word where the color string
|
||||||
|
occurs. Recommended to set
|
||||||
|
`virtual_symbol_prefix` to a single
|
||||||
|
space for padding and the suffix to
|
||||||
|
an empty string for no padding.
|
||||||
|
:::
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -9,14 +9,16 @@ in {
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "image.nvim" {
|
setupOpts = mkPluginSetupOption "image.nvim" {
|
||||||
backend = mkOption {
|
backend = mkOption {
|
||||||
type = enum ["kitty" "ueberzug"];
|
type = enum ["kitty" "ueberzug" "sixel"];
|
||||||
default = "ueberzug";
|
default = "ueberzug";
|
||||||
description = ''
|
description = ''
|
||||||
The backend to use for rendering images.
|
The backend to use for rendering images.
|
||||||
|
|
||||||
- kitty - best in class, works great and is very snappy
|
* `kitty` - best in class, works great and is very snappy. Recommended
|
||||||
- ueberzug - backed by ueberzugpp, supports any terminal,
|
by upstream.
|
||||||
|
* `ueberzug` - backed by ueberzugpp, supports any terminal,
|
||||||
but has lower performance
|
but has lower performance
|
||||||
|
* `sixel` - uses the Sixel graphics protocol, widely supported by many terminals
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,7 @@
|
||||||
passthru.vimPlugin = false;
|
passthru.vimPlugin = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# build a vim plugin with the given name and arguments
|
# Build a Vim plugin with the given name and arguments.
|
||||||
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
|
||||||
# instead
|
|
||||||
buildPlug = attrs: let
|
buildPlug = attrs: let
|
||||||
pin = getPin attrs.pname;
|
pin = getPin attrs.pname;
|
||||||
in
|
in
|
||||||
|
@ -36,6 +34,7 @@
|
||||||
// attrs
|
// attrs
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# Build a given Treesitter grammar.
|
||||||
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
||||||
|
|
||||||
pluginBuilders = {
|
pluginBuilders = {
|
||||||
|
@ -48,6 +47,9 @@
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Get plugins built from source from self.packages
|
||||||
|
# If adding a new plugin to be built from source, it must also be inherited
|
||||||
|
# here.
|
||||||
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp avante-nvim;
|
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp avante-nvim;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,29 +73,38 @@
|
||||||
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
||||||
# generate a wrapped Neovim package.
|
# generate a wrapped Neovim package.
|
||||||
neovim-wrapped = inputs.mnw.lib.wrap {inherit pkgs;} {
|
neovim-wrapped = inputs.mnw.lib.wrap {inherit pkgs;} {
|
||||||
|
appName = "nvf";
|
||||||
neovim = config.vim.package;
|
neovim = config.vim.package;
|
||||||
|
initLua = config.vim.builtLuaConfigRC;
|
||||||
|
luaFiles = config.vim.extraLuaFiles;
|
||||||
|
|
||||||
|
# Plugin configurations
|
||||||
plugins = {
|
plugins = {
|
||||||
start = buildConfigPlugins config.vim.startPlugins;
|
start = buildConfigPlugins config.vim.startPlugins;
|
||||||
opt = buildConfigPlugins config.vim.optPlugins;
|
opt = buildConfigPlugins config.vim.optPlugins;
|
||||||
};
|
};
|
||||||
appName = "nvf";
|
|
||||||
extraBinPath = config.vim.extraPackages;
|
# Providers for Neovim
|
||||||
initLua = config.vim.builtLuaConfigRC;
|
|
||||||
luaFiles = config.vim.extraLuaFiles;
|
|
||||||
providers = {
|
providers = {
|
||||||
|
ruby.enable = config.vim.withRuby;
|
||||||
|
nodeJs.enable = config.vim.withNodeJs;
|
||||||
python3 = {
|
python3 = {
|
||||||
enable = config.vim.withPython3;
|
enable = config.vim.withPython3;
|
||||||
extraPackages = ps: map (flip builtins.getAttr ps) config.vim.python3Packages;
|
extraPackages = ps: map (flip builtins.getAttr ps) config.vim.python3Packages;
|
||||||
};
|
};
|
||||||
ruby.enable = config.vim.withRuby;
|
|
||||||
nodeJs.enable = config.vim.withNodeJs;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Aliases to link `nvim` to
|
||||||
aliases = lib.optional config.vim.viAlias "vi" ++ lib.optional config.vim.vimAlias "vim";
|
aliases = lib.optional config.vim.viAlias "vi" ++ lib.optional config.vim.vimAlias "vim";
|
||||||
|
|
||||||
|
# Additional packages or Lua packages to be made available to Neovim
|
||||||
|
extraBinPath = config.vim.extraPackages;
|
||||||
extraLuaPackages = ps: map (flip builtins.getAttr ps) config.vim.luaPackages;
|
extraLuaPackages = ps: map (flip builtins.getAttr ps) config.vim.luaPackages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# A store path representing the built Lua configuration.
|
||||||
dummyInit = pkgs.writeText "nvf-init.lua" config.vim.builtLuaConfigRC;
|
dummyInit = pkgs.writeText "nvf-init.lua" config.vim.builtLuaConfigRC;
|
||||||
|
|
||||||
# Additional helper scripts for printing and displaying nvf configuration
|
# Additional helper scripts for printing and displaying nvf configuration
|
||||||
# in your commandline.
|
# in your commandline.
|
||||||
printConfig = pkgs.writers.writeDashBin "nvf-print-config" "cat ${dummyInit}";
|
printConfig = pkgs.writers.writeDashBin "nvf-print-config" "cat ${dummyInit}";
|
||||||
|
@ -106,10 +117,20 @@
|
||||||
paths = [neovim-wrapped printConfig printConfigPath];
|
paths = [neovim-wrapped printConfig printConfigPath];
|
||||||
postBuild = "echo Helpers added";
|
postBuild = "echo Helpers added";
|
||||||
|
|
||||||
# Allow evaluating config.vim, i.e., config.vim from the packages' passthru
|
passthru = {
|
||||||
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
# Allow evaluating config.vim, i.e., config.vim from the packages' passthru
|
||||||
# will return the configuration in full.
|
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
||||||
passthru.neovimConfig = config.vim;
|
# will return the configuration in full.
|
||||||
|
neovimConfig = config.vim;
|
||||||
|
|
||||||
|
# Also expose the helper scripts in passthru.
|
||||||
|
nvfPrintConfig = printConfig;
|
||||||
|
nvfPrintConfigPath = printConfigPath;
|
||||||
|
|
||||||
|
# In systems where we only have a package and no module, this can be used
|
||||||
|
# to access the built init.lua
|
||||||
|
initLua = dummyInit;
|
||||||
|
};
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
neovim-wrapped.meta
|
neovim-wrapped.meta
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalMD;
|
inherit (lib.options) mkOption mkEnableOption literalMD literalExpression;
|
||||||
inherit (lib.types) package bool str listOf attrsOf;
|
inherit (lib.types) package bool str listOf attrsOf;
|
||||||
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
inherit (lib.nvim.types) pluginsOpt extraPluginType;
|
||||||
in {
|
in {
|
||||||
|
@ -11,6 +11,7 @@ in {
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
default = pkgs.neovim-unwrapped;
|
default = pkgs.neovim-unwrapped;
|
||||||
|
defaultText = literalExpression "pkgs.neovim-unwrapped";
|
||||||
description = ''
|
description = ''
|
||||||
The neovim package to use for the wrapper. This
|
The neovim package to use for the wrapper. This
|
||||||
corresponds to the package that will be wrapped
|
corresponds to the package that will be wrapped
|
||||||
|
@ -27,21 +28,20 @@ in {
|
||||||
viAlias = mkOption {
|
viAlias = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
example = false;
|
||||||
description = "Enable the `vi` alias for `nvim`";
|
description = "Enable the `vi` alias for `nvim`";
|
||||||
};
|
};
|
||||||
|
|
||||||
vimAlias = mkOption {
|
vimAlias = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
example = false;
|
||||||
description = "Enable the `vim` alias for `nvim`";
|
description = "Enable the `vim` alias for `nvim`";
|
||||||
};
|
};
|
||||||
|
|
||||||
startPlugins = pluginsOpt {
|
startPlugins = pluginsOpt {
|
||||||
default = ["plenary-nvim"];
|
default = ["plenary-nvim"];
|
||||||
example = ''
|
example = literalExpression "[pkgs.vimPlugins.telescope-nvim]";
|
||||||
[pkgs.vimPlugins.telescope-nvim]
|
|
||||||
'';
|
|
||||||
|
|
||||||
description = ''
|
description = ''
|
||||||
List of plugins to load on startup. This is used
|
List of plugins to load on startup. This is used
|
||||||
internally to add plugins to Neovim's runtime.
|
internally to add plugins to Neovim's runtime.
|
||||||
|
@ -54,9 +54,7 @@ in {
|
||||||
|
|
||||||
optPlugins = pluginsOpt {
|
optPlugins = pluginsOpt {
|
||||||
default = [];
|
default = [];
|
||||||
example = ''
|
example = literalExpression "[pkgs.vimPlugins.vim-ghost]";
|
||||||
[pkgs.vimPlugins.vim-ghost]
|
|
||||||
'';
|
|
||||||
description = ''
|
description = ''
|
||||||
List of plugins to optionally load on startup.
|
List of plugins to optionally load on startup.
|
||||||
|
|
||||||
|
@ -108,7 +106,7 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# this defaults to `true` in the wrapper
|
# This defaults to `true` in the wrapper
|
||||||
# and since we pass this value to the wrapper
|
# and since we pass this value to the wrapper
|
||||||
# with an inherit, it should be `true` here as well
|
# with an inherit, it should be `true` here as well
|
||||||
withRuby =
|
withRuby =
|
||||||
|
@ -120,14 +118,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
withNodeJs = mkEnableOption ''
|
withNodeJs = mkEnableOption ''
|
||||||
NodeJs support in the Neovim wrapper
|
NodeJS support in the Neovim wrapper
|
||||||
'';
|
'';
|
||||||
|
|
||||||
luaPackages = mkOption {
|
luaPackages = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
default = [];
|
default = [];
|
||||||
example = ''["magick" "serpent"]'';
|
example = ''["magick" "serpent"]'';
|
||||||
description = "List of lua packages to install";
|
description = "List of Lua packages to install";
|
||||||
};
|
};
|
||||||
|
|
||||||
withPython3 = mkEnableOption ''
|
withPython3 = mkEnableOption ''
|
||||||
|
@ -144,7 +142,7 @@ in {
|
||||||
pluginOverrides = mkOption {
|
pluginOverrides = mkOption {
|
||||||
type = attrsOf package;
|
type = attrsOf package;
|
||||||
default = {};
|
default = {};
|
||||||
example = ''
|
example = literalExpression ''
|
||||||
{
|
{
|
||||||
lazydev-nvim = pkgs.fetchFromGitHub {
|
lazydev-nvim = pkgs.fetchFromGitHub {
|
||||||
owner = "folke";
|
owner = "folke";
|
||||||
|
|
|
@ -145,7 +145,7 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
lazy.builtLazyConfig = ''
|
lazy.builtLazyConfig = ''
|
||||||
require('lz.n').load(${toLuaObject lznSpecs})
|
${optionalString (length lznSpecs > 0) "require('lz.n').load(${toLuaObject lznSpecs})"}
|
||||||
${optionalString cfg.enableLznAutoRequire "require('lzn-auto-require').enable()"}
|
${optionalString cfg.enableLznAutoRequire "require('lzn-auto-require').enable()"}
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue