feat: nvim

This commit is contained in:
2025-11-20 11:06:28 +01:00
parent 674daa80d1
commit f530957112
7 changed files with 100 additions and 115 deletions

View File

@@ -41,6 +41,15 @@ sudo nixos-rebuild switch --flake .#
## Cleaning your system
### Cachix is down
By default nix will just crash if cachix is down even if you don't have to fetch anything from it.
Use `--option build-use-substitutes false` to temporarily disable it.
```sh
sudo nixos-rebuild switch --option build-use-substitutes false --flake .#
```
### Find (accidental) folders holding your gc back
```sh

View File

@@ -0,0 +1,51 @@
{ lib, config, ... }:
let
cfg = config.presets.base.leap;
in
{
options.presets.base.leap = {
enable = lib.mkEnableOption "leap";
};
config = lib.mkIf cfg.enable {
plugins.leap.enable = true;
keymaps = [
{
key = "s";
mode = [
"n"
"x"
"o"
];
action.__raw = ''
function()
require('leap').leap({
windows = { vim.api.nvim_get_current_win() },
inclusive = true
})
end
'';
options.desc = "Leap";
}
{
key = "R";
mode = [
"x"
"o"
];
action.__raw = ''
function ()
require('leap.treesitter').select {
-- To increase/decrease the selection in a clever-f-like manner,
-- with the trigger key itself (vRRRRrr...). The default keys
-- (<enter>/<backspace>) also work, so feel free to skip this.
opts = require('leap.user').with_traversal_keys('R', 'r')
}
end
'';
}
];
};
}

View File

@@ -26,6 +26,7 @@
./base/diagnostics.nix
./base/find.nix
./base/formatting.nix
./base/leap.nix
./base/spellcheck.nix
./base/status-line.nix
./base/syntax.nix
@@ -34,6 +35,7 @@
./languages/angular.nix
./languages/c.nix
./languages/css.nix
./languages/cue.nix
./languages/dart.nix
./languages/js.nix
./languages/lua.nix

View File

@@ -0,0 +1,16 @@
{ lib, config, ... }:
let
cfg = config.presets.languages.cue;
in
{
options.presets.languages.cue = {
enable = lib.mkEnableOption "CUE";
};
config = lib.mkIf cfg.enable {
plugins = {
conform-nvim.settings.formatters_by_ft.cue = [ "cue_fmt" ];
lsp.servers.cue.enable = true;
};
};
}

View File

@@ -9,7 +9,7 @@ in
config = lib.mkIf cfg.enable {
plugins = {
conform-nvim.settings.formattters_by_ft.rust = [ "rustfmt" ];
conform-nvim.settings.formatters_by_ft.rust = [ "rustfmt" ];
lsp.servers.rust_analyzer = {
enable = true;
installCargo = false;

View File

@@ -53,6 +53,7 @@
enable = true;
prettier = true;
};
leap.enable = true;
spellcheck.enable = true;
status-line.enable = true;
syntax.enable = true;
@@ -64,6 +65,7 @@
enable = true;
stylelint = true;
};
cue.enable = true;
dart.enable = true;
js = {
enable = true;
@@ -85,92 +87,6 @@
};
};
/*
keymaps = [
{
key = "s";
mode = [
"n"
"x"
"o"
];
action.__raw = "function() require('flash').jump() end";
options.desc = "Flash";
}
{
key = "S";
mode = [
"n"
"x"
"o"
];
action.__raw = "function() require('flash').treesitter() end";
options.desc = "Flash Treesitter";
}
{
key = "r";
mode = "o";
action.__raw = "function() require('flash').remote() end";
options.desc = "Remote Flash";
}
{
key = "R";
mode = [
"o"
"x"
];
action.__raw = "function() require('flash').treesitter_search() end";
options.desc = "Treesitter Search";
}
{
key = "<c-s>";
mode = [
"c"
];
action.__raw = "function() require('flash').toggle() end";
options.desc = "Toggle Flash Search";
}
];
vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)')
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)')
*/
keymaps = [
{
key = "s";
mode = [
"n"
"x"
"o"
];
action.__raw = ''
function()
require('leap').leap({
windows = { vim.api.nvim_get_current_win() },
inclusive = true
})
end
'';
options.desc = "Leap";
}
{
key = "R";
mode = [
"x"
"o"
];
action.__raw = ''
function ()
require('leap.treesitter').select {
-- To increase/decrease the selection in a clever-f-like manner,
-- with the trigger key itself (vRRRRrr...). The default keys
-- (<enter>/<backspace>) also work, so feel free to skip this.
opts = require('leap.user').with_traversal_keys('R', 'r')
}
end
'';
}
];
plugins = {
which-key.enable = true;
schemastore.enable = true;
@@ -178,24 +94,6 @@
origami.enable = false;
nvim-surround.enable = true;
fidget.enable = true;
leap = {
enable = true;
};
/*
flash = {
enable = true;
settings = {
label = {
exclude = "jJxXqQ";
rainbow.enabled = true;
};
search = {
mode = "exact";
trigger = ";";
};
};
};
*/
treesitter-context = {
enable = false; # TODO: looks weird with Neovide
settings.line_numbers = false;
@@ -207,7 +105,18 @@
dockerls.enable = true;
yamlls.enable = true;
yamlls = {
enable = true;
settings.customTags = [
"!if mapping"
"!any sequence"
"!not scalar"
"!flat sequence"
"!repeat mapping"
"!param scalar"
"!macro mapping"
];
};
jsonls.enable = true;
taplo.enable = true;
};

View File

@@ -31,15 +31,13 @@ in
cubyz-bin
oversteer
obs-studio
/*
(lutris.override {
extraLibraries =
pkgs: with pkgs; [
libgudev
libvdpau
];
})
*/
(lutris.override {
extraLibraries =
pkgs: with pkgs; [
libgudev
libvdpau
];
})
# rpcs3
bottles
wineWow64Packages.stagingFull