another small reorg

This commit is contained in:
cnst
2024-08-03 14:59:44 +02:00
parent ae9ee0cb35
commit e6f172ea43
64 changed files with 18 additions and 11 deletions

View File

@@ -3,8 +3,6 @@
# shared imports
./dconf
./gtk
./neovim
./waybar
./xdg
];
}

View File

@@ -1,48 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
general = {
gaps_in = 2;
gaps_out = 4;
border_size = 3;
#col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
#col.inactive_border = rgba(595959aa)
"col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg
"col.inactive_border" = "rgb(504945)";
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
decoration = {
rounding = 0;
blur = {
enabled = true;
size = 8;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = false;
shadow_range = 4;
shadow_render_power = 3;
# col.shadow = rgba(1a1a1aee)
};
animations = {
enabled = true;
bezier = [
"myBezier,0.05, 0.9, 0.1, 1.05"
];
animation = [
"windows, 1, 3, myBezier"
"windowsOut, 1, 3, default, popin 80%"
"border, 1, 3, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 3, default"
];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
};
};
}

View File

@@ -1,9 +0,0 @@
{
imports = [
./appearance.nix
./inputs.nix
./keybinds.nix
./rules.nix
./startup.nix
];
}

View File

@@ -1,71 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
monitor = [
"DP-3, 2560x1440@143.86, auto, auto"
"eDP-1,1920x1200@60.02,auto,1"
];
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
];
input = {
follow_mouse = 1;
accel_profile = "flat";
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = true;
disable_while_typing = true;
clickfinger_behavior = true;
scroll_factor = 0.5;
};
};
# Desktop keyboard
device = [
{
name = "pfu-limited-hhkb-hybrid";
kb_layout = "hhkbse";
kb_options = "lv3:rwin_switch";
}
{
name = "hhkb-hybrid_1-keyboard";
kb_layout = "hhkbse";
kb_options = "lv3:rwin_switch";
}
# Laptop keyboard
{
name = "at-translated-set-2-keyboard";
kb_layout = "se";
kb_options = "ctrl:swapcaps";
}
];
gestures = {
workspace_swipe = true;
workspace_swipe_distance = 400;
workspace_swipe_fingers = 3;
workspace_swipe_cancel_ratio = 0.2;
workspace_swipe_min_speed_to_force = 5;
workspace_swipe_direction_lock = true;
workspace_swipe_direction_lock_threshold = 10;
workspace_swipe_create_new = true;
};
misc = {
vrr = 2;
no_direct_scanout = false;
mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0;
force_default_wallpaper = 0;
disable_hyprland_logo = true;
disable_splash_rendering = true;
disable_autoreload = true;
};
xwayland = {
force_zero_scaling = true;
};
# cursor = {
# no_hardware_cursors = true;
# no_break_fs_vrr = true;
# min_refresh_rate = 24;
# };
};
}

View File

