Compare commits

..

1 Commits

Author SHA1 Message Date
0ed7a50359 vim: fix copilot plugin name 2026-02-10 21:27:25 +01:00
6 changed files with 199 additions and 247 deletions

View File

@@ -34,13 +34,10 @@
overlays.default = final: prev: {
niphas-terminal = prev.alacritty;
niphas-web-browser = prev.firefox;
niphas-web-browser = prev.qutebrowser;
niphas-file-browser = prev.pcmanfm;
niphas-runner = prev.writers.writeDashBin "niphas-runner" "${prev.lib.getExe prev.rofi} -show run";
niphas-locker = prev.swaylock;
niphas-screenshot = prev.writers.writeDashBin "niphas-screenshot" ''
${prev.lib.getExe prev.grim} -g "$(${prev.lib.getExe prev.slurp})" - | ${prev.lib.getExe prev.satty} -f -
'';
niphas-editor = prev.lib.makeOverridable (prev.callPackage packages/vim) { };
niphas-bar = import packages/ashell.nix {
@@ -68,28 +65,6 @@
niphas-set-wallpaper = prev.writers.writeDashBin "niphas-set-wallpaper" ''
exec ${lib.getExe prev.swaybg} --mode fill --image ${toString final.niphas-wallpaper}
'';
niphas-clipboard-watcher = prev.writers.writeDashBin "niphas-clipboard-watcher" ''
exec ${lib.getExe' prev.wl-clipboard "wl-paste"} -t text --watch ${lib.getExe prev.clipman} store
'';
niphas-clipman = prev.writers.writeDashBin "niphas-clipman" ''
exec ${lib.getExe prev.clipman} pick --tool rofi
'';
niphas-redshift =
let
geolocation = [
52.5244
13.4105
];
latitude = builtins.elemAt geolocation 0;
longitude = builtins.elemAt geolocation 1;
in
prev.writers.writeDashBin "niphas-redshift" ''
exec ${lib.getExe prev.wlsunset} -l ${toString latitude} -L ${toString longitude}
'';
vimv = prev.callPackage packages/vimv.nix { };
};
@@ -107,11 +82,6 @@
niphas-git
niphas-niri
niphas-editor
niphas-wallpaper
niphas-set-wallpaper
niphas-clipboard-watcher
niphas-clipman
niphas-redshift
vimv
;
}

View File

@@ -28,7 +28,6 @@
pkgs.wdisplays
pkgs.nsxiv
pkgs.xdg-desktop-portal
pkgs.clipman
pkgs.xdg-desktop-portal-gnome
pkgs.rofi # to provide rofi-sensible-terminal
@@ -38,9 +37,6 @@
pkgs.niphas-terminal
pkgs.niphas-web-browser
pkgs.niphas-set-wallpaper
pkgs.niphas-redshift
pkgs.niphas-screenshot
pkgs.niphas-clipboard-watcher
pkgs.niphas-runner
pkgs.niphas-locker
];

View File

