mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 13:20:44 +00:00
Compare commits
7 commits
75b497efdd
...
69fb6ae7b8
Author | SHA1 | Date | |
---|---|---|---|
|
69fb6ae7b8 | ||
|
7a5c75b865 | ||
|
1df720f86c | ||
|
e39d469da9 | ||
|
947cf90878 | ||
|
a07e113f3a | ||
|
714ed755c5 |
8 changed files with 54 additions and 28 deletions
16
flake.nix
16
flake.nix
|
@ -21,6 +21,7 @@
|
|||
./flake/legacyPackages.nix
|
||||
./flake/overlays.nix
|
||||
./flake/packages.nix
|
||||
./flake/develop.nix
|
||||
];
|
||||
|
||||
flake = {
|
||||
|
@ -56,20 +57,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
perSystem = {
|
||||
self',
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
devShells = {
|
||||
default = self'.devShells.lsp;
|
||||
nvim-nix = pkgs.mkShell {packages = [config.packages.nix];};
|
||||
lsp = pkgs.mkShell {
|
||||
packages = with pkgs; [nil statix deadnix alejandra];
|
||||
};
|
||||
};
|
||||
|
||||
perSystem = {pkgs, ...}: {
|
||||
# Provide the default formatter. `nix fmt` in project root
|
||||
# will format available files with the correct formatter.
|
||||
# P.S: Please do not format with nixfmt! It messes with many
|
||||
|
|
30
flake/develop.nix
Normal file
30
flake/develop.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{lib, ...}: {
|
||||
perSystem = {
|
||||
pkgs,
|
||||
config,
|
||||
self',
|
||||
...
|
||||
}: {
|
||||
devShells = {
|
||||
default = self'.devShells.lsp;
|
||||
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
||||
lsp = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [nil statix deadnix alejandra];
|
||||
};
|
||||
};
|
||||
|
||||
# This package exists to make development easier by providing the place and
|
||||
# boilerplate to build a test nvf configuration. Feel free to use this for
|
||||
# testing, but make sure to discard the changes before creating a pull
|
||||
# request.
|
||||
packages.dev = let
|
||||
configuration = {};
|
||||
|
||||
customNeovim = lib.nvim.neovimConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [configuration];
|
||||
};
|
||||
in
|
||||
customNeovim.neovim;
|
||||
};
|
||||
}
|
|
@ -54,5 +54,10 @@ in {
|
|||
Nvf now uses $NVIM_APP_NAME so there is no longer the problem of
|
||||
(accidental) leaking of user configuration.
|
||||
'')
|
||||
|
||||
(mkRemovedOptionModule ["vim" "lsp" "trouble" "mappings" "toggle"] ''
|
||||
With Trouble having so many different modes, and breaking changes
|
||||
upstream, it no longer makes sense, nor works, to toggle only Trouble.
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (builtins) attrNames typeOf tryEval concatStringsSep;
|
||||
|
||||
borders = config.vim.ui.borders.plugins.nvim-cmp;
|
||||
|
||||
cfg = config.vim.autocomplete.nvim-cmp;
|
||||
luasnipEnable = config.vim.snippets.luasnip.enable;
|
||||
getPluginName = plugin:
|
||||
|
@ -81,10 +83,9 @@ in {
|
|||
setupOpts = {
|
||||
sources = map (s: {name = s;}) (attrNames cfg.sources);
|
||||
|
||||
# TODO: try to get nvim-cmp to follow global border style
|
||||
window = mkIf config.vim.ui.borders.enable {
|
||||
completion = mkLuaInline "cmp.config.window.bordered()";
|
||||
documentation = mkLuaInline "cmp.config.window.bordered()";
|
||||
window = mkIf borders.enable {
|
||||
completion.border = borders.style;
|
||||
documentation.border = borders.style;
|
||||
};
|
||||
|
||||
formatting.format = cfg.format;
|
||||
|
|
|
@ -72,7 +72,7 @@ in {
|
|||
};
|
||||
|
||||
format = mkOption {
|
||||
type = luaInline;
|
||||
type = nullOr luaInline;
|
||||
default = mkLuaInline ''
|
||||
function(entry, vim_item)
|
||||
vim_item.menu = (${toLuaObject cfg.sources})[entry.source.name]
|
||||
|
|
|
@ -21,19 +21,18 @@ in {
|
|||
|
||||
cmd = "Trouble";
|
||||
keys = [
|
||||
(mkSetLznBinding mappings.toggle "<cmd>TroubleToggle<CR>")
|
||||
(mkSetLznBinding mappings.workspaceDiagnostics "<cmd>TroubleToggle workspace_diagnostics<CR>")
|
||||
(mkSetLznBinding mappings.documentDiagnostics "<cmd>TroubleToggle document_diagnostics<CR>")
|
||||
(mkSetLznBinding mappings.lspReferences "<cmd>TroubleToggle lsp_references<CR>")
|
||||
(mkSetLznBinding mappings.quickfix "<cmd>TroubleToggle quickfix<CR>")
|
||||
(mkSetLznBinding mappings.locList "<cmd>TroubleToggle loclist<CR>")
|
||||
(mkSetLznBinding mappings.workspaceDiagnostics "<cmd>Trouble toggle diagnostics<CR>")
|
||||
(mkSetLznBinding mappings.documentDiagnostics "<cmd>Trouble toggle diagnostics filter.buf=0<CR>")
|
||||
(mkSetLznBinding mappings.lspReferences "<cmd>Trouble toggle lsp_references<CR>")
|
||||
(mkSetLznBinding mappings.quickfix "<cmd>Trouble toggle quickfix<CR>")
|
||||
(mkSetLznBinding mappings.locList "<cmd>Trouble toggle loclist<CR>")
|
||||
(mkSetLznBinding mappings.symbols "<cmd>Trouble toggle symbols<CR>")
|
||||
];
|
||||
};
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>l" = "Trouble";
|
||||
"<leader>x" = "+Trouble";
|
||||
"<leader>lw" = "Workspace";
|
||||
"<leader>lw" = "+Workspace";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -10,12 +10,12 @@ in {
|
|||
setupOpts = mkPluginSetupOption "Trouble" {};
|
||||
|
||||
mappings = {
|
||||
toggle = mkMappingOption "Toggle trouble [trouble]" "<leader>xx";
|
||||
workspaceDiagnostics = mkMappingOption "Workspace diagnostics [trouble]" "<leader>lwd";
|
||||
documentDiagnostics = mkMappingOption "Document diagnostics [trouble]" "<leader>ld";
|
||||
lspReferences = mkMappingOption "LSP References [trouble]" "<leader>lr";
|
||||
quickfix = mkMappingOption "QuickFix [trouble]" "<leader>xq";
|
||||
locList = mkMappingOption "LOCList [trouble]" "<leader>xl";
|
||||
symbols = mkMappingOption "Symbols [trouble]" "<leader>xs";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -93,6 +93,7 @@ in {
|
|||
setup = {
|
||||
style ? "dark",
|
||||
transparent ? false,
|
||||
...
|
||||
}: let
|
||||
style' =
|
||||
warnIf (style == "light") "oxocarbon: light theme is not well-supported" style;
|
||||
|
@ -117,6 +118,7 @@ in {
|
|||
setup = {
|
||||
style ? "dark",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
-- Gruvbox theme
|
||||
require("gruvbox").setup({
|
||||
|
@ -152,6 +154,7 @@ in {
|
|||
setup = {
|
||||
style ? "main",
|
||||
transparent ? false,
|
||||
...
|
||||
}: ''
|
||||
require("rose-pine").setup({
|
||||
dark_variant = "${style}", -- main, moon, or dawn
|
||||
|
|
Loading…
Reference in a new issue