@@ -1,101 +0,0 @@
# KEYBINDS
{
wayland.windowManager.hyprland.settings = {
"$terminal" = "kitty";
"$fileManager" = "thunar";
"$passwordManager" = "keepassxc";
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$browser" = "firefox-nightly";
"$browserinc" = "firefox-nightly --private-window";
"$ranger" = "rangerscript";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mod" = "SUPER";
bind = [
# Custom binds
"$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
"$mod, A, exec, pkill -SIGUSR1 waybar"
"$mod, T, exec, $terminal"
"$mod, W, exec, $browser"
"$mod, K, exec, $passwordManager"
"$mod SHIFT, W, exec, $browserinc"
"$mod, Q, killactive,"
#bind = $mod, M, exec, hyprctl dispatch exit
#bind = $mod, E, exec, $fileManager
"$mod, E, exec, $fileManager"
"$mod SHIFT, E, exec, $ranger"
"$mod, F, fullscreen,"
"$mod SHIFT, F, togglefloating,"
"$mod, SPACE, exec, $menu"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
"$mod, C, exec, hyprctl dispatch exec copyq toggle"
"$mod, TAB, exec, $menuw"
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$mod SHIFT, 1, movetoworkspace, 1"
"$mod SHIFT, 2, movetoworkspace, 2"
"$mod SHIFT, 3, movetoworkspace, 3"
"$mod SHIFT, 4, movetoworkspace, 4"
"$mod SHIFT, 5, movetoworkspace, 5"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, 10"
# Laptop controls
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioRaiseVolume, exec, pamixer -i 5"
",XF86AudioMute, exec, pamixer -m"
",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle"
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
",XF86MonBrightnessUp, exec, brightnessctl s +10%"
"$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on"
"$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off"
# Screenshot a window
"$mod, F10, exec, hyprshot -m window"
# Screenshot a monitor
", F10, exec, hyprshot -m output"
# Screenshot a region
"$mod SHIFT, F10, exec, hyprshot -m region"
# Example special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
# bind = $mod, mouse_down, workspace, e+1
# bind = $mod, mouse_up, workspace, e-1
];
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
}

View File

@@ -1,43 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
# CALCURSE SETTINGS
windowrulev2 = [
"float,initialTitle:(floatcal)"
"size 843 650,initialTitle:(floatcal)"
"move 100%-w-20 40,initialTitle:(floatcal)"
#windowrulev2 = move 1708 32,class:(floatcal)
# RANGER/NNN SETTINGS
"float,class:(floatranger)"
"float,class:(floatnnn)"
#windowrulev2 = size 843 650,class:(floatranger)
#windowrulev2 = move 1708 32,class:(floatranger)
#windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
"suppressevent maximize, class:.* # You'll probably like this."
#windowrulev2 = noshadow, floating:0
"float,class:^(org.keepassxc.KeePassXC)$"
"center,class:^(org.keepassxc.KeePassXC)$"
"float,class:^(imv)$"
"float,class:^(com.github.hluk.copyq)$"
"float,class:^(blueman-manager)$"
"center,class:^(nwg-look)$"
"float,class:^(nwg-look)$"
"float,class:^(Lxappearance)$"
"float,class:(pavucontrol)$"
"move 100%-w-20 40,class:(pavucontrol)$"
"float,class:^(polkit-gnome-authentication-agent-1)$"
"float,class:^(org.gnome.Calculator)$"
"size 741 585,class:(pavucontrol)$"
"float,class:^(cnst.test)$"
"float,class:^(org.corectrl.CoreCtrl)$"
"float,class:^(feh)$"
];
windowrule = [
"center, ^(xarchiver)$"
"float, ^(xarchiver)$"
"float, ^(org.gnome.FileRoller)$"
"float, ^(org.freedesktop.impl.portal.desktop.kde)$"
];
};
}

View File

@@ -1,20 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
exec-once = [
# STARTUP
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
"systemctl --user start polkit-gnome-authentication-agent-1"
# exec-once = lxqt-policykit-agent &
"waybar"
"pamixer --set-volume 50"
"blueman-applet & udiskie -Nt"
"nm-applet --indicator"
"mullvad-vpn"
# exec-once = swaybg -i ~/media/images/wallpaper.png
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
# exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server"
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
];
};
}

View File

@@ -1,23 +0,0 @@
{
inputs,
pkgs,
...
}: {
imports = [
inputs.hyprland.homeManagerModules.default
./cfg
];
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd = {
variables = ["--all"];
extraCommands = [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
};
}

View File

@@ -1,48 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
general = {
gaps_in = 2;
gaps_out = 4;
border_size = 3;
#col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
#col.inactive_border = rgba(595959aa)
"col.active_border" = "rgb(4c7a5d)"; # rgba(b16286ee) 45deg
"col.inactive_border" = "rgb(504945)";
layout = "dwindle";
allow_tearing = false;
resize_on_border = true;
};
decoration = {
rounding = 0;
blur = {
enabled = true;
size = 8;
passes = 1;
vibrancy = 0.1696;
};
drop_shadow = false;
shadow_range = 4;
shadow_render_power = 3;
# col.shadow = rgba(1a1a1aee)
};
animations = {
enabled = true;
bezier = [
"myBezier,0.05, 0.9, 0.1, 1.05"
];
animation = [
"windows, 1, 3, myBezier"
"windowsOut, 1, 3, default, popin 80%"
"border, 1, 3, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 3, default"
];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
};
};
}

View File

@@ -1,9 +0,0 @@
{
imports = [
./appearance.nix
./inputs.nix
./keybinds.nix
./rules.nix
./startup.nix
];
}

View File

@@ -1,56 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
monitor = [
"monitor=DVI-D-1,1920x1080@144,auto,1"
];
env = [
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
];
input = {
follow_mouse = 1;
accel_profile = "flat";
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
touchpad = {
natural_scroll = true;
disable_while_typing = true;
clickfinger_behavior = true;
scroll_factor = 0.5;
};
};
# Desktop keyboard
device = [
{
name = "usb-hid-keyboard";
kb_layout = "se";
}
];
gestures = {
workspace_swipe = true;
workspace_swipe_distance = 400;
workspace_swipe_fingers = 3;
workspace_swipe_cancel_ratio = 0.2;
workspace_swipe_min_speed_to_force = 5;
workspace_swipe_direction_lock = true;
workspace_swipe_direction_lock_threshold = 10;
workspace_swipe_create_new = true;
};
misc = {
vrr = 1;
mouse_move_enables_dpms = 1;
key_press_enables_dpms = 0;
force_default_wallpaper = 0;
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
# xwayland {
# force_zero_scaling = true
# }
# cursor {
# no_hardware_cursors = true
# no_break_fs_vrr = true
# min_refresh_rate = 60
# }
};
}

View File

@@ -1,101 +0,0 @@
# KEYBINDS
{
wayland.windowManager.hyprland.settings = {
"$terminal" = "foot";
"$fileManager" = "thunar";
"$passwordManager" = "keepassxc";
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
"$browser" = "firefox-nightly";
"$browserinc" = "firefox-nightly --private-window";
"$ranger" = "rangerscript";
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mod" = "ALT_L";
bind = [
# Custom binds
"$mod SHIFT, B, exec, pkill -SIGUSR2 waybar" # Reload waybar
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
"$mod, A, exec, pkill -SIGUSR1 waybar"
"$mod, T, exec, $terminal"
"$mod, W, exec, $browser"
"$mod, K, exec, $passwordManager"
"$mod SHIFT, W, exec, $browserinc"
"$mod, Q, killactive,"
#bind = $mod, M, exec, hyprctl dispatch exit
#bind = $mod, E, exec, $fileManager
"$mod, E, exec, $fileManager"
"$mod SHIFT, E, exec, $ranger"
"$mod, F, fullscreen,"
"$mod SHIFT, F, togglefloating,"
"$mod, SPACE, exec, $menu"
"$mod, P, pseudo," # dwindle
"$mod, J, togglesplit," # dwindle
"$mod, C, exec, hyprctl dispatch exec copyq toggle"
"$mod, TAB, exec, $menuw"
# Move focus with mainMod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Switch workspaces with mainMod + [0-9]
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod, 9, workspace, 9"
"$mod, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$mod SHIFT, 1, movetoworkspace, 1"
"$mod SHIFT, 2, movetoworkspace, 2"
"$mod SHIFT, 3, movetoworkspace, 3"
"$mod SHIFT, 4, movetoworkspace, 4"
"$mod SHIFT, 5, movetoworkspace, 5"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
"$mod SHIFT, 9, movetoworkspace, 9"
"$mod SHIFT, 0, movetoworkspace, 10"
# Laptop controls
",XF86AudioLowerVolume, exec, pamixer -d 5"
",XF86AudioRaiseVolume, exec, pamixer -i 5"
",XF86AudioMute, exec, pamixer -m"
",XF86AudioMicMute, exec, pactl -- set-source-mute 0 toggle"
",XF86MonBrightnessDown, exec, brightnessctl s 10%-"
",XF86MonBrightnessUp, exec, brightnessctl s +10%"
"$mod, XF86MonBrightnessUp, exec, hyprctl dispatch dpms on"
"$mod, XF86MonBrightnessDown, exec, hyprctl dispatch dpms off"
# Screenshot a window
"$mod, F10, exec, hyprshot -m window"
# Screenshot a monitor
", F10, exec, hyprshot -m output"
# Screenshot a region
"$mod SHIFT, F10, exec, hyprshot -m region"
# Example special workspace (scratchpad)
"$mod, S, togglespecialworkspace, magic"
"$mod SHIFT, S, movetoworkspace, special:magic"
# Scroll through existing workspaces with mainMod + scroll
# bind = $mod, mouse_down, workspace, e+1
# bind = $mod, mouse_up, workspace, e-1
];
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
}

View File

@@ -1,42 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
# CALCURSE SETTINGS
windowrulev2 = [
"float,initialTitle:(floatcal)"
"size 843 650,initialTitle:(floatcal)"
"move 100%-w-20 40,initialTitle:(floatcal)"
#windowrulev2 = move 1708 32,class:(floatcal)
# RANGER/NNN SETTINGS
"float,class:(floatranger)"
"float,class:(floatnnn)"
#windowrulev2 = size 843 650,class:(floatranger)
#windowrulev2 = move 1708 32,class:(floatranger)
#windowrulev2 = move 1708 32;size 843 650;dimaround;float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
"suppressevent maximize, class:.* # You'll probably like this."
#windowrulev2 = noshadow, floating:0
"float,class:^(org.keepassxc.KeePassXC)$"
"center,class:^(org.keepassxc.KeePassXC)$"
"float,class:^(imv)$"
"float,class:^(com.github.hluk.copyq)$"
"float,class:^(blueman-manager)$"
"center,class:^(nwg-look)$"
"float,class:^(nwg-look)$"
"float,class:^(Lxappearance)$"
"float,class:(pavucontrol)$"
"move 100%-w-20 40,class:(pavucontrol)$"
"float,class:^(polkit-gnome-authentication-agent-1)$"
"float,class:^(org.gnome.Calculator)$"
"size 741 585,class:(pavucontrol)$"
"float,class:^(cnst.test)$"
"float,class:^(org.corectrl.CoreCtrl)$"
"float,class:^(feh)$"
];
windowrule = [
"center, ^(xarchiver)$"
"float, ^(xarchiver)$"
"float, ^(org.gnome.FileRoller)$"
];
};
}

View File

@@ -1,20 +0,0 @@
{
wayland.windowManager.hyprland.settings = {
exec-once = [
# STARTUP
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
"systemctl --user start polkit-gnome-authentication-agent-1"
# exec-once = lxqt-policykit-agent &
"waybar"
"pamixer --set-volume 50"
"blueman-applet & udiskie -Nt"
"nm-applet --indicator"
"mullvad-vpn"
# exec-once = swaybg -i ~/media/images/wallpaper.png
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
# exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server"
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
];
};
}

View File

@@ -1,17 +0,0 @@
{inputs, ...}: {
imports = [
inputs.hyprland.homeManagerModules.default
./cfg
];
wayland.windowManager.hyprland = {
enable = true;
systemd = {
variables = ["--all"];
extraCommands = [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
};
}

View File

@@ -1,31 +0,0 @@
{
programs.nixvim.autoCmd = [
# Open help in a vertical split
{
event = "FileType";
pattern = "help";
command = "wincmd L";
}
# Enable spellcheck for some filetypes
{
event = "FileType";
pattern = [
"tex"
"latex"
"markdown"
];
command = "setlocal spell spelllang=en,se";
}
{
event = "TextYankPost";
desc = "Highlight when yanking (copying) text";
# group = "vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true })";
callback = {
__raw = "function()
vim.highlight.on_yank()
end";
};
}
];
}

View File

@@ -1,53 +0,0 @@
{
programs.nixvim = {
opts.completeopt = ["menu" "menuone" "noselect"];
plugins = {
luasnip.enable = true;
lspkind = {
enable = true;
cmp = {
enable = true;
menu = {
nvim_lsp = "[LSP]";
nvim_lua = "[api]";
path = "[path]";
luasnip = "[snip]";
buffer = "[buffer]";
};
};
};
cmp = {
enable = true;
settings = {
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
mapping = {
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<CR>" = "cmp.mapping.confirm({ select = true })";
};
sources = [
{name = "path";}
{name = "nvim_lsp";}
{name = "luasnip";}
{
name = "buffer";
# Words from other open buffers can also be suggested.
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
];
};
};
};
};
}

View File

@@ -1,23 +0,0 @@
{inputs, ...}: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
./autocommands.nix
./completion.nix
./keymappings.nix
./options.nix
./plugins
./todo.nix
];
home.shellAliases.v = "nvim";
programs.nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
luaLoader.enable = true;
};
}

View File

@@ -1,94 +0,0 @@
{
config,
lib,
...
}: {
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = let
normal =
lib.mapAttrsToList
(key: action: {
mode = "n";
inherit action key;
})
{
# "<C-c>" = "<cmd> %y+ <CR>";
"<C-v>" = "p";
"<C-a>" = "ggVG";
"<Space>" = "<NOP>";
# Esc to clear search results
"<esc>" = ":noh<CR>";
# fix Y behaviour
Y = "y$";
# back and fourth between the two most recent files
"<C-c>" = ":b#<CR>";
# close by Ctrl+x
"<C-x>" = ":close<CR>";
# save by Space+s or Ctrl+s
"<leader>s" = ":w<CR>";
"<C-s>" = ":w<CR>";
# navigate to left/right window
"<leader>h" = "<C-w>h";
"<leader>l" = "<C-w>l";
# Press 'H', 'L' to jump to start/end of a line (first/last character)
L = "$";
H = "^";
# resize with arrows
"<C-Up>" = ":resize -2<CR>";
"<C-Down>" = ":resize +2<CR>";
"<C-Left>" = ":vertical resize +2<CR>";
"<C-Right>" = ":vertical resize -2<CR>";
# move current line up/down
# M = Alt key
"<M-k>" = ":move-2<CR>";
"<M-j>" = ":move+<CR>";
"<leader>rp" = ":!remi push<CR>";
};
visual =
lib.mapAttrsToList
(key: action: {
mode = "v";
inherit action key;
})
{
"<C-c>" = "y";
# better indenting
">" = ">gv";
"<" = "<gv";
"<TAB>" = ">gv";
"<S-TAB>" = "<gv";
# move selected line / block of text in visual mode
"K" = ":m '<-2<CR>gv=gv";
"J" = ":m '>+1<CR>gv=gv";
};
insert =
lib.mapAttrsToList
(key: action: {
mode = "i";
inherit action key;
})
{
"<C-v>" = "<esc>p";
};
in
config.lib.nixvim.keymaps.mkKeymaps
{options.silent = true;}
(normal ++ visual ++ insert);
};
}

View File

@@ -1,72 +0,0 @@
{
programs.nixvim = {
globals = {
# Disable useless providers
loaded_ruby_provider = 0; # Ruby
loaded_perl_provider = 0; # Perl
loaded_python_provider = 0; # Python 2
};
clipboard = {
# Use system clipboard
register = "unnamedplus";
providers.wl-copy.enable = true;
};
opts = {
updatetime = 100; # Faster completion
# Line numbers
relativenumber = false; # Relative line numbers
number = true; # Display the absolute line number of the current line
hidden = true; # Keep closed buffer open in the background
showmode = false;
mouse = "a"; # Enable mouse control
mousemodel = "popup"; # Mouse right-click extends the current selection
splitbelow = true; # A new window is put below the current one
splitright = true; # A new window is put right of the current one
list = true;
listchars = {
tab = " ";
trail = "·";
nbsp = "";
extends = "";
precedes = "";
};
swapfile = false; # Disable the swap file
modeline = true; # Tags such as 'vim:ft=sh'
modelines = 100; # Sets the type of modelines
undofile = true; # Automatically save and restore undo history
incsearch = true; # Incremental search: show match for partly typed search command
inccommand = "split"; # Search and replace: preview changes in quickfix list
ignorecase = true; # When the search query is lower-case, match both lower and upper-case
# patterns
smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper
# case characters
scrolloff = 4; # Number of screen lines to show around the cursor
cursorline = true; # Highlight the screen line of the cursor
cursorcolumn = false; # Highlight the screen column of the cursor
signcolumn = "yes"; # Whether to show the signcolumn
colorcolumn = ""; # Columns to highlight
laststatus = 3; # When to use a status line for the last window
fileencoding = "utf-8"; # File-content encoding for the current buffer
# termguicolors = true; # Enables 24-bit RGB color in the |TUI|
spell = false; # Highlight spelling mistakes (local to window)
wrap = false; # Prevent text from wrapping
# Tab options
tabstop = 4; # Number of spaces a <Tab> in the text stands for (local to buffer)
shiftwidth = 4; # Number of spaces used for each step of (auto)indent (local to buffer)
expandtab = true; # Expand <Tab> to spaces in Insert mode (local to buffer)
autoindent = true; # Do clever autoindenting
textwidth = 0; # Maximum width of text that is being inserted. A longer line will be
# broken after white space to get this width.
# Folding
foldlevel = 99; # Folds with a level higher than this number will be closed
};
};
}

View File

@@ -1,10 +0,0 @@
{
programs.nixvim.plugins.barbar = {
enable = true;
keymaps = {
next.key = "<TAB>";
previous.key = "<S-TAB>";
close.key = "<C-w>";
};
};
}

View File

@@ -1,10 +0,0 @@
{
programs.nixvim.plugins.comment = {
enable = true;
settings = {
opleader.line = "<C-b>";
toggler.line = "<C-b>";
};
};
}

View File

@@ -1,24 +0,0 @@
{
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
formattersByFt = {
liquidsoap = [ "liquidsoap-prettier" ];
html = [ [ "prettierd" "prettier" ] ];
css = [ [ "prettierd" "prettier" ] ];
javascript = [ [ "prettierd" "prettier" ] ];
javascriptreact = [ [ "prettierd" "prettier" ] ];
typescript = [ [ "prettierd" "prettier" ] ];
typescriptreact = [ [ "prettierd" "prettier" ] ];
python = [ "black" ];
lua = [ "stylua" ];
nix = [ "alejandra" ];
markdown = [ [ "prettierd" "prettier" ] ];
yaml = [ "yamllint" "yamlfmt" ];
};
};
}

View File

@@ -1,59 +0,0 @@
{pkgs, ...}: {
imports = [
./barbar.nix
./comment.nix
./efm.nix
# ./floaterm.nix
# ./harpoon.nix
./lsp.nix
./lualine.nix
./markdown-preview.nix
./neo-tree.nix
./startify.nix
./tagbar.nix
./telescope.nix
./treesitter.nix
# ./vimtex.nix
./nonels.nix
./conform.nix
# ./yanky.nix
];
programs.nixvim = {
extraPlugins = [pkgs.vimPlugins.gruvbox-material];
colorscheme = "gruvbox-material";
plugins = {
gitsigns = {
enable = true;
settings.signs = {
add.text = "+";
change.text = "~";
};
};
nvim-autopairs.enable = true;
nvim-colorizer = {
enable = true;
userDefaultOptions.names = false;
};
oil.enable = true;
trim = {
enable = true;
settings = {
highlight = false;
ft_blocklist = [
"checkhealth"
"floaterm"
"lspinfo"
"neo-tree"
"TelescopePrompt"
];
};
};
};
};
}

View File

@@ -1,22 +0,0 @@
{
programs.nixvim.plugins = {
lsp.servers.efm = {
enable = true;
extraOptions.init_options = {
documentFormatting = true;
documentRangeFormatting = true;
hover = true;
documentSymbol = true;
codeAction = true;
completion = true;
};
};
lsp-format = {
enable = true;
lspServersToEnable = ["efm"];
};
efmls-configs.enable = true;
};
}

View File

@@ -1,12 +0,0 @@
{
programs.nixvim.plugins.floaterm = {
enable = true;
width = 0.8;
height = 0.8;
title = "";
keymaps.toggle = "<leader>,";
};
}

View File

@@ -1,20 +0,0 @@
{
programs.nixvim = {
plugins.harpoon = {
enable = true;
keymapsSilent = true;
keymaps = {
addFile = "<leader>a";
toggleQuickMenu = "<C-e>";
navFile = {
"1" = "<C-j>";
"2" = "<C-k>";
"3" = "<C-l>";
"4" = "<C-m>";
};
};
};
};
}

View File

@@ -1,84 +0,0 @@
{
programs.nixvim = {
plugins = {
lsp = {
enable = true;
keymaps = {
silent = true;
diagnostic = {
# Navigate in diagnostics
"<leader>k" = "goto_prev";
"<leader>j" = "goto_next";
};
lspBuf = {
gd = "definition";
gD = "references";
gt = "type_definition";
gi = "implementation";
K = "hover";
"<F2>" = "rename";
};
};
# Language server
servers = {
# Average webdev LSPs
cssls.enable = true; # CSS
tailwindcss.enable = true; # TailwindCSS
html.enable = true; # HTML
astro.enable = true; # AstroJS
phpactor.enable = true; # PHP
svelte.enable = false; # Svelte
vuels.enable = false; # Vue
# Python
pyright.enable = true;
# Markdown
marksman.enable = true;
# Nix
nixd.enable = true;
# Docker
dockerls.enable = true;
# Bash
bashls.enable = true;
# C/C++
clangd.enable = true;
# C#
csharp-ls.enable = true;
# Lua
lua-ls = {
enable = true;
settings.telemetry.enable = false;
settings.diagnostics = {
globals = ["vim"];
};
};
tsserver = {
enable = false; # TS/JS
};
# Rust
rust-analyzer = {
enable = true;
installRustc = true;
installCargo = true;
settings = {
checkOnSave = true;
check = {
command = "clippy";
};
};
};
};
};
};
};
}

View File

@@ -1,47 +0,0 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
theme = "gruvbox-material";
globalstatus = true;
# +-------------------------------------------------+
# | A | B | C X | Y | Z |
# +-------------------------------------------------+
sections = {
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = ["filename" "diff"];
lualine_x = [
"diagnostics"
# Show active language server
{
name.__raw = ''
function()
local msg = ""
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
local clients = vim.lsp.get_active_clients()
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end
'';
icon = "";
color.fg = "#ffffff";
}
"encoding"
"fileformat"
"filetype"
];
};
};
}

View File

@@ -1,20 +0,0 @@
{
programs.nixvim = {
plugins.markdown-preview = {
enable = true;
settings = {
auto_close = false;
theme = "dark";
};
};
files."after/ftplugin/markdown.lua".keymaps = [
{
mode = "n";
key = "<leader>m";
action = ":MarkdownPreview<cr>";
}
];
};
}

View File

@@ -1,22 +0,0 @@
{
programs.nixvim = {
keymaps = [
{
mode = "n";
key = "<leader>n";
action = ":Neotree action=focus reveal toggle<CR>";
options.silent = true;
}
];
plugins.neo-tree = {
enable = true;
closeIfLastWindow = true;
window = {
width = 30;
autoExpandWidth = true;
};
};
};
}

View File

@@ -1,44 +0,0 @@
{
programs.nixvim.plugins.none-ls = {
enable = true;
settings = {
cmd = ["bash -c nvim"];
debug = true;
};
sources = {
code_actions = {
statix.enable = true;
gitsigns.enable = true;
};
diagnostics = {
statix.enable = true;
deadnix.enable = true;
pylint.enable = true;
checkstyle.enable = true;
};
formatting = {
alejandra.enable = true;
stylua.enable = true;
shfmt.enable = true;
nixpkgs_fmt.enable = true;
google_java_format.enable = false;
prettier = {
enable = true;
disableTsServerFormatter = true;
};
black = {
enable = true;
settings = ''
{
extra_args = { "--fast" },
}
'';
};
};
completion = {
luasnip.enable = true;
spell.enable = true;
};
};
};
}

View File