@@ -1,6 +1,11 @@
{
wrappers,
pkgs,
screenshotPath ? null,
geolocation ? [
52.5244
13.4105
],
}:
let
lib = pkgs.lib;
@@ -12,150 +17,169 @@ let
niri = wrappers.wrapperModules.niri.apply {
inherit pkgs;
settings = builtins.foldl' lib.recursiveUpdate { } ([
{
input = {
keyboard = {
xkb.layout = "de";
xkb.variant = "T3";
xkb.options = "compose:caps";
numlock = null;
settings = builtins.foldl' lib.recursiveUpdate { } (
[
{
input = {
keyboard = {
xkb.layout = "de";
numlock = null;
};
touchpad = {
tap = null;
drag = true;
};
mouse = null;
trackpoint = null;
warp-mouse-to-focus = null;
focus-follows-mouse = null;
};
touchpad = {
tap = null;
drag = true;
layout = {
gaps = 8;
center-focused-column = "never";
preset-column-widths = [
{ proportion = 1. / 3.; }
{ proportion = 1. / 2.; }
{ proportion = 2. / 3.; }
];
default-column-width = {
proportion = 1. / 2.;
};
focus-ring = {
width = 2;
active-color = colors.active-color;
inactive-color = colors.inactive-color;
};
shadow = {
on = null;
draw-behind-window = true;
softness = 30;
spread = 5;
color = colors.shadow-color;
};
};
mouse = null;
trackpoint = null;
warp-mouse-to-focus = null;
focus-follows-mouse = null;
};
layout = {
gaps = 8;
center-focused-column = "never";
preset-column-widths = [
{ proportion = 1. / 3.; }
{ proportion = 1. / 2.; }
{ proportion = 2. / 3.; }
];
default-column-width = {
proportion = 1. / 2.;
spawn-at-startup = [
(lib.getExe pkgs.niphas-bar)
(lib.getExe pkgs.niphas-set-wallpaper)
]
++ lib.optional (geolocation != null) (
let
latitude = builtins.elemAt geolocation 0;
longitude = builtins.elemAt geolocation 1;
in
[
(lib.getExe pkgs.wlsunset)
"-l"
(toString latitude)
"-L"
(toString longitude)
]
);
hotkey-overlay.skip-at-startup = null;
prefer-no-csd = null;
animations.slowdown = 0.5; # twice as fast
binds =
let
wpctl = lib.getExe' pkgs.wireplumber "wpctl";
in
{
"Mod+Shift+Slash".show-hotkey-overlay = null;
"Mod+Y".spawn = lib.getExe pkgs.niphas-web-browser;
"Mod+T".spawn = lib.getExe pkgs.niphas-file-browser;
"Mod+Return".spawn = lib.getExe pkgs.niphas-terminal;
"Mod+D".spawn = lib.getExe pkgs.niphas-runner;
"Mod+Shift+W".spawn = lib.getExe pkgs.niphas-locker;
# TODO allow-when-locked
"XF86AudioRaiseVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0";
"XF86AudioLowerVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
"XF86AudioMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
"XF86AudioMicMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
"XF86AudioPlay".spawn-sh = "${lib.getExe pkgs.playerctl} play-pause";
"XF86AudioStop".spawn-sh = "${lib.getExe pkgs.playerctl} stop";
"XF86AudioPrev".spawn-sh = "${lib.getExe pkgs.playerctl} previous";
"XF86AudioNext".spawn-sh = "${lib.getExe pkgs.playerctl} next";
"XF86MonBrightnessUp".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set +25%";
"XF86MonBrightnessDown".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set 25%-";
# TODO repeat=false
"Mod+O".toggle-overview = null;
"Mod+Shift+Q".close-window = null;
"Mod+H".focus-column-left = null;
"Mod+J".focus-window-or-workspace-down = null;
"Mod+K".focus-window-or-workspace-up = null;
"Mod+L".focus-column-right = null;
"Mod+Shift+H".move-column-left = null;
"Mod+Shift+J".move-window-down-or-to-workspace-down = null;
"Mod+Shift+K".move-window-up-or-to-workspace-up = null;
"Mod+Shift+L".move-column-right = null;
"Mod+Home".focus-column-first = null;
"Mod+End".focus-column-last = null;
"Mod+Shift+Home".move-column-to-first = null;
"Mod+Shift+End".move-column-to-last = null;
# TODO cooldown-ms=150
"Mod+WheelScrollDown".focus-workspace-down = null;
"Mod+WheelScrollUp".focus-workspace-up = null;
"Mod+Shift+WheelScrollDown".move-column-to-workspace-down = null;
"Mod+Shift+WheelScrollUp".move-column-to-workspace-up = null;
"Mod+WheelScrollRight".focus-column-right = null;
"Mod+WheelScrollLeft".focus-column-left = null;
"Mod+Shift+WheelScrollRight".move-column-right = null;
"Mod+Shift+WheelScrollLeft".move-column-left = null;
"Mod+1".focus-workspace = 1;
"Mod+2".focus-workspace = 2;
"Mod+3".focus-workspace = 3;
"Mod+4".focus-workspace = 4;
"Mod+5".focus-workspace = 5;
"Mod+6".focus-workspace = 6;
"Mod+7".focus-workspace = 7;
"Mod+8".focus-workspace = 8;
"Mod+9".focus-workspace = 9;
"Mod+Shift+1".move-window-to-workspace = 1;
"Mod+Shift+2".move-window-to-workspace = 2;
"Mod+Shift+3".move-window-to-workspace = 3;
"Mod+Shift+4".move-window-to-workspace = 4;
"Mod+Shift+5".move-window-to-workspace = 5;
"Mod+Shift+6".move-window-to-workspace = 6;
"Mod+Shift+7".move-window-to-workspace = 7;
"Mod+Shift+8".move-window-to-workspace = 8;
"Mod+Shift+9".move-window-to-workspace = 9;
"Mod+Tab".focus-workspace-previous = null;
"Mod+Comma".consume-window-into-column = null;
"Mod+Period".expel-window-from-column = null;
"Mod+R".switch-preset-column-width = null;
"Mod+F".maximize-column = null;
"Mod+Shift+F".fullscreen-window = null;
"Mod+Ctrl+F".expand-column-to-available-width = null;
"Mod+Minus".set-column-width = "-10%";
"Mod+Plus".set-column-width = "+10%";
"Mod+V".toggle-window-floating = null;
"Mod+Shift+V".switch-focus-between-floating-and-tiling = null;
# allow-inhibiting=false
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = null;
"Mod+Shift+E".quit = null;
"Ctrl+Alt+Delete".quit = null;
};
}
]
++ lib.optional (screenshotPath != null) [
{
screenshot-path = screenshotPath;
binds = {
"Print".screenshot = null;
"Ctrl+Print".screenshot-screen = null;
"Alt+Print".screenshot-window = null;
};
focus-ring = {
width = 2;
active-color = colors.active-color;
inactive-color = colors.inactive-color;
};
shadow = {
on = null;
draw-behind-window = true;
softness = 30;
spread = 5;
color = colors.shadow-color;
};
};
spawn-at-startup = [
(lib.getExe pkgs.niphas-bar)
(lib.getExe pkgs.niphas-set-wallpaper)
(lib.getExe pkgs.niphas-clipboard-watcher)
(lib.getExe pkgs.niphas-redshift)
];
hotkey-overlay.skip-at-startup = null;
prefer-no-csd = null;
animations.slowdown = 0.5; # twice as fast
binds =
let
wpctl = lib.getExe' pkgs.wireplumber "wpctl";
in
{
"Mod+Shift+Slash".show-hotkey-overlay = null;
"Mod+Y".spawn = lib.getExe pkgs.niphas-web-browser;
"Mod+T".spawn = lib.getExe pkgs.niphas-file-browser;
"Mod+Return".spawn = lib.getExe pkgs.niphas-terminal;
"Mod+D".spawn = lib.getExe pkgs.niphas-runner;
"Mod+Shift+W".spawn = lib.getExe pkgs.niphas-locker;
"Print".spawn = lib.getExe pkgs.niphas-screenshot;
"Mod+Q".spawn = lib.getExe pkgs.niphas-clipman;
# TODO allow-when-locked
"XF86AudioRaiseVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0";
"XF86AudioLowerVolume".spawn-sh = "${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 0.1-";
"XF86AudioMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
"XF86AudioMicMute".spawn-sh = "${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
"XF86AudioPlay".spawn-sh = "${lib.getExe pkgs.playerctl} play-pause";
"XF86AudioStop".spawn-sh = "${lib.getExe pkgs.playerctl} stop";
"XF86AudioPrev".spawn-sh = "${lib.getExe pkgs.playerctl} previous";
"XF86AudioNext".spawn-sh = "${lib.getExe pkgs.playerctl} next";
"XF86MonBrightnessUp".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set +25%";
"XF86MonBrightnessDown".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set 25%-";
# TODO repeat=false
"Mod+O".toggle-overview = null;
"Mod+Shift+Q".close-window = null;
"Mod+H".focus-column-left = null;
"Mod+J".focus-window-or-workspace-down = null;
"Mod+K".focus-window-or-workspace-up = null;
"Mod+L".focus-column-right = null;
"Mod+Shift+H".move-column-left = null;
"Mod+Shift+J".move-window-down-or-to-workspace-down = null;
"Mod+Shift+K".move-window-up-or-to-workspace-up = null;
"Mod+Shift+L".move-column-right = null;
"Mod+Home".focus-column-first = null;
"Mod+End".focus-column-last = null;
"Mod+Shift+Home".move-column-to-first = null;
"Mod+Shift+End".move-column-to-last = null;
# TODO cooldown-ms=150
"Mod+WheelScrollDown".focus-workspace-down = null;
"Mod+WheelScrollUp".focus-workspace-up = null;
"Mod+Shift+WheelScrollDown".move-column-to-workspace-down = null;
"Mod+Shift+WheelScrollUp".move-column-to-workspace-up = null;
"Mod+WheelScrollRight".focus-column-right = null;
"Mod+WheelScrollLeft".focus-column-left = null;
"Mod+Shift+WheelScrollRight".move-column-right = null;
"Mod+Shift+WheelScrollLeft".move-column-left = null;
"Mod+1".focus-workspace = 1;
"Mod+2".focus-workspace = 2;
"Mod+3".focus-workspace = 3;
"Mod+4".focus-workspace = 4;
"Mod+5".focus-workspace = 5;
"Mod+6".focus-workspace = 6;
"Mod+7".focus-workspace = 7;
"Mod+8".focus-workspace = 8;
"Mod+9".focus-workspace = 9;
"Mod+Shift+1".move-window-to-workspace = 1;
"Mod+Shift+2".move-window-to-workspace = 2;
"Mod+Shift+3".move-window-to-workspace = 3;
"Mod+Shift+4".move-window-to-workspace = 4;
"Mod+Shift+5".move-window-to-workspace = 5;
"Mod+Shift+6".move-window-to-workspace = 6;
"Mod+Shift+7".move-window-to-workspace = 7;
"Mod+Shift+8".move-window-to-workspace = 8;
"Mod+Shift+9".move-window-to-workspace = 9;
"Mod+Tab".focus-workspace-previous = null;
"Mod+Comma".consume-window-into-column = null;
"Mod+Period".expel-window-from-column = null;
"Mod+R".switch-preset-column-width = null;
"Mod+F".maximize-column = null;
"Mod+Shift+F".fullscreen-window = null;
"Mod+Ctrl+F".expand-column-to-available-width = null;
"Mod+Minus".set-column-width = "-10%";
"Mod+Plus".set-column-width = "+10%";
"Mod+V".toggle-window-floating = null;
"Mod+Shift+V".switch-focus-between-floating-and-tiling = null;
# allow-inhibiting=false
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = null;
"Mod+Shift+E".quit = null;
"Ctrl+Alt+Delete".quit = null;
};
}
]);
}
]
);
};
in
niri.wrapper

