Compare commits
16 Commits
740a76f6ce
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cd55626328 | |||
| 0f8167282e | |||
| 234e29f367 | |||
| 13ee868d5d | |||
| d9d6418d6a | |||
| a39f1f7967 | |||
| 4637065e94 | |||
| 86bf2150a7 | |||
| dd6f9a89cb | |||
| bad97a55bd | |||
| da68e328a3 | |||
| 378cb564d2 | |||
| 095efdd402 | |||
| 3df2335241 | |||
| be64579c34 | |||
| c8c3936fa0 |
34
flake.nix
34
flake.nix
@@ -34,12 +34,15 @@
|
||||
|
||||
overlays.default = final: prev: {
|
||||
niphas-terminal = prev.alacritty;
|
||||
niphas-web-browser = prev.qutebrowser;
|
||||
niphas-web-browser = prev.firefox;
|
||||
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.callPackage packages/vim { };
|
||||
niphas-editor = prev.lib.makeOverridable (prev.callPackage packages/vim) { };
|
||||
niphas-bar = import packages/ashell.nix {
|
||||
inherit (inputs) wrappers;
|
||||
pkgs = prev;
|
||||
@@ -65,6 +68,28 @@
|
||||
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 { };
|
||||
};
|
||||
|
||||
@@ -82,6 +107,11 @@
|
||||
niphas-git
|
||||
niphas-niri
|
||||
niphas-editor
|
||||
niphas-wallpaper
|
||||
niphas-set-wallpaper
|
||||
niphas-clipboard-watcher
|
||||
niphas-clipman
|
||||
niphas-redshift
|
||||
vimv
|
||||
;
|
||||
}
|
||||
|
||||
@@ -28,13 +28,19 @@
|
||||
pkgs.wdisplays
|
||||
pkgs.nsxiv
|
||||
pkgs.xdg-desktop-portal
|
||||
pkgs.clipman
|
||||
pkgs.xdg-desktop-portal-gnome
|
||||
|
||||
pkgs.rofi # to provide rofi-sensible-terminal
|
||||
|
||||
pkgs.niphas-bar
|
||||
pkgs.niphas-file-browser
|
||||
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
|
||||
];
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
};
|
||||
|
||||
programs.nix-index.enable = true;
|
||||
programs.direnv.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.nil
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
isDarwin = lib.strings.hasSuffix "darwin" pkgs.system;
|
||||
isDarwin = lib.strings.hasSuffix "darwin" pkgs.stdenv.hostPlatform.system;
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{ wrappers, pkgs }:
|
||||
{
|
||||
wrappers,
|
||||
pkgs,
|
||||
}:
|
||||
let
|
||||
git = wrappers.wrapperModules.git.apply {
|
||||
inherit pkgs;
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
{
|
||||
wrappers,
|
||||
pkgs,
|
||||
screenshotPath ? null,
|
||||
geolocation ? [
|
||||
52.5244
|
||||
13.4105
|
||||
],
|
||||
}:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
@@ -17,169 +12,150 @@ let
|
||||
|
||||
niri = wrappers.wrapperModules.niri.apply {
|
||||
inherit pkgs;
|
||||
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;
|
||||
settings = builtins.foldl' lib.recursiveUpdate { } ([
|
||||
{
|
||||
input = {
|
||||
keyboard = {
|
||||
xkb.layout = "de";
|
||||
xkb.variant = "T3";
|
||||
xkb.options = "compose:caps";
|
||||
numlock = 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.;
|
||||
};
|
||||
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;
|
||||
};
|
||||
touchpad = {
|
||||
tap = null;
|
||||
drag = true;
|
||||
};
|
||||
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 +10%";
|
||||
"XF86MonBrightnessDown".spawn-sh = "${lib.getExe pkgs.brightnessctl} --class=backlight set 10%-";
|
||||
|
||||
# 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;
|
||||
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.;
|
||||
};
|
||||
}
|
||||
]
|
||||
);
|
||||
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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
neovim,
|
||||
nodejs,
|
||||
vimPlugins,
|
||||
fetchFromGitHub,
|
||||
vimUtils,
|
||||
@@ -14,28 +15,41 @@ neovim.override {
|
||||
configure = {
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
customRC = ''
|
||||
source ${./shared.vim}
|
||||
source ${./init.vim}
|
||||
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
||||
luafile ${./init.lua}
|
||||
''
|
||||
+ 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}'
|
||||
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}
|
||||
''
|
||||
)
|
||||
+ lib.optionalString (colorscheme != null) ''
|
||||
colorscheme ${colorscheme}
|
||||
'';
|
||||
+ 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}
|
||||
'';
|
||||
packages.nvim = with vimPlugins; {
|
||||
start = [
|
||||
base16-nvim
|
||||
@@ -81,7 +95,10 @@ neovim.override {
|
||||
}
|
||||
)
|
||||
]
|
||||
++ lib.optional withCopilot vimPlugins.copilot.nvim;
|
||||
++ lib.optionals withCopilot [
|
||||
vimPlugins.copilot-lua
|
||||
vimPlugins.copilot-cmp
|
||||
];
|
||||
opt = [
|
||||
csv
|
||||
dhall-vim
|
||||
|
||||
@@ -19,17 +19,23 @@ cmp.setup({
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
autocomplete = { require("cmp.types").cmp.TriggerEvent.TextChanged },
|
||||
},
|
||||
mapping = {
|
||||
-- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#super-tab-like-mapping
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
cmp.complete()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
@@ -41,8 +47,11 @@ cmp.setup({
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "copilot", priority = 1000 },
|
||||
{ name = "nvim_lsp", priority = 800 },
|
||||
{ name = "luasnip", priority = 700 },
|
||||
{ name = "path", priority = 500 },
|
||||
{ name = "buffer", priority = 300 },
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -92,10 +101,11 @@ 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 = {
|
||||
@@ -112,9 +122,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"] = {
|
||||
@@ -122,10 +132,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?
|
||||
|
||||
@@ -45,6 +45,17 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user