@@ -1,32 +0,0 @@
{
programs.nixvim.plugins.startify = {
enable = true;
settings = {
custom_header = [
""
" "
" "
" "
" "
" "
" "
];
# When opening a file or bookmark, change to its directory.
change_to_dir = false;
# By default, the fortune header uses ASCII characters, because they work for everyone.
# If you set this option to 1 and your 'encoding' is "utf-8", Unicode box-drawing characters will
# be used instead.
use_unicode = true;
lists = [{type = "dir";}];
files_number = 30;
skiplist = [
"flake.lock"
];
};
};
}

View File

@@ -1,17 +0,0 @@
{
programs.nixvim = {
plugins.tagbar = {
enable = true;
settings.width = 50;
};
keymaps = [
{
mode = "n";
key = "<C-g>";
action = ":TagbarToggle<cr>";
options.silent = true;
}
];
};
}

View File

@@ -1,33 +0,0 @@
{
programs.nixvim = {
plugins.telescope = {
enable = true;
keymaps = {
# Find files using Telescope command-line sugar.
"<leader>ff" = "find_files";
"<leader>fg" = "live_grep";
"<leader>b" = "buffers";
"<leader>fh" = "help_tags";
"<leader>fd" = "diagnostics";
# FZF like bindings
"<C-p>" = "git_files";
"<leader>p" = "oldfiles";
"<C-f>" = "live_grep";
};
settings.defaults = {
file_ignore_patterns = [
"^.git/"
"^.mypy_cache/"
"^__pycache__/"
"^output/"
"^data/"
"%.ipynb"
];
set_env.COLORTERM = "truecolor";
};
};
};
}

View File

@@ -1,26 +0,0 @@
{
programs.nixvim.plugins = {
treesitter = {
enable = true;
nixvimInjections = true;
settings = {
highlight.enable = true;
indent.enable = true;
};
folding = true;
};
treesitter-refactor = {
enable = true;
highlightDefinitions = {
enable = true;
# Set to false if you have an `updatetime` of ~100.
clearOnCursorMove = false;
};
};
hmts.enable = true;
};
}

View File

@@ -1,77 +0,0 @@
{
programs.nixvim = {
plugins.vimtex = {
enable = true;
settings = {
view_method = "zathura";
quickfix_enabled = true;
quickfix_open_on_warning = false;
# Ignore undesired errors and warnings
quickfix_ignore_filters = [
"Underfull"
"Overfull"
"specifier changed to"
"Token not allowed in a PDF string"
];
# TOC settings
toc_config = {
name = "TOC";
layers = ["content" "todo"];
resize = true;
split_width = 50;
todo_sorted = false;
show_help = true;
show_numbers = true;
mode = 2;
};
};
};
files."after/ftplugin/tex.lua".keymaps = [
{
mode = "n";
key = "m";
action = ":VimtexView<cr>";
}
];
autoCmd = [
{
event = ["BufEnter" "BufWinEnter"];
pattern = "*.tex";
command = "set filetype=tex \"| VimtexTocOpen";
}
# Folding
{
event = "FileType";
pattern = ["tex" "latex"];
callback.__raw = ''
function ()
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
vim.o.foldtext = 'vimtex#fold#text()'
end
'';
}
# Compile on initialization
{
event = "User";
pattern = "VimtexEventInitPost";
callback = "vimtex#compiler#compile";
}
# Cleanup on exit
{
event = "User";
pattern = "VimtexEventQuit";
command = "call vimtex#compiler#clean(0)";
}
];
};
}

View File

@@ -1,5 +0,0 @@
{
programs.nixvim.plugins.yanky = {
enable = true;
};
}

View File

@@ -1,26 +0,0 @@
{
programs.nixvim = {
highlight.Todo = {
fg = "Blue";
bg = "Yellow";
};
match.TODO = "TODO";
keymaps = [
{
mode = "n";
key = "<C-t>";
action.__raw = ''
function()
require('telescope.builtin').live_grep({
default_text="TODO",
initial_mode="normal"
})
end
'';
options.silent = true;
}
];
};
}

View File

@@ -1,6 +0,0 @@
{pkgs, ...}: {
programs.waybar = {
enable = true;
package = pkgs.waybar;
};
}