mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-10-02 15:03:32 +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
|
@ -6,7 +6,7 @@
|
|||
}: let
|
||||
inherit (builtins) attrNames head;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.modules) mkDefault mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||
|
@ -27,11 +27,13 @@
|
|||
dynamicRegistration = true;
|
||||
};
|
||||
};
|
||||
settings = {
|
||||
settings = mkIf (yamlCfg.enable && yamlCfg.lsp.enable) {
|
||||
helm-ls = {
|
||||
yamlls = {
|
||||
# TODO: Determine if this is a good enough solution
|
||||
path = (head yamlCfg.lsp.servers).cmd;
|
||||
# Without this being enabled, the YAML language module will look broken in helmfiles
|
||||
# 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
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.meta) getExe getExe';
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package bool;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
@ -20,7 +20,7 @@
|
|||
servers = {
|
||||
pyright = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.pyright) "--stdio"];
|
||||
cmd = [(getExe' pkgs.pyright "pyright-langserver") "--stdio"];
|
||||
filetypes = ["python"];
|
||||
root_markers = [
|
||||
"pyproject.toml"
|
||||
|
@ -42,18 +42,22 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr);
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||
client:exec_cmd({
|
||||
local params = {
|
||||
command = 'pyright.organizeimports',
|
||||
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, {
|
||||
desc = 'Organize Imports',
|
||||
})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', function(opts)
|
||||
set_python_path('pyright', opts.args)
|
||||
end, {
|
||||
desc = 'Reconfigure pyright with the provided python path',
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
||||
desc = 'Reconfigure basedpyright with the provided python path',
|
||||
nargs = 1,
|
||||
complete = 'file',
|
||||
})
|
||||
|
@ -63,7 +67,7 @@
|
|||
|
||||
basedpyright = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.basedpyright) "--stdio"];
|
||||
cmd = [(getExe' pkgs.basedpyright "basedpyright-langserver") "--stdio"];
|
||||
filetypes = ["python"];
|
||||
root_markers = [
|
||||
"pyproject.toml"
|
||||
|
@ -85,18 +89,22 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr);
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||
client:exec_cmd({
|
||||
local params = {
|
||||
command = 'basedpyright.organizeimports',
|
||||
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, {
|
||||
desc = 'Organize Imports',
|
||||
})
|
||||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', function(opts)
|
||||
set_python_path('basedpyright', opts.args)
|
||||
end, {
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
||||
desc = 'Reconfigure basedpyright with the provided python path',
|
||||
nargs = 1,
|
||||
complete = 'file',
|
||||
|
@ -301,7 +309,8 @@ in {
|
|||
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 {
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
name = server_name,
|
||||
|
@ -312,7 +321,7 @@ in {
|
|||
else
|
||||
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
|
||||
end
|
||||
client.notify('workspace/didChangeConfiguration', { settings = nil })
|
||||
client:notify('workspace/didChangeConfiguration', { settings = nil })
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
|
@ -14,16 +15,18 @@
|
|||
|
||||
cfg = config.vim.languages.yaml;
|
||||
|
||||
onAttach =
|
||||
if config.vim.languages.helm.lsp.enable
|
||||
on_attach = mkLuaInline (
|
||||
if config.vim.languages.helm.lsp.enable && config.vim.languages.helm.enable
|
||||
then ''
|
||||
on_attach = function(client, bufnr)
|
||||
function(client, bufnr)
|
||||
default_on_attach()
|
||||
local filetype = vim.bo[bufnr].filetype
|
||||
if filetype == "helm" then
|
||||
client.stop()
|
||||
end
|
||||
end''
|
||||
else "on_attach = default_on_attach";
|
||||
else "default_on_attach"
|
||||
);
|
||||
|
||||
defaultServers = ["yaml-language-server"];
|
||||
servers = {
|
||||
|
@ -32,7 +35,7 @@
|
|||
cmd = [(getExe pkgs.yaml-language-server) "--stdio"];
|
||||
filetypes = ["yaml" "yaml.docker-compose" "yaml.gitlab" "yaml.helm-values"];
|
||||
root_markers = [".git"];
|
||||
on_attach = onAttach;
|
||||
inherit on_attach;
|
||||
# -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting
|
||||
settings = {
|
||||
redhat = {
|
||||
|
|
|
@ -15,7 +15,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"nvim-bufferline-lua"
|
||||
"bufferline-nvim"
|
||||
"bufdelete-nvim"
|
||||
];
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: 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.generators) mkLuaInline;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
|
@ -24,17 +24,28 @@ in {
|
|||
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
|
||||
};
|
||||
|
||||
setupOpts = mkPluginSetupOption "Bufferline-nvim" {
|
||||
setupOpts = mkPluginSetupOption "bufferline-nvim" {
|
||||
highlights = mkOption {
|
||||
type = either attrs luaInline;
|
||||
default =
|
||||
if config.vim.theme.enable && config.vim.theme.name == "catppuccin"
|
||||
then
|
||||
mkLuaInline
|
||||
''
|
||||
require("catppuccin.groups.integrations.bufferline").get()
|
||||
mkLuaInline ''
|
||||
(function()
|
||||
local integration = require("catppuccin.groups.integrations.bufferline")
|
||||
return (integration.get_theme or integration.get)()
|
||||
end)()
|
||||
''
|
||||
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 = ''
|
||||
Overrides the highlight groups of bufferline.
|
||||
|
||||
|
@ -59,10 +70,11 @@ in {
|
|||
themable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
example = false;
|
||||
description = ''
|
||||
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 {
|
||||
flavour = "${style}",
|
||||
transparent_background = ${boolToString transparent},
|
||||
float = {
|
||||
transparent = ${boolToString transparent},
|
||||
},
|
||||
term_colors = true,
|
||||
integrations = {
|
||||
nvimtree = {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
./borders
|
||||
./breadcrumbs
|
||||
./colorful-menu-nvim
|
||||
./nvim-highlight-colors
|
||||
./colorizer
|
||||
./fastaction
|
||||
./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" {
|
||||
backend = mkOption {
|
||||
type = enum ["kitty" "ueberzug"];
|
||||
type = enum ["kitty" "ueberzug" "sixel"];
|
||||
default = "ueberzug";
|
||||
description = ''
|
||||
The backend to use for rendering images.
|
||||
|
||||
- kitty - best in class, works great and is very snappy
|
||||
- ueberzug - backed by ueberzugpp, supports any terminal,
|
||||
* `kitty` - best in class, works great and is very snappy. Recommended
|
||||
by upstream.
|
||||
* `ueberzug` - backed by ueberzugpp, supports any terminal,
|
||||
but has lower performance
|
||||
* `sixel` - uses the Sixel graphics protocol, widely supported by many terminals
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue