mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-18 16:18:39 +00:00
Compare commits
No commits in common. "79993c71d88d7bfafc1ae029bd9621cd74e1529d" and "815ed49d3693346122ef61da6d7443cd3cc21752" have entirely different histories.
79993c71d8
...
815ed49d36
7 changed files with 11 additions and 133 deletions
|
|
@ -19,11 +19,6 @@
|
||||||
unavailable as they have been refactored out of the main none-ls repository
|
unavailable as they have been refactored out of the main none-ls repository
|
||||||
upstream.
|
upstream.
|
||||||
|
|
||||||
- `vim.useSystemClipboard` has been deprecated as a part of removing most
|
|
||||||
top-level convenience options, and should instead be configured in the new
|
|
||||||
module interface. You may set [](#opt-vim.clipboard.registers) appropriately
|
|
||||||
to configure Neovim to use the system clipboard.
|
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
[NotAShelf](https://github.com/notashelf):
|
||||||
|
|
||||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
||||||
|
|
@ -96,11 +91,6 @@
|
||||||
options for `vim.diagnostic.config()` can now be customized through the
|
options for `vim.diagnostic.config()` can now be customized through the
|
||||||
[](#opt-vim.diagnostics.config) in nvf.
|
[](#opt-vim.diagnostics.config) in nvf.
|
||||||
|
|
||||||
- Add `vim.clipboard` module for easily managing Neovim clipboard providers and
|
|
||||||
relevant packages in a simple UI.
|
|
||||||
- This deprecates `vim.useSystemClipboard` as well, see breaking changes
|
|
||||||
section above for migration options.
|
|
||||||
|
|
||||||
[amadaluzia](https://github.com/amadaluzia):
|
[amadaluzia](https://github.com/amadaluzia):
|
||||||
|
|
||||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||||
|
|
@ -387,8 +377,3 @@
|
||||||
- Add missing `right_align` option for existing `renderer.icons` options.
|
- Add missing `right_align` option for existing `renderer.icons` options.
|
||||||
- Add missing `render.icons` options (`hidden_placement`,
|
- Add missing `render.icons` options (`hidden_placement`,
|
||||||
`diagnostics_placement`, and `bookmarks_placement`).
|
`diagnostics_placement`, and `bookmarks_placement`).
|
||||||
|
|
||||||
[cramt](https://github.com/cramt):
|
|
||||||
|
|
||||||
- Add `rubylsp` option in `vim.languages.ruby.lsp.server` to use shopify's
|
|
||||||
ruby-lsp language server
|
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
hash = "sha256-bKe8SSg1HPWE7b4iRQJwiOVCrvvgttuHCOIa4U/38AY=";
|
hash = "sha256-bKe8SSg1HPWE7b4iRQJwiOVCrvvgttuHCOIa4U/38AY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
forceShare = [
|
|
||||||
"man"
|
|
||||||
"info"
|
|
||||||
];
|
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
cp -r {lua,plugin} "$out"
|
cp -r {lua,plugin} "$out"
|
||||||
mkdir -p "$out/doc"
|
|
||||||
cp 'doc/'*'.txt' "$out/doc/"
|
|
||||||
mkdir -p "$out/target"
|
mkdir -p "$out/target"
|
||||||
mv "$out/lib" "$out/target/release"
|
mv "$out/lib" "$out/target/release"
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -111,15 +111,6 @@ in {
|
||||||
under the diagnostics module. Please consider using one of 'vim.diagnostics.config' or
|
under the diagnostics module. Please consider using one of 'vim.diagnostics.config' or
|
||||||
'vim.luaConfigRC' to configure LSP lines for Neovim through its own diagnostics API.
|
'vim.luaConfigRC' to configure LSP lines for Neovim through its own diagnostics API.
|
||||||
'')
|
'')
|
||||||
|
|
||||||
# 2025-05-04
|
|
||||||
(mkRemovedOptionModule ["vim" "useSystemClipboard"] ''
|
|
||||||
Clipboard behaviour should now be controlled through the new, more fine-grained module
|
|
||||||
interface found in 'vim.clipboard'. To replicate previous behaviour, you may either
|
|
||||||
add 'vim.opt.clipboard:append("unnamedplus")' in luaConfigRC, or preferably set it
|
|
||||||
in 'vim.clipboard.registers'. Please see the documentation for the new module for more
|
|
||||||
details, or open an issue if you are confused.
|
|
||||||
'')
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,12 @@ in {
|
||||||
description = "Enable syntax highlighting";
|
description = "Enable syntax highlighting";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useSystemClipboard = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = "Make use of the clipboard for default yank and paste operations. Don't use * and +";
|
||||||
|
};
|
||||||
|
|
||||||
lineNumberMode = mkOption {
|
lineNumberMode = mkOption {
|
||||||
type = enum ["relative" "number" "relNumber" "none"];
|
type = enum ["relative" "number" "relNumber" "none"];
|
||||||
default = "relNumber";
|
default = "relNumber";
|
||||||
|
|
@ -138,6 +144,10 @@ in {
|
||||||
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
|
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
|
||||||
# could be.
|
# could be.
|
||||||
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
luaConfigRC.basic = entryAfter ["globalsScript"] ''
|
||||||
|
${optionalString cfg.useSystemClipboard ''
|
||||||
|
vim.opt.clipboard:append("unnamedplus")
|
||||||
|
''}
|
||||||
|
|
||||||
${optionalString cfg.syntaxHighlighting ''
|
${optionalString cfg.syntaxHighlighting ''
|
||||||
vim.cmd("syntax on")
|
vim.cmd("syntax on")
|
||||||
''}
|
''}
|
||||||
|
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkIf;
|
|
||||||
inherit (lib.options) mkOption mkEnableOption mkPackageOption;
|
|
||||||
inherit (lib.types) nullOr either str listOf submodule;
|
|
||||||
inherit (lib.attrsets) mapAttrs mapAttrsToList filterAttrs;
|
|
||||||
cfg = config.vim.clipboard;
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
vim = {
|
|
||||||
clipboard = {
|
|
||||||
enable = mkEnableOption ''
|
|
||||||
clipboard management for Neovim. Users may still choose to manage their
|
|
||||||
clipboard through [](#opt-vim.options) should they wish to avoid using
|
|
||||||
this module.
|
|
||||||
'';
|
|
||||||
|
|
||||||
registers = mkOption {
|
|
||||||
type = either str (listOf str);
|
|
||||||
default = "";
|
|
||||||
example = "unnamedplus";
|
|
||||||
description = ''
|
|
||||||
The register to be used by the Neovim clipboard. Recognized types are:
|
|
||||||
|
|
||||||
* unnamed: Vim will use the clipboard register `"*"` for all yank, delete,
|
|
||||||
change and put operations which would normally go to the unnamed register.
|
|
||||||
|
|
||||||
* unnamedplus: A variant of the "unnamed" flag which uses the clipboard register
|
|
||||||
`"+"` ({command}`:h quoteplus`) instead of register `"*"` for all yank, delete,
|
|
||||||
change and put operations which would normally go to the unnamed register.
|
|
||||||
|
|
||||||
When `unnamed` and `unnamedplus` is included simultaneously yank and delete
|
|
||||||
operations (but not put) will additionally copy the text into register `"*"`.
|
|
||||||
|
|
||||||
Please see {command}`:h clipboard` for more details.
|
|
||||||
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
providers = mkOption {
|
|
||||||
type = submodule {
|
|
||||||
options = let
|
|
||||||
clipboards = {
|
|
||||||
# name = "package name";
|
|
||||||
wl-copy = "wl-clipboard";
|
|
||||||
xclip = "xclip";
|
|
||||||
xsel = "xsel";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
mapAttrs (name: pname: {
|
|
||||||
enable = mkEnableOption name;
|
|
||||||
package = mkPackageOption pkgs pname {nullable = true;};
|
|
||||||
})
|
|
||||||
clipboards;
|
|
||||||
};
|
|
||||||
default = {};
|
|
||||||
description = ''
|
|
||||||
Clipboard providers for which packages will be added to nvf's
|
|
||||||
{option}`extraPackages`. The `package` field may be set to `null`
|
|
||||||
if related packages are already found in system packages to
|
|
||||||
potentially reduce closure sizes.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
vim = {
|
|
||||||
options.clipboard = cfg.registers;
|
|
||||||
extraPackages = mapAttrsToList (_: v: v.package) (
|
|
||||||
filterAttrs (_: v: v.enable && v.package != null) cfg.providers
|
|
||||||
);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./autocmds.nix
|
./autocmds.nix
|
||||||
./basic.nix
|
./basic.nix
|
||||||
./clipboard.nix
|
|
||||||
./debug.nix
|
./debug.nix
|
||||||
./diagnostics.nix
|
./diagnostics.nix
|
||||||
./highlight.nix
|
./highlight.nix
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
inherit (lib.nvim.types) mkGrammarOption diagnostics;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
|
||||||
inherit (lib.lists) isList;
|
|
||||||
inherit (lib.types) either listOf package str enum;
|
inherit (lib.types) either listOf package str enum;
|
||||||
|
|
||||||
cfg = config.vim.languages.ruby;
|
cfg = config.vim.languages.ruby;
|
||||||
|
|
@ -26,25 +24,7 @@
|
||||||
flags = {
|
flags = {
|
||||||
debounce_text_changes = 150,
|
debounce_text_changes = 150,
|
||||||
},
|
},
|
||||||
cmd = ${
|
cmd = { "${pkgs.solargraph}/bin/solargraph", "stdio" }
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{ "${cfg.lsp.package}/bin/solargraph", "stdio" }''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
rubylsp = {
|
|
||||||
package = pkgs.ruby-lsp;
|
|
||||||
lspConfig = ''
|
|
||||||
lspconfig.ruby_lsp.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = default_on_attach,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{ "${cfg.lsp.package}/bin/ruby-lsp" }''
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue