Compare commits

...
Sign in to create a new pull request.

12 commits

22 changed files with 562 additions and 160 deletions

View file

@ -3,31 +3,6 @@ packages = ["default"]
[files] [files]
"configs/hypr/work-laptop/hyprland.conf" = "~/.config/hypr/include/work-laptop.conf" "configs/hypr/work-laptop/hyprland.conf" = "~/.config/hypr/include/work-laptop.conf"
"configs/niri/work-laptop/local.kdl" = "~/.config/niri/include/local.kdl"
[files."configs/niri/config.kdl"]
target = "~/.config/niri/config.kdl"
type = "template"
append = """
window-rule {
match app-id="brave-work"
open-on-workspace "1"
open-focused true
default-column-width {
proportion 0.5
}
}
window-rule {
match app-id="brave-personal"
open-on-workspace "2"
open-focused false
default-column-width {
proportion 0.5
}
}
"""
[variables] [variables]

View file

@ -39,4 +39,4 @@ depends = ["niri"]
[default.variables] [default.variables]
[niri.files] [niri.files]
"configs/niri" = "~/.config/niri" "configs/niri/base" = "~/.config/niri"

49
.justfile Normal file
View file

@ -0,0 +1,49 @@
packages_file := quote(justfile_directory() / "bootstrap/pkgs_arch.txt")
bootstrap: setup_pacman setup_paru install_packages
install_packages: update_packages
paru -S --needed --noconfirm - < {{ packages_file }}
update_packages:
paru -Syu --noconfirm
clean_orphans:
-sudo pacman -Qdtq | sudo pacman -Rns -
@echo "\n\n{{ BLUE }}The following files are not owned by any package anymore:{{ NORMAL }}"
# setup sudo:
# sudo loop
# show asterisk on password
setup_pacman:
# add automatic updates
sudo sed -i \
-e 's/#\?ParallelDownloads = [0-9]\+/ParallelDownloads = {{ num_cpus() }}/' \
-e 's/#\?Color\+/Color/' \
-e 's/#\?ILoveCandy\+/ILoveCandy/' \
-e 's/#\?VerbosePkgLists\+/VerbosePkgLists/' \
/etc/pacman.conf
setup_paru:
#!/usr/bin/env bash
set -euxo pipefail
if ! command -v paru &> /dev/null ; then
tmp=$(mktemp -d)
sudo pacman -S --needed base-devel
git clone https://aur.archlinux.org/paru.git "$tmp"
cd "$tmp"
makepkg -si
cd -
rm -rf "$tmp"
fi
sudo sed -i \
-e 's/#\?BottomUp\+/BottomUp/' \
-e 's/#\?SudoLoop\+/SudoLoop/' \
-e 's/#\?CombinedUpgrade\+/CombinedUpgrade/' \
-e 's/#\?CleanAfter\+/CleanAfter/' \
-e 's/#\?NewsOnUpgrade\+/NewsOnUpgrade/' \
/etc/paru.conf

View file

@ -1,7 +1,7 @@
syntax = "All" syntax = "All"
column_width = 120 column_width = 120
line_endings = "Unix" line_endings = "Unix"
indent_type = "indent_type" indent_type = "Spaces"
indent_width = 2 indent_width = 2
quote_style = "AutoPreferDouble" quote_style = "AutoPreferDouble"
call_parentheses = "Always" call_parentheses = "Always"

72
bootstrap/pkgs_arch.txt Normal file
View file

@ -0,0 +1,72 @@
age
atuin
brave-bin
bun-bin
catppuccin-cursors-macchiato
catppuccin-gtk-theme-macchiato
catppuccin-sddm-theme-macchiato
celluloid
deno
dotter-rs-bin
dunst
eza
fish
flatpak
fzf
git
gitleaks
gnome-disk-utility
just
kitty
kvantum
kvantum-theme-catppuccin-git
lazygit
limine
limine-mkinitcpio-hook
limine-snapper-sync
lostfiles
lxappearance
ly
nautilus
nautilus-admin-gtk4
nautilus-image-converter
nautilus-open-any-terminal
neovim
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
paccache-hook
plymouth-theme-catppuccin-macchiato-git
podman
pre-commit
pwvucontrol
qt5-wayland
qt6-wayland
rofi
rofi-rbw
rofimoji
rsync
sops
swappy
tailscale
tealdeer
trash-cli
ttf-dejavu
ttf-fira-code
ttf-fira-mono
ttf-fira-sans
ttf-firacode-nerd
ttf-jetbrains-mono-nerd
ttf-ms-win11-auto
ttf-nerd-fonts-symbols-mono
ttf-nunito
ttf-opensans
ttf-roboto
ttf-roboto-mono-nerd
udiskie
vim
wget
yazi
zed
zip
zoxide