View File

@@ -1,6 +1,5 @@
{
neovim,
nodejs,
vimPlugins,
fetchFromGitHub,
vimUtils,
@@ -15,41 +14,28 @@ neovim.override {
configure = {
vimAlias = true;
viAlias = true;
customRC =
lib.optionalString withCopilot (''
luafile ${writeText "copilot.lua" ''
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
copilot_node_command = '${lib.getExe nodejs}'
})
require("copilot_cmp").setup()
''}
'')
+ ''
source ${./shared.vim}
source ${./init.vim}
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
luafile ${./init.lua}
customRC = ''
source ${./shared.vim}
source ${./init.vim}
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
luafile ${./init.lua}
''
+ lib.optionalString (stylixColors != null) (
with stylixColors.withHashtag;
''
+ lib.optionalString (stylixColors != null) (
with stylixColors.withHashtag;
''
luafile ${writeText "colors.lua" ''
require('base16-colorscheme').setup({
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
})
''}
''
)
+ lib.optionalString (colorscheme != null) ''
colorscheme ${colorscheme}
'';
luafile ${writeText "colors.lua" ''
require('base16-colorscheme').setup({
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
})
''}
''
)
+ lib.optionalString (colorscheme != null) ''
colorscheme ${colorscheme}
'';
packages.nvim = with vimPlugins; {
start = [
base16-nvim
@@ -95,10 +81,7 @@ neovim.override {
}
)
]
++ lib.optionals withCopilot [
vimPlugins.copilot-lua
vimPlugins.copilot-cmp
];
++ lib.optional withCopilot vimPlugins.copilot-nvim;
opt = [
csv
dhall-vim

View File

@@ -19,23 +19,17 @@ cmp.setup({
luasnip.lsp_expand(args.body)
end,
},
completion = {
autocomplete = { require("cmp.types").cmp.TriggerEvent.TextChanged },
},
mapping = {
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
-- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#super-tab-like-mapping
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
cmp.complete()
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
@@ -47,11 +41,8 @@ cmp.setup({
end, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = "copilot", priority = 1000 },
{ name = "nvim_lsp", priority = 800 },
{ name = "luasnip", priority = 700 },
{ name = "path", priority = 500 },
{ name = "buffer", priority = 300 },
{ name = "nvim_lsp" },
{ name = "luasnip" },
}),
})
@@ -101,11 +92,10 @@ local language_servers = {
pyright = {}, -- pyright
-- tsserver = {}, -- typescript-language-server
cssls = {},
elmls = {}, -- elm-language-server
gopls = {}, -- gopls
elmls = {}, -- elm-language-server
gopls = {}, -- gopls
denols = {}, -- deno built in
bashls = {}, -- bash-language-server
ocamllsp = {}, -- ocamllsp
lua_ls = {
Lua = {
runtime = {
@@ -122,9 +112,9 @@ local language_servers = {
},
},
},
hls = {}, -- haskell-language-server
html = {}, -- vscode-langservers-extracted
jsonls = {}, -- vscode-langservers-extracted
hls = {}, -- haskell-language-server
html = {}, -- vscode-langservers-extracted
jsonls = {}, -- vscode-langservers-extracted
lemminx = {}, -- lemminx (for xml)
nil_ls = {
["nil"] = {
@@ -132,10 +122,10 @@ local language_servers = {
command = { "nixfmt" },
},
},
}, -- github:oxalica/nil
}, -- github:oxalica/nil
dhall_lsp_server = {}, -- dhall-lsp-server
-- rnix = {}, -- rnix-lsp
jqls = {}, -- jq-lsp
jqls = {}, -- jq-lsp
rust_analyzer = { ["rust-analyzer"] = {} },
-- eslint = {},
-- volar? vls?

View File

@@ -45,17 +45,6 @@ let g:netrw_winsize = 25
call matchadd('colorcolumn', '\%101v', 100)
highlight colorcolumn ctermbg=red
fun! TrimWhitespace()
" Skip if the filetype is markdown
if &ft =~ 'markdown'
return
endif
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
autocmd BufWritePre * call TrimWhitespace()
" undofile - This allows you to use undos after exiting and restarting
" This, like swap and backups, uses .vim-undo first, then ~/.vim/undo
" :help undo-persistence