View file

@ -2,7 +2,5 @@ if status is-interactive
# Commands to run in interactive sessions can go here # Commands to run in interactive sessions can go here
zoxide init --cmd cd fish | source zoxide init --cmd cd fish | source
atuin init fish | source atuin init fish | source
mise activate fish | source
end end

View file

@ -0,0 +1,7 @@
function envsource
for line in (cat $argv | grep -v '^#')
set item (string split -m 1 '=' $line)
set -gx $item[1] $item[2]
echo "Exported key $item[1]"
end
end

View file

@ -1,7 +1,10 @@
theme = catppuccin-macchiato theme = Catppuccin Macchiato
font-family = JetBrainsMono Nerd Font
# Common # Common
keybind = global:ctrl+shift+x=toggle_quick_terminal
keybind = ctrl+space>o=write_selection_file:open keybind = ctrl+space>o=write_selection_file:open
keybind = ctrl+space>shift+o=write_selection_file:paste keybind = ctrl+space>shift+o=write_selection_file:paste

View file

@ -1,7 +1,7 @@
general { general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend. before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. after_sleep_cmd = niri msg action power-on-monitors # to avoid having to press a key twice to turn on the display.
} }
listener { listener {
@ -23,9 +23,9 @@ listener {
} }
listener { listener {
timeout = 330 # 5.5min timeout = 330 # 5.5min
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed on-timeout = niri msg action power-off-monitors # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected after timeout has fired. on-resume = niri msg action power-on-monitors && brightnessctl -r # screen on when activity is detected after timeout has fired.
} }
listener { listener {

View file

@ -0,0 +1,120 @@
lines 30
#: The number of lines shown in the panel. Ignored for background,
#: centered, and vertical panels. If it has the suffix px then it sets
#: the height of the panel in pixels instead of lines.
columns 200
#: The number of columns shown in the panel. Ignored for background,
#: centered, and horizontal panels. If it has the suffix px then it
#: sets the width of the panel in pixels instead of columns.
edge top
#: Which edge of the screen to place the panel on. Note that some
#: window managers (such as i3) do not support placing docked windows
#: on the left and right edges. The value background means make the
#: panel the "desktop wallpaper". Note that when using sway if you set
#: a background in your sway config it will cover the background drawn
#: using this kitten. Additionally, there are three more values:
#: center, center-sized and none. The value center anchors the panel
#: to all sides and covers the entire display (on macOS the part of
#: the display not covered by titlebar and dock). The panel can be
#: shrunk and placed using the margin parameters. The value none
#: anchors the panel to the top left corner and should be placed using
#: the margin parameters. Its size is set by lines and columns. The
#: value center-sized is just like none except that the panel is
#: centered instead of in the top left corner and the margins have no
#: effect.
background_opacity 1
#: The background opacity of the window. This works the same as the
#: kitty option of the same name, it is present here as it has a
#: different default value for the quick access terminal.
# hide_on_focus_loss no
#: Hide the window when it loses keyboard focus automatically. Using
#: this option will force focus_policy to on-demand.
# grab_keyboard no
#: Grab the keyboard. This means global shortcuts defined in the OS
#: will be passed to kitty instead. Useful if you want to create an OS
#: modal window. How well this works depends on the OS/window
#: manager/desktop environment. On Wayland it works only if the
#: compositor implements the inhibit-keyboard-shortcuts protocol
#: <https://wayland.app/protocols/keyboard-shortcuts-inhibit-
#: unstable-v1>. On macOS Apple doesn't allow applications to grab the
#: keyboard without special permissions, so it doesn't work.
margin_left 50
#: Set the left margin for the panel, in pixels. Has no effect for
#: right edge panels. Only works on macOS and Wayland compositors that
#: supports the wlr layer shell protocol.
margin_right 50
#: Set the right margin for the panel, in pixels. Has no effect for
#: left edge panels. Only works on macOS and Wayland compositors that
#: supports the wlr layer shell protocol.
margin_top 10
#: Set the top margin for the panel, in pixels. Has no effect for
#: bottom edge panels. Only works on macOS and Wayland compositors
#: that supports the wlr layer shell protocol.
# margin_bottom 0
#: Set the bottom margin for the panel, in pixels. Has no effect for
#: top edge panels. Only works on macOS and Wayland compositors that
#: supports the wlr layer shell protocol.
# kitty_conf
#: Path to config file to use for kitty when drawing the window. Can
#: be specified multiple times. By default, the normal kitty.conf is
#: used. Relative paths are resolved with respect to the kitty config
#: directory.
kitty_override window_padding_width=0 8
#: Override individual kitty configuration options, can be specified
#: multiple times. Syntax: kitty_override name=value. For example:
#: kitty_override font_size=20.
app_id kitty-quick-access
#: On Wayland set the namespace of the layer shell surface. On X11 set
#: the WM_CLASS assigned to the quick access window. (Linux only)
# output_name
#: The panel can only be displayed on a single monitor (output) at a
#: time. This allows you to specify which output is used, by name. If
#: not specified the compositor will choose an output automatically,
#: typically the last output the user interacted with or the primary
#: monitor. Run kitten panel --output-name list to get a list of
#: available outputs. Use listjson for a json encoded output. Note
#: that on Wayland the output can only be set at panel creation time,
#: it cannot be changed after creation, nor is there anyway to display
#: a single panel on all outputs. Please complain to the Wayland
#: developers about this.
# start_as_hidden no
#: Whether to start the quick access terminal hidden. Useful if you
#: are starting it as part of system startup.
# focus_policy exclusive
#: On a Wayland compositor that supports the wlr layer shell protocol,
#: specify the focus policy for keyboard interactivity with the panel.
#: Please refer to the wlr layer shell protocol documentation for more
#: details. Note that different Wayland compositors behave very
#: differently with exclusive, your mileage may vary. On macOS,
#: exclusive and on-demand are currently the same.

View file

@ -155,18 +155,18 @@ gui:
# Config relating to git # Config relating to git
git: git:
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md # See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md
paging: pagers:
# Value of the --color arg in the git diff command. Some pagers want this to be set to 'always' and some want it set to 'never' - # Value of the --color arg in the git diff command. Some pagers want this to be set to 'always' and some want it set to 'never'
colorArg: always colorArg: always
# e.g. # e.g.
# diff-so-fancy # diff-so-fancy
# delta --dark --paging=never # delta --dark --paging=never
# ydiff -p cat -s --wrap --width={{columnWidth}} # ydiff -p cat -s --wrap --width={{columnWidth}}
pager: "" pager: ""
# If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager). # If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager).
useConfig: true useConfig: true
# e.g. 'difft --color=always' # e.g. 'difft --color=always'
externalDiffCommand: "" externalDiffCommand: ""
# Config relating to committing # Config relating to committing
commit: commit:
# If true, pass '--signoff' flag when committing # If true, pass '--signoff' flag when committing
@ -406,7 +406,7 @@ keybinding:
viewResetOptions: D viewResetOptions: D
fetch: f fetch: f
toggleTreeView: '`' toggleTreeView: '`'
openMergeTool: M openMergeOptions: M
openStatusFilter: <c-b> openStatusFilter: <c-b>
copyFileInfoToClipboard: "y" copyFileInfoToClipboard: "y"
branches: branches:

View file

@ -1,10 +1,11 @@
include "include/local.kdl"
// ╭─────────────────────────────────────────────────────────╮ // ╭─────────────────────────────────────────────────────────╮
// │ Windows Rules │ // │ Windows Rules │
// ╰─────────────────────────────────────────────────────────╯ // ╰─────────────────────────────────────────────────────────╯
window-rule { window-rule {
// This regular expression is intentionally made as specific as possible, // This regular expression is intentionally made as specific as possible,
// since this is the default config, and we want no false positives. // since this is the default config, and we want no false positives.
// You can get away with just app-id="wezterm" if you want. // You can get away with just app-id="wezterm" f you want.
match app-id="^org\\.wezfurlong\\.wezterm$" match app-id="^org\\.wezfurlong\\.wezterm$"
default-column-width { default-column-width {
@ -16,6 +17,11 @@ window-rule {
match app-id="^brave-.*-Default$" match app-id="^brave-.*-Default$"
// Extensions popup open-floating true // Extensions popup open-floating true
} }
// Full width window
window-rule {
match app-id="beekeeper-studio"
open-maximized true
}
window-rule { window-rule {
match app-id="^org\\.keepassxc\\.KeePassXC$" match app-id="^org\\.keepassxc\\.KeePassXC$"
match app-id="^org\\.gnome\\.World\\.Secrets$" match app-id="^org\\.gnome\\.World\\.Secrets$"
@ -27,7 +33,7 @@ window-rule {
match app-id="brave-browser" match app-id="brave-browser"
match at-startup=true match at-startup=true
default-column-width { default-column-width {
proportion 0.75 proportion 0.5
} }
} }
window-rule { window-rule {
@ -38,9 +44,20 @@ window-rule {
geometry-corner-radius 4 geometry-corner-radius 4
clip-to-geometry true clip-to-geometry true
} }
layer-rule {
match namespace="kitty-quick-access"
geometry-corner-radius 12
shadow {
on
spread 10
softness 20
offset x=-10 y=10
}
}
// ╭─────────────────────────────────────────────────────────╮ // ╭─────────────────────────────────────────────────────────╮
// │ Auto Start Apps │ // │ Auto Start Apps │
// ╰─────────────────────────────────────────────────────────╯ // ╰─────────────────────────────────────────────────────────╯
spawn-at-startup "./fix_float.py"
spawn-at-startup "/usr/lib/pam_kwallet_init" spawn-at-startup "/usr/lib/pam_kwallet_init"
spawn-at-startup "udieskie" spawn-at-startup "udieskie"
spawn-at-startup "brave" spawn-at-startup "brave"
@ -83,14 +100,20 @@ binds {
Mod+Return hotkey-overlay-title="Open a Terminal: kitty" { Mod+Return hotkey-overlay-title="Open a Terminal: kitty" {
spawn "kitty" spawn "kitty"
} }
Mod+Shift+Return hotkey-overlay-title="Open Quick Terminal" {
spawn "kitten" "quick_access_terminal"
}
Mod+Shift+E hotkey-overlay-title="Open Code Editor" {
spawn-sh "kitten quick_access_terminal --instance-group editor-choice fish -c \"zeditor (zoxide query -i)\""
}
Mod+D hotkey-overlay-title="Run an Application: Rofi" { Mod+D hotkey-overlay-title="Run an Application: Rofi" {
spawn "rofi" "-show" "drun" "-run-command" "uwsm app -- {cmd}" spawn "rofi" "-show" "drun" "-run-command" "uwsm app -- {cmd}"
} }
XF86AudioRaiseVolume allow-when-locked=true { XF86AudioRaiseVolume allow-when-locked=true {
spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+" spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.025+"
} }
XF86AudioLowerVolume allow-when-locked=true { XF86AudioLowerVolume allow-when-locked=true {
spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-" spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.025-"
} }
XF86AudioMute allow-when-locked=true { XF86AudioMute allow-when-locked=true {
spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
@ -129,10 +152,10 @@ binds {
focus-window-or-workspace-up focus-window-or-workspace-up
} }
Mod+Right { Mod+Right {
focus-column-right focus-column-or-monitor-right
} }
Mod+H { Mod+H {
focus-column-left focus-column-or-monitor-left
} }
Mod+J { Mod+J {
focus-window-or-workspace-down focus-window-or-workspace-down
@ -141,7 +164,7 @@ binds {
focus-window-or-workspace-up focus-window-or-workspace-up
} }
Mod+L { Mod+L {
focus-column-right focus-column-or-monitor-right
} }
Mod+Shift+Left { Mod+Shift+Left {
move-column-left move-column-left
@ -381,10 +404,6 @@ binds {
Mod+Escape allow-inhibiting=false { Mod+Escape allow-inhibiting=false {
toggle-keyboard-shortcuts-inhibit toggle-keyboard-shortcuts-inhibit
} }
// The quit action will show a confirmation dialog to avoid accidental exits.
Mod+Shift+E {
quit
}
Ctrl+Alt+Delete { Ctrl+Alt+Delete {
quit quit
} }
@ -405,16 +424,10 @@ environment {
TERMINAL "/usr/bin/kitty" TERMINAL "/usr/bin/kitty"
} }
// ── Display Options ───────────────────────────────────────────────── // ── Display Options ─────────────────────────────────────────────────
output "eDP-1" {
off
}
output "HDMI-A-1" { output "HDMI-A-1" {
scale 1 scale 1
mode "3440x1440" mode "3440x1440"
} }
output "DP-1" {
variable-refresh-rate on-demand=true
}
// ── Input Options ─────────────────────────────────────────────────── // ── Input Options ───────────────────────────────────────────────────
input { input {
keyboard { keyboard {

View file

124
configs/niri/fix_float.py Normal file
View file

@ -0,0 +1,124 @@
#!/usr/bin/python3
"""
Like open-float, but dynamically. Floats a window when it matches the rules.
Some windows don't have the right title and app-id when they open, and only set
them afterward. This script is like open-float for those windows.
Usage: fill in the RULES array below, then run the script.
"""
import json
import os
import re
from dataclasses import dataclass, field
from socket import AF_UNIX, SHUT_WR, socket
@dataclass(kw_only=True)
class Match:
title: str | None = None
app_id: str | None = None
def matches(self, window):
if self.title is None and self.app_id is None:
return False
matched = True
if self.title is not None:
matched &= re.search(self.title, window["title"]) is not None
if self.app_id is not None:
matched &= re.search(self.app_id, window["app_id"]) is not None
return matched
@dataclass
class Rule:
match: list[Match] = field(default_factory=list)
exclude: list[Match] = field(default_factory=list)
def matches(self, window):
if len(self.match) > 0 and not any(m.matches(window) for m in self.match):
return False
if any(m.matches(window) for m in self.exclude):
return False
return True
# Write your rules here. One Rule() = one window-rule {}.
RULES = [
# window-rule {} with one match.
Rule([Match(title="Bitwarden", app_id="^brave-.*-Default$")]),
# window-rule {} with one match and one exclude.
# Rule(
# [Match(title="rs")],
# exclude=[Match(app_id="Alacritty")],
# ),
# window-rule {} with two matches.
# Rule(
# [
# Match(app_id="^foot$"),
# Match(app_id="^mpv$"),
# ]
# ),
]
if len(RULES) == 0:
print("fill in the RULES list, then run the script")
exit()
niri_socket = socket(AF_UNIX)
niri_socket.connect(os.environ["NIRI_SOCKET"])
file = niri_socket.makefile("rw")
_ = file.write('"EventStream"')
file.flush()
niri_socket.shutdown(SHUT_WR)
windows = {}
def send(request):
with socket(AF_UNIX) as niri_socket:
niri_socket.connect(os.environ["NIRI_SOCKET"])
file = niri_socket.makefile("rw")
_ = file.write(json.dumps(request))
file.flush()
def float(id: int):
send({"Action": {"MoveWindowToFloating": {"id": id}}})
send({"Action": {"SetWindowWidth": {"id": id, "change": {"SetProportion": 20}}}})
send({"Action": {"SetWindowHeight": {"id": id, "change": {"SetProportion": 50}}}})
def update_matched(win):
win["matched"] = False
if existing := windows.get(win["id"]):
win["matched"] = existing["matched"]
matched_before = win["matched"]
win["matched"] = any(r.matches(win) for r in RULES)
if win["matched"] and not matched_before:
print(f"floating title={win['title']}, app_id={win['app_id']}")
float(win["id"])
for line in file:
event = json.loads(line)
if changed := event.get("WindowsChanged"):
for win in changed["windows"]:
update_matched(win)
windows = {win["id"]: win for win in changed["windows"]}
elif changed := event.get("WindowOpenedOrChanged"):
win = changed["window"]
update_matched(win)
windows[win["id"]] = win
elif changed := event.get("WindowClosed"):
del windows[changed["id"]]

View file

@ -0,0 +1,32 @@
window-rule {
match app-id="brave-work"
open-on-workspace "1"
open-focused true
default-column-width {
proportion 0.5
}
}
window-rule {
match app-id="brave-personal"
open-on-workspace "2"
open-focused false
default-column-width {
proportion 0.5
}
}
output "HDMI-A-1" {
scale 1
mode "3440x1440"
focus-at-startup
position x=1920 y=0
}
output "eDP-1" {
mode "1920x1080@60.000"
position x=0 y=720
layout {
default-column-width {
proportion 1.0
}
}
}

View file

@ -16,6 +16,7 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("aleidk.options") require("aleidk.options")
require("aleidk.commands")
require("aleidk.autocmds") require("aleidk.autocmds")
require("aleidk.keymaps") require("aleidk.keymaps")

View file

@ -11,7 +11,8 @@
"hardtime.nvim": { "branch": "main", "commit": "3541ad24faff78274669eceaf130502eb7f1261a" }, "hardtime.nvim": { "branch": "main", "commit": "3541ad24faff78274669eceaf130502eb7f1261a" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" }, "mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" },
"neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" }, "neogen": { "branch": "main", "commit": "dc50715c009f89b8111197fd2f282f6042daa7ea" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
@ -19,7 +20,7 @@
"nvim-dap-view": { "branch": "main", "commit": "390dae6bf67f3342ebb481159932ef0fe54822ba" }, "nvim-dap-view": { "branch": "main", "commit": "390dae6bf67f3342ebb481159932ef0fe54822ba" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" }, "nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
"nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" }, "nvim-lspconfig": { "branch": "master", "commit": "c8503e63c6afab3ed34b49865a4a4edbb1ebf4a8" },
"nvim-treesitter": { "branch": "main", "commit": "802195d8f1980db25a7a39a55f9a25df21756c73" }, "nvim-treesitter": { "branch": "main", "commit": "802195d8f1980db25a7a39a55f9a25df21756c73" },
"nvim-treesitter-context": { "branch": "master", "commit": "66a9b5fa9e806918b5fe3dba00c6cce7e230abd2" }, "nvim-treesitter-context": { "branch": "master", "commit": "66a9b5fa9e806918b5fe3dba00c6cce7e230abd2" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" },

View file

@ -0,0 +1,11 @@
vim.api.nvim_create_user_command("SopsDecrypt", function(args)
vim.cmd([[! sops decrypt -i %]])
end, {
desc = "Decrypt current file with sops",
})
vim.api.nvim_create_user_command("SopsEncrypt", function(args)
vim.cmd([[! sops encrypt -i %]])
end, {
desc = "Decrypt current file with sops",
})

View file

@ -10,54 +10,54 @@ vim.o.diffopt = "vertical,closeoff,filler"
local opt = vim.opt local opt = vim.opt
vim.schedule(function() vim.schedule(function()
vim.opt.clipboard = 'unnamedplus' vim.opt.clipboard = "unnamedplus"
end) end)
-- opt.shortmess:append({ W = true, I = true, c = true }) -- INFO: this control the format of some messages -- opt.shortmess:append({ W = true, I = true, c = true }) -- INFO: this control the format of some messages
-- vim.o.exrc = true -- vim.o.exrc = true
-- vim.opt.list = true -- Sets how neovim will display certain whitespace characters in the editor. -- vim.opt.list = true -- Sets how neovim will display certain whitespace characters in the editor.
-- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } -- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
opt.autowrite = true -- Enable auto write opt.autowrite = true -- Enable auto write
opt.breakindent = true -- Every wrapped line will continue visually indented opt.breakindent = true -- Every wrapped line will continue visually indented
opt.completeopt = "menu,menuone,noselect" opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 2 -- Hide * markup for bold and italic opt.conceallevel = 2 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs opt.expandtab = true -- Use spaces instead of tabs
opt.formatoptions = "jcroqlnt" -- tcqj opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m" opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep" opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case opt.ignorecase = true -- Ignore case
opt.inccommand = 'split' -- Preview substitutions live, as you type! opt.inccommand = "split" -- Preview substitutions live, as you type!
opt.mouse = "a" -- Enable mouse mode opt.mouse = "a" -- Enable mouse mode
opt.nrformats = 'blank,bin,hex' opt.nrformats = "blank,bin,hex"
opt.number = true -- Print line number opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup opt.pumheight = 10 -- Maximum number of entries in a popup
-- opt.relativenumber = true -- Relative line numbers -- opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 15 -- Lines of context opt.scrolloff = 15 -- Lines of context
opt.sidescrolloff = 25 -- Columns of context opt.sidescrolloff = 25 -- Columns of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent opt.shiftwidth = 2 -- Size of an indent
opt.showmode = false -- Don't show mode since we have a statusline opt.showmode = false -- Don't show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" } opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support opt.termguicolors = true -- True color support
opt.undofile = true opt.undofile = true
opt.undolevels = 10000 opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest,list:full" -- Command-line completion mode opt.wildmode = "longest,list:full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap opt.wrap = false -- Disable line wrap
vim.o.completeopt = 'noselect,menu,menuone,noinsert,popup' vim.o.completeopt = "noselect,menu,menuone,noinsert,popup"
vim.o.winborder = 'rounded' vim.o.winborder = "rounded"
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
@ -130,18 +130,20 @@ vim.filetype.add({
mdx = "mdx", mdx = "mdx",
log = "log", log = "log",
conf = "conf", conf = "conf",
env = "dotenv", -- env = "dotenv",
}, },
-- Detect and apply filetypes based on the entire filename -- Detect and apply filetypes based on the entire filename
filename = { filename = {
[".env"] = "dotenv", -- [".env"] = "dotenv",
["env"] = "dotenv", ["env"] = "dotenv",
["tsconfig.json"] = "jsonc", ["tsconfig.json"] = "jsonc",
}, },
-- Detect and apply filetypes based on certain patterns of the filenames -- Detect and apply filetypes based on certain patterns of the filenames
pattern = { pattern = {
-- INFO: Match filenames like - ".env.example", ".env.local" and so on -- INFO: Match filenames like - ".env.example", ".env.local" and so on
["%.env%.[%w_.-]+"] = "dotenv", -- ["%.env%.[%w_.-]+"] = "dotenv",
["compose.*%.ya?ml"] = "yaml.docker-compose",
["docker-compose.*%.ya?ml"] = "yaml.docker-compose",
[".*%.blade%.php"] = "blade", [".*%.blade%.php"] = "blade",
[".*%.hurl.*"] = "hurl", [".*%.hurl.*"] = "hurl",
[".*/hypr/.*%.conf"] = "hyprlang", [".*/hypr/.*%.conf"] = "hyprlang",
@ -155,27 +157,16 @@ vim.filetype.add({
vim.lsp.config("rust-analyzer", { vim.lsp.config("rust-analyzer", {
tools = { tools = {
code_actions = { code_actions = {
ui_select_fallback = true ui_select_fallback = true,
} },
} },
}) })
vim.lsp.enable({ vim.g.markdown_fenced_languages = {
"bashls", "ts=typescript",
"biome", }
"fish_lsp",
"gleam", vim.lsp.enable("denols")
"gopls",
"hyprls",
"intelephense",
"jsonls",
"kotlin_lsp",
"lua_ls",
"nushell",
"pyright",
"ruff",
-- "rust_analyzer", -- managed by rustacean.nvim
})
vim.lsp.inlay_hint.enable(true) vim.lsp.inlay_hint.enable(true)

View file

@ -1,10 +1,13 @@
return { return {
'neovim/nvim-lspconfig',
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
{ {
"mason-org/mason.nvim", "mason-org/mason-lspconfig.nvim",
opts = {} opts = {},
dependencies = {
{ "mason-org/mason.nvim", opts = {} },
"neovim/nvim-lspconfig",
},
}, },
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
{ {
"ckolkey/ts-node-action", "ckolkey/ts-node-action",
dependencies = { "nvim-treesitter" }, dependencies = { "nvim-treesitter" },

View file

@ -1,24 +1,25 @@
return { return {
{ {
'mrcjkb/rustaceanvim', "mrcjkb/rustaceanvim",
version = '^6', -- Recommended version = "^6", -- Recommended
lazy = false, -- This plugin is already lazy lazy = false, -- This plugin is already lazy
}, },
{ {
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis -- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim', "folke/lazydev.nvim",
ft = 'lua', ft = "lua",
opts = { opts = {
library = { library = {
-- Load luvit types when the `vim.uv` word is found -- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } } { path = "${3rd}/luv/library", words = { "vim%.uv" } },
}, },
}, },
}, },
{ {
"pmizio/typescript-tools.nvim", "pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, enabled = false,
opts = {}, dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
} opts = {},
},
} }

View file

@ -1,14 +1,15 @@
return { return {
{ {
"m4xshen/hardtime.nvim", "m4xshen/hardtime.nvim",
lazy = false, lazy = false,
dependencies = { "MunifTanjim/nui.nvim" }, dependencies = { "MunifTanjim/nui.nvim" },
keys = { keys = {
{ "<leader>uH", "<CMD>Hardtime toggle<CR>", desc = "Toggle hardtime" } { "<leader>uH", "<CMD>Hardtime toggle<CR>", desc = "Toggle hardtime" },
}, },
opts = { opts = {
max_count = 10, max_count = 10,
disable_mouse = false, disable_mouse = false,
}, restriction_mode = "hint",
}, },
},
} }