Compare commits

...
Author SHA1 Message Date
adamfandClaude Opus 5.5 daed1d7e73 Reload kxkbrc in KWin after setting caps:swapescape
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 15:30:11 +00:00
adamfandClaude Opus 5.5 78800b327f Remove oxocarbon colorscheme from nvim, fall back to tokyonight
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 15:30:11 +00:00
adamfandClaude Opus 5.5 0b419e01f9 Add KDE Plasma target with Hyprland-style keybindings for Steam Deck
kde/apply.sh installs Krohnkite tiling, creates 8 virtual desktops, and
applies Hyprland-matching global shortcuts live via kglobalaccel D-Bus
(kde/shortcuts.py). install.sh/uninstall.sh gain a 'kde' target.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 13:38:40 +00:00
adamfandClaude Opus 5.5 22c88f46f8 Replace claudecode.nvim with sidekick.nvim, add which-key AI icons
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 20:56:55 +01:00
adamfandClaude Opus 5.5 29a780f929 Use 4-space indent for C/C++ in nvim
Drop the 2-space C/C++ override and set IndentWidth: 4 in clangd's
fallback style so formatting matches the editor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 13:12:06 +01:00
adamfandClaude Opus 5.5 6f301c67fa Tidy nvim config: per-press terminal root, trim which-key, refresh README
- Resolve LazyVim.root() when <C-/> is pressed, not once at startup
- Drop which-key spec duplicated from LazyVim defaults
- Remove no-op split_width_percentage from claudecode
- Rewrite README with keymap cheat sheet
- Add tree-sitter-cli to packages (needed to build parsers on nvim 0.12)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:23:06 +01:00
adamfandClaude Opus 5.5 6e2bbc5277 Add hypridle config
Lock via hyprlock on lock-session/sleep and report idle/resume and
lock/unlock events to hypr-agent for activity tracking.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 23:23:06 +01:00
20 changed files with 495 additions and 131 deletions
+3
View File
@@ -14,3 +14,6 @@ wofi/style.css
# Stub Hyprland writes on first run; the real config is hyprland.lua # Stub Hyprland writes on first run; the real config is hyprland.lua
hypr/hyprland.conf hypr/hyprland.conf
# Python bytecode
__pycache__/
+1
View File
@@ -9,6 +9,7 @@ This is a dotfiles/config repository for Arch Linux (Manjaro) using `yay` as the
## Repository Structure ## Repository Structure
- **Window managers**: `hyprland/`, `sway/`, `i3/` - config files for each WM - **Window managers**: `hyprland/`, `sway/`, `i3/` - config files for each WM
- **KDE Plasma (Steam Deck)**: `kde/` - `apply.sh` installs Krohnkite and runs `shortcuts.py`, which sets Hyprland-style global shortcuts live via kglobalaccel D-Bus (don't hand-edit `kglobalshortcutsrc`; edit the `BINDINGS` table). Avoid `KGlobalAccel.globalShortcutsByKey` over D-Bus because a malformed call crashes kwin_wayland
- **Waybar**: `waybar/` - separate config JSONs per WM (`waybar_hyprland_config.json`, `waybar_sway_config.json`) plus shared `waybar_style.css` - **Waybar**: `waybar/` - separate config JSONs per WM (`waybar_hyprland_config.json`, `waybar_sway_config.json`) plus shared `waybar_style.css`
- **Shell**: `bashrc`, `zshrc` - sourced from the user's dotfiles, not used directly - **Shell**: `bashrc`, `zshrc` - sourced from the user's dotfiles, not used directly
- **Terminal**: `alacritty.toml` (imported via alacritty's import system), `kitty.conf` - **Terminal**: `alacritty.toml` (imported via alacritty's import system), `kitty.conf`
+27 -1
View File
@@ -44,7 +44,9 @@ yay -S $(grep -v '^\s*$' ~/scripts/packages.txt | tr '\n' ' ')
~/scripts/uninstall.sh --backup ~/scripts/backups/20260319_120000 all ~/scripts/uninstall.sh --backup ~/scripts/backups/20260319_120000 all
``` ```
Available targets: `hyprland`, `sway`, `i3`, `cursor`, `shell`, `alacritty`, `tmux`, `nvim`, `vim`, `all`. Available targets: `hyprland`, `sway`, `i3`, `cursor`, `shell`, `alacritty`, `tmux`, `nvim`, `vim`, `kde`, `all`.
`kde` is for KDE Plasma 6 (Steam Deck desktop mode) and is not part of `all`. See [KDE Plasma (Steam Deck)](#kde-plasma-steam-deck).
### tmux prerequisite ### tmux prerequisite
@@ -180,6 +182,30 @@ All window managers and tmux use vim-style <kbd>h</kbd><kbd>j</kbd><kbd>k</kbd><
| `e` | Exit session | | `e` | Exit session |
| `Return` / `Esc` | Cancel | | `Return` / `Esc` | Cancel |
### KDE Plasma (Steam Deck)
`install.sh kde` runs `kde/apply.sh`. It installs the [Krohnkite](https://github.com/anametologin/krohnkite) tiling script into `~/.local/share/kwin/scripts`, so it survives SteamOS updates, creates 8 virtual desktops, and sets the shortcuts live through kglobalaccel's D-Bus API (`kde/shortcuts.py`). KWin owns `kglobalshortcutsrc` while it's running, so editing that file by hand doesn't stick. To change a binding, edit the `BINDINGS` table in `kde/shortcuts.py` and press `$mod + Shift + c`. `uninstall.sh kde` (or `kde/apply.sh --reset`) puts every touched shortcut back to its KDE default.
Bindings match the shared table above, with these differences:
| Key | KDE behaviour |
| ---------------------------- | ------------------------------------------------------------ |
| `$mod + Return` / `d` | Konsole / KRunner |
| `$mod + F2` / `F3` | Firefox (flatpak) / Dolphin |
| `$mod + t` | Cycle Krohnkite layout: spiral (dwindle) → tile (master) → monocle |
| `$mod + w` | Monocle layout (instead of a tab group) |
| `$mod + e` / `v` | Rotate layout / rotate the focused part |
| `$mod + r` | Interactive resize; `$mod + Ctrl + h/j/k/l` resizes tiles |
| `$mod + Space` | Switch to the last window |
| `$mod + Shift + s` | Keep window on all desktops |
| `$mod + Shift + -` | Minimize (no scratchpad in KDE) |
| `$mod + 0` / `Shift + e` | Plasma logout/shutdown screen |
| `$mod + Ctrl + x` | Kill window (xkill) |
| `$mod + Shift + w` | KDE Overview |
| `Print` / `$mod + Print` / `$mod + Shift + Print` | Spectacle region → GUI / clipboard / `~/screenshot.png` |
Not mapped: `$mod + b` (KWin has no "last desktop" action), `$mod + m` (bar toggle), `$mod + g`, `$mod + c`, `$mod + F5`.
### tmux ### tmux
Prefix is <kbd>Ctrl</kbd> + <kbd>f</kbd>. Prefix is <kbd>Ctrl</kbd> + <kbd>f</kbd>.
+12
View File
@@ -0,0 +1,12 @@
general {
lock_cmd = ~/.local/bin/hypr-agent lock; pidof hyprlock || hyprlock
unlock_cmd = ~/.local/bin/hypr-agent unlock
before_sleep_cmd = loginctl lock-session
}
# Mark idle time for the activity tracker after 5 minutes without input.
listener {
timeout = 300
on-timeout = ~/.local/bin/hypr-agent idle
on-resume = ~/.local/bin/hypr-agent resume
}
+10
View File
@@ -18,6 +18,7 @@ usage() {
echo " tmux Source tmux.conf" echo " tmux Source tmux.conf"
echo " nvim Neovim (LazyVim) config" echo " nvim Neovim (LazyVim) config"
echo " vim Source vimrc" echo " vim Source vimrc"
echo " kde KDE Plasma (Steam Deck): Krohnkite + Hyprland-style shortcuts"
echo " all Everything (uses hyprland as WM)" echo " all Everything (uses hyprland as WM)"
echo echo
echo "Options:" echo "Options:"
@@ -133,6 +134,14 @@ install_vim() {
append_if_missing "$HOME/.vimrc" "source ~/scripts/vimrc" append_if_missing "$HOME/.vimrc" "source ~/scripts/vimrc"
} }
install_kde() {
echo "Installing KDE (Hyprland-style) config..."
backup "$CONFIG_DIR/kglobalshortcutsrc"
backup "$CONFIG_DIR/kwinrc"
backup "$CONFIG_DIR/kxkbrc"
"$SCRIPTS_DIR/kde/apply.sh"
}
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
usage usage
exit 1 exit 1
@@ -163,6 +172,7 @@ for target in "${targets[@]}"; do
tmux) install_tmux ;; tmux) install_tmux ;;
nvim) install_nvim ;; nvim) install_nvim ;;
vim) install_vim ;; vim) install_vim ;;
kde) install_kde ;;
*) *)
echo "Unknown target: $target" echo "Unknown target: $target"
usage usage
Executable
+98
View File
@@ -0,0 +1,98 @@
#!/usr/bin/env bash
# Make KDE Plasma 6 (Steam Deck desktop mode) behave like hypr/base.lua:
# Krohnkite tiling, 8 virtual desktops, Hyprland-style global shortcuts.
# Safe to re-run. Undo with: kde/apply.sh --reset (or uninstall.sh kde)
set -euo pipefail
KDE_DIR="$(cd "$(dirname "$0")" && pwd)"
APPS_DIR="$HOME/.local/share/applications"
KROHNKITE_VERSION="0.9.9.2"
KROHNKITE_URL="https://github.com/anametologin/krohnkite/releases/download/$KROHNKITE_VERSION/krohnkite.kwinscript"
kwin_reconfigure() { qdbus org.kde.KWin /KWin reconfigure >/dev/null 2>&1 || true; }
if [ "${1:-}" = "--reset" ]; then
echo "Resetting KDE shortcuts and tiling..."
python3 "$KDE_DIR/shortcuts.py" --reset
rm -f "$APPS_DIR"/hyprkeys-*.desktop
kwriteconfig6 --file kwinrc --group Plugins --key krohnkiteEnabled false
kwin_reconfigure
kbuildsycoca6 >/dev/null 2>&1 || true
echo "Done. (Virtual desktops and Krohnkite itself are left in place.)"
exit 0
fi
# ---- Krohnkite -----------------------------------------------------------------
installed=$(kpackagetool6 --type KWin/Script --show krohnkite 2>/dev/null | sed -n 's/.*Version *: *//p' || true)
if [ "$installed" != "$KROHNKITE_VERSION" ]; then
echo "Installing Krohnkite $KROHNKITE_VERSION..."
tmp=$(mktemp -d)
curl -fsSL -o "$tmp/krohnkite.kwinscript" "$KROHNKITE_URL"
if [ -n "$installed" ]; then
kpackagetool6 --type KWin/Script -u "$tmp/krohnkite.kwinscript"
else
kpackagetool6 --type KWin/Script -i "$tmp/krohnkite.kwinscript"
fi
rm -rf "$tmp"
fi
kw() { kwriteconfig6 --file kwinrc --group "$1" --key "$2" "$3"; }
kw Plugins krohnkiteEnabled true
# gaps: hyprland gaps_in = 5, gaps_out = 0
kw Script-krohnkite screenGapBetween 5
for side in Left Right Top Bottom; do kw Script-krohnkite "screenGap$side" 0; done
# layouts cycled by Super+T: spiral (~dwindle), tile (~master), monocle. 0 disables.
for l in threeColumn quarter stacked columns spread floating stair binaryTree cascade; do
kw Script-krohnkite "${l}LayoutOrder" 0
done
kw Script-krohnkite spiralLayoutOrder 1
kw Script-krohnkite tileLayoutOrder 2
kw Script-krohnkite monocleLayoutOrder 3
# hyprland: hyprpwcenter / pavucontrol float
kw Script-krohnkite floatingClass "org.pulseaudio.pavucontrol,pavucontrol,org.kde.spectacle,krunner"
# Super + left/right drag moves/resizes (KWin default, set explicitly)
kw MouseBindings CommandAllKey Meta
# caps:swapescape, as in hyprland input.kb_options
kwriteconfig6 --file kxkbrc --group Layout --key ResetOldOptions true
kwriteconfig6 --file kxkbrc --group Layout --key Options caps:swapescape
# tell KWin to re-read kxkbrc now (same signal the Keyboard KCM sends on Apply)
dbus-send --session --type=signal /Layouts org.kde.keyboard.reloadConfig 2>/dev/null || true
kwin_reconfigure
# ---- 8 virtual desktops -------------------------------------------------------
count=$(qdbus org.kde.KWin /VirtualDesktopManager org.kde.KWin.VirtualDesktopManager.count 2>/dev/null || echo 8)
while [ "$count" -lt 8 ]; do
qdbus org.kde.KWin /VirtualDesktopManager org.kde.KWin.VirtualDesktopManager.createDesktop "$count" "$((count + 1))" >/dev/null
count=$((count + 1))
done
# ---- launchers for commands that have no KDE action ---------------------------
mkdir -p "$APPS_DIR"
launcher() {
local id="$1" name="$2" exec="$3"
cat >"$APPS_DIR/hyprkeys-$id.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=$name
Exec=$exec
NoDisplay=true
X-KDE-StartupNotify=false
EOF
}
launcher screenshot-clip "Screenshot region to clipboard" "spectacle -b -n -r -c"
launcher screenshot-save "Screenshot region to ~/screenshot.png" "sh -c 'spectacle -b -n -r -o \"\$HOME/screenshot.png\"'"
launcher reload "Reload Hyprland-style KDE config" "sh -c '$KDE_DIR/apply.sh && notify-send \"KDE config reloaded\"'"
for n in 1 2 3 4 5 6 7 8; do
launcher "move-follow-$n" "Move window to desktop $n and follow" "$KDE_DIR/move-follow $n"
done
kbuildsycoca6 >/dev/null 2>&1 || true
# ---- shortcuts ------------------------------------------------------------------
sleep 1 # let Krohnkite register its actions after the reconfigure
echo "Applying shortcuts..."
python3 "$KDE_DIR/shortcuts.py"
echo "Done. If caps:swapescape doesn't take effect, log out and back in."
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Move the active window to desktop N and switch there (hyprland: SUPER+SHIFT+N)
n="$1"
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "Window to Desktop $n"
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "Switch to Desktop $n"
+220
View File
@@ -0,0 +1,220 @@
#!/usr/bin/env python3
"""Apply Hyprland-style global shortcuts to KDE Plasma 6 through kglobalaccel's D-Bus API.
kglobalaccel lives inside kwin_wayland and keeps shortcuts in memory, writing them
back to ~/.config/kglobalshortcutsrc itself, so editing that file by hand while the
session is running does not stick. This sets them live instead.
Usage: shortcuts.py apply the bindings below
shortcuts.py --reset put every action we touched back to its KDE default
"""
import json
import os
import sys
import dbus
STATE_FILE = os.path.expanduser("~/.local/state/hyprkeys/cleared.json")
# ---- key encoding (Qt6 QKeyCombination as int) -------------------------------
MODS = {"Meta": 0x10000000, "Shift": 0x02000000, "Ctrl": 0x04000000, "Alt": 0x08000000}
NAMED = {
"Return": 0x01000004, "Esc": 0x01000000, "Tab": 0x01000001, "Print": 0x01000009,
"Left": 0x01000012, "Up": 0x01000013, "Right": 0x01000014, "Down": 0x01000015,
"PgUp": 0x01000016, "PgDown": 0x01000017, "Space": 0x20,
}
NAMED.update({f"F{n}": 0x0100002F + n for n in range(1, 13)})
# US-layout symbols typed with Shift+digit / Shift+minus
SHIFTED = {"1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", "8": "*", "-": "_"}
def key(spec):
"""'Meta+Shift+Q' -> int. The final part is a key name or a single character."""
*mods, k = spec.split("+")
code = sum(MODS[m] for m in mods)
return code | (NAMED[k] if k in NAMED else ord(k.upper()))
def keys(*specs):
"""Expand specs into key ints. Meta+Shift+<digit> also adds the shifted symbol
(Meta+!), because on Wayland the keysym carries the Shift."""
out = []
for s in specs:
out.append(key(s))
mods, _, k = s.rpartition("+")
if "Shift" in mods.split("+") and k in SHIFTED:
out.append(key(f"{mods}+{SHIFTED[k]}"))
return out
# ---- binding table -------------------------------------------------------------
# (component, action, keys, mode) mode: "set" replaces the keys, "add" keeps existing ones
K = "kwin"
BINDINGS = [
# apps
("org.kde.konsole.desktop", "_launch", keys("Meta+Return"), "add"),
("org.kde.krunner.desktop", "_launch", keys("Meta+D"), "add"),
("org.mozilla.firefox.desktop", "_launch", keys("Meta+F2"), "set"),
("org.kde.dolphin.desktop", "_launch", keys("Meta+F3", "Meta+Shift+F3"), "set"),
("org.pulseaudio.pavucontrol.desktop", "_launch", keys("Meta+Ctrl+M"), "set"),
# screenshots
("org.kde.spectacle.desktop", "RectangularRegionScreenShot", keys("Print"), "set"),
("hyprkeys-screenshot-clip.desktop", "_launch", keys("Meta+Print"), "set"),
("hyprkeys-screenshot-save.desktop", "_launch", keys("Meta+Shift+Print"), "set"),
# window actions
(K, "Window Close", keys("Meta+Shift+Q"), "add"),
(K, "Kill Window", keys("Meta+Ctrl+X"), "add"),
(K, "Window Fullscreen", keys("Meta+F"), "set"),
(K, "Window Resize", keys("Meta+R"), "set"),
(K, "Window On All Desktops", keys("Meta+Shift+S"), "set"),
(K, "Window Minimize", keys("Meta+Shift+-"), "add"),
(K, "Walk Through Windows", keys("Meta+Space"), "add"),
(K, "Overview", keys("Meta+Shift+W"), "set"),
# session
("ksmserver", "Lock Session", keys("Meta+9"), "add"),
("ksmserver", "Log Out", keys("Meta+0", "Meta+Shift+E"), "add"),
("hyprkeys-reload.desktop", "_launch", keys("Meta+Shift+C"), "set"),
# Krohnkite tiling
(K, "KrohnkiteFocusLeft", keys("Meta+H", "Meta+Left"), "set"),
(K, "KrohnkiteFocusDown", keys("Meta+J", "Meta+Down"), "set"),
(K, "KrohnkiteFocusUp", keys("Meta+K", "Meta+Up"), "set"),
(K, "KrohnkiteFocusRight", keys("Meta+L", "Meta+Right"), "set"),
(K, "KrohnkiteShiftLeft", keys("Meta+Shift+H", "Meta+Shift+Left"), "set"),
(K, "KrohnkiteShiftDown", keys("Meta+Shift+J", "Meta+Shift+Down"), "set"),
(K, "KrohnkiteShiftUp", keys("Meta+Shift+K", "Meta+Shift+Up"), "set"),
(K, "KrohnkiteShiftRight", keys("Meta+Shift+L", "Meta+Shift+Right"), "set"),
(K, "KrohnkiteShrinkWidth", keys("Meta+Ctrl+H"), "set"),
(K, "KrohnkiteGrowHeight", keys("Meta+Ctrl+J"), "set"),
(K, "KrohnkiteShrinkHeight", keys("Meta+Ctrl+K"), "set"),
(K, "KrohnkitegrowWidth", keys("Meta+Ctrl+L"), "set"),
(K, "KrohnkiteToggleFloat", keys("Meta+Shift+Space"), "set"),
(K, "KrohnkiteNextLayout", keys("Meta+T"), "set"),
(K, "KrohnkiteMonocleLayout", keys("Meta+W"), "set"),
(K, "KrohnkiteRotate", keys("Meta+E"), "set"),
(K, "KrohnkiteRotatePart", keys("Meta+V"), "set"),
(K, "KrohnkiteTileLayout", [], "set"),
(K, "KrohnkiteSetMaster", [], "set"),
(K, "KrohnkiteDecrease", [], "set"),
]
for n in range(1, 9):
BINDINGS += [
(K, f"Switch to Desktop {n}", keys(f"Meta+{n}"), "set"),
(K, f"Window to Desktop {n}", keys(f"Meta+Ctrl+{n}"), "set"),
(f"hyprkeys-move-follow-{n}.desktop", "_launch", keys(f"Meta+Shift+{n}"), "set"),
]
# ---- D-Bus helpers ---------------------------------------------------------------
bus = dbus.SessionBus()
ka = dbus.Interface(bus.get_object("org.kde.kglobalaccel", "/kglobalaccel"), "org.kde.KGlobalAccel")
def to_dbus(key_ints):
return dbus.Array(
[dbus.Struct((dbus.Array([k, 0, 0, 0], signature="i"),), signature=None) for k in key_ints],
signature="(ai)",
)
def actions_of(comp):
try:
return {str(a[1]): [str(x) for x in a] for a in ka.allActionsForComponent([comp])}
except dbus.DBusException:
return {}
def current(action_id):
return [int(s[0][0]) for s in ka.shortcutKeys(action_id) if int(s[0][0])]
def set_keys(action_id, key_ints):
ka.setForeignShortcutKeys(action_id, to_dbus(key_ints))
def action_id(comp, action):
known = actions_of(comp).get(action)
if known:
return known
# not registered yet (our own .desktop launchers, or Krohnkite before it loads)
aid = [comp, action, comp.removesuffix(".desktop"), action]
ka.doRegister(aid)
return aid
def all_actions():
for comp in ka.allMainComponents():
for aid in actions_of(str(comp[0])).values():
yield aid
# ---- main ---------------------------------------------------------------------------
def apply():
own = {(c, a): ks for c, a, ks, _ in BINDINGS}
wanted = {k for ks in own.values() for k in ks}
# 1. strip our keys from every action that holds one it isn't meant to have
cleared = set()
for aid in all_actions():
mine = own.get((aid[0], aid[1]), [])
have = current(aid)
keep = [k for k in have if k not in wanted or k in mine]
if keep != have:
set_keys(aid, keep)
if (aid[0], aid[1]) not in own:
cleared.add((aid[0], aid[1]))
print(f" freed keys from {aid[0]} / {aid[1]}")
# remember what we freed so --reset can put it back
os.makedirs(os.path.dirname(STATE_FILE), exist_ok=True)
prev = set()
if os.path.exists(STATE_FILE):
prev = {tuple(x) for x in json.load(open(STATE_FILE))}
json.dump(sorted(prev | cleared), open(STATE_FILE, "w"))
# 2. assign
failed = []
for comp, action, ks, mode in BINDINGS:
aid = action_id(comp, action)
new = ks
if mode == "add":
new = [k for k in current(aid) if k not in ks] + ks
set_keys(aid, new)
got = current(aid)
if any(k not in got for k in ks):
failed.append(f"{comp} / {action}")
if failed:
print(" WARNING: some keys were not accepted:\n " + "\n ".join(failed))
print(f" {len(BINDINGS)} shortcuts applied")
def reset():
entries = [(c, a) for c, a, _, _ in BINDINGS]
if os.path.exists(STATE_FILE):
entries += [tuple(x) for x in json.load(open(STATE_FILE))]
# Krohnkite and our own launchers go away entirely; clear them first so the
# KDE defaults below don't collide with them.
for comp, action in entries:
if action.startswith("Krohnkite") or comp.startswith("hyprkeys-"):
aid = actions_of(comp).get(action)
if aid:
set_keys(aid, [])
if comp.startswith("hyprkeys-"):
ka.unregister(comp, action)
for comp, action in entries:
if action.startswith("Krohnkite") or comp.startswith("hyprkeys-"):
continue
aid = actions_of(comp).get(action)
if aid:
set_keys(aid, [int(s[0][0]) for s in ka.defaultShortcutKeys(aid) if int(s[0][0])])
if os.path.exists(STATE_FILE):
os.remove(STATE_FILE)
print(" shortcuts reset to KDE defaults")
if __name__ == "__main__":
reset() if "--reset" in sys.argv else apply()
+35 -12
View File
@@ -1,18 +1,41 @@
# Personal Neovim Config # Personal Neovim Config
My personal Neovim configuration built on [LazyVim](https://github.com/LazyVim/LazyVim). Built on [LazyVim](https://www.lazyvim.org). Everything LazyVim documents still applies —
this file only covers what's different. Press `<space>` and wait for which-key, or
`<space>?` to fuzzy-search every keymap.
## Current Setup ## Setup
- **Base**: LazyVim with Gruvbox colorscheme - Colorscheme: tokyonight (LazyVim default)
- **AI**: Claude Code integration (`claudecode.nvim`) - Language extras: C/C++ (clangd), Python, Go, TypeScript/Vue/Tailwind, SQL, Docker, Clojure
- **UI**: Snacks dashboard (custom STP banner), Which-Key (helix preset) - Requires `tree-sitter-cli` (parsers can't be built without it) — see `../packages.txt`
- **Languages**: TypeScript, Vue, Python, Go, SQL, Tailwind, Docker
- **Extras**: mini-surround, Prettier formatting, git extras
## Suggested Plugins to Add ## Custom keymaps
- **vim-fugitive** or **neogit** - deeper git workflow beyond LazyVim's built-in gitsigns | Key | Action |
- **nvim-lint** - async linting beyond what LSP provides |-----|--------|
- **oil.nvim** - file explorer that works like a buffer (edit filesystem like text) | `<space>?` | Search all keymaps |
- **zen-mode.nvim** - distraction-free writing/coding | `<C-/>` | Toggle terminal (project root, bottom of current window) |
| **AI** — `<space>a` | |
| `<space>aa` / `ac` | Toggle CLI / toggle Claude ([sidekick](https://github.com/folke/sidekick.nvim)) |
| `<space>as` / `ad` | Select CLI / detach session |
| `<space>at` / `af` / `av` | Send this / file / visual selection |
| `<space>ap` | Pick a prompt |
| `<C-.>` | Focus the sidekick terminal (any mode) |
| **Git** (Neogit) — `<space>g` | |
| `<space>gg` | Neogit status |
| `<space>gc` / `gl` / `gp` | Commit / log / push |
| **Harpoon** | |
| `<space>h` | Add file to harpoon |
| `<C-e>` | Harpoon menu |
| `<C-1>`…`<C-4>` | Jump to harpoon file 1–4 |
| **Other** | |
| `<space>cu` | Undotree |
| `<C-w><space>` | Window "hydra" mode (repeat window commands) |
## Behaviour changes from LazyVim
- 4-space indent everywhere (clangd fallback style matches); C/C++ has format-on-save **off**
(format manually with `<space>cf`)
- `nvim a b c` opens the files side by side
- Inactive windows are dimmed (vimade); markdown renders inline (markview)
+1 -5
View File
@@ -7,14 +7,10 @@
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) -- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") -- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
-- C/C++ uses 2-space indent to match clang-format's LLVM default -- Disable LazyVim's format-on-save for C/C++
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { "c", "cpp" }, pattern = { "c", "cpp" },
callback = function() callback = function()
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.softtabstop = 2
-- Disable LazyVim's format-on-save for C/C++
vim.b.autoformat = false vim.b.autoformat = false
end, end,
}) })
+10 -11
View File
@@ -2,14 +2,13 @@
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here -- Add any additional keymaps here
-- Terminal: open relative to current window (don't squash explorer) and smaller -- Terminal: open relative to current window (don't squash explorer) and smaller.
local terminal_opts = { -- Root is resolved on each press so it follows the current buffer's project.
cwd = LazyVim.root(), local function terminal()
win = { position = "bottom", height = 0.3, relative = "win" }, Snacks.terminal(nil, {
} cwd = LazyVim.root(),
vim.keymap.set({ "n", "t" }, "<c-/>", function() win = { position = "bottom", height = 0.3, relative = "win" },
Snacks.terminal(nil, terminal_opts) })
end, { desc = "Terminal (Root Dir)" }) end
vim.keymap.set({ "n", "t" }, "<c-_>", function() vim.keymap.set({ "n", "t" }, "<c-/>", terminal, { desc = "Terminal (Root Dir)" })
Snacks.terminal(nil, terminal_opts) vim.keymap.set({ "n", "t" }, "<c-_>", terminal, { desc = "which_key_ignore" })
end, { desc = "which_key_ignore" })
+1 -1
View File
@@ -30,7 +30,7 @@ require("lazy").setup({
version = false, -- always use the latest git commit version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver -- version = "*", -- try installing the latest stable version for plugins that support semver
}, },
install = { colorscheme = { "oxocarbon", "habamax" } }, install = { colorscheme = { "tokyonight", "habamax" } },
checker = { checker = {
enabled = true, -- check for plugin updates periodically enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update notify = false, -- notify on update
+3 -2
View File
@@ -12,8 +12,9 @@ return {
"--completion-style=detailed", "--completion-style=detailed",
"--function-arg-placeholders", "--function-arg-placeholders",
-- ColumnLimit: 0 = fix indentation only; keep existing line -- ColumnLimit: 0 = fix indentation only; keep existing line
-- breaks, never rewrap or join lines -- breaks, never rewrap or join lines. IndentWidth: 4 matches
"--fallback-style={BasedOnStyle: LLVM, ColumnLimit: 0}", -- the editor's shiftwidth
"--fallback-style={BasedOnStyle: LLVM, IndentWidth: 4, ColumnLimit: 0}",
}, },
}, },
}, },
-40
View File
@@ -1,40 +0,0 @@
return {
{
"coder/claudecode.nvim",
dependencies = { "folke/snacks.nvim" },
opts = {
terminal = {
provider = "snacks",
snacks_win_opts = {
relative = "win",
position = "bottom",
height = 0.3,
split_width_percentage = 0.99,
},
},
diff_opts = {
layout = "vertical",
open_in_new_tab = true,
keep_terminal_focus = true,
},
},
keys = {
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
{ "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" },
{ "<leader>ar", "<cmd>ClaudeCode --resume<cr>", desc = "Resume Claude" },
{ "<leader>aC", "<cmd>ClaudeCode --continue<cr>", desc = "Continue Claude" },
{ "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", desc = "Add current buffer" },
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
{
"<leader>as",
"<cmd>ClaudeCodeTreeAdd<cr>",
desc = "Add file",
ft = { "NvimTree", "neo-tree", "oil" },
},
-- Diff management
{ "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
{ "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" },
},
},
}
-12
View File
@@ -1,12 +0,0 @@
return {
{ "nyoom-engineering/oxocarbon.nvim", lazy = false, priority = 1000 },
{
"LazyVim/LazyVim",
opts = {
colorscheme = function()
vim.opt.background = "dark"
vim.cmd("colorscheme oxocarbon")
end,
},
},
}
+48
View File
@@ -0,0 +1,48 @@
return {
{
"folke/sidekick.nvim",
opts = {
-- next edit suggestions need the Copilot LSP
nes = { enabled = false },
},
keys = {
{
"<c-.>",
function() require("sidekick.cli").focus() end,
mode = { "n", "t", "i", "x" },
desc = "Sidekick Focus",
},
{ "<leader>aa", function() require("sidekick.cli").toggle() end, desc = "Toggle CLI" },
{
"<leader>ac",
function() require("sidekick.cli").toggle({ name = "claude", focus = true }) end,
desc = "Toggle Claude",
},
{
"<leader>as",
function() require("sidekick.cli").select({ filter = { installed = true } }) end,
desc = "Select CLI",
},
{ "<leader>ad", function() require("sidekick.cli").close() end, desc = "Detach CLI session" },
{
"<leader>at",
function() require("sidekick.cli").send({ msg = "{this}" }) end,
mode = { "n", "x" },
desc = "Send this",
},
{ "<leader>af", function() require("sidekick.cli").send({ msg = "{file}" }) end, desc = "Send file" },
{
"<leader>av",
function() require("sidekick.cli").send({ msg = "{selection}" }) end,
mode = "x",
desc = "Send selection",
},
{
"<leader>ap",
function() require("sidekick.cli").prompt() end,
mode = { "n", "x" },
desc = "Select prompt",
},
},
},
}
+4 -1
View File
@@ -5,9 +5,12 @@ return {
recipe = { "minimalist", { animate = true } }, recipe = { "minimalist", { animate = true } },
fadelevel = 0.8, fadelevel = 0.8,
blocklist = { blocklist = {
claude_terminal = { snacks_terminal = {
buf_opts = { ft = "snacks_terminal" }, buf_opts = { ft = "snacks_terminal" },
}, },
sidekick_terminal = {
buf_opts = { ft = "sidekick_terminal" },
},
}, },
}, },
} }
+10 -46
View File
@@ -1,60 +1,24 @@
-- LazyVim already defines all the default groups; only override what differs.
return { return {
{ {
"folke/which-key.nvim", "folke/which-key.nvim",
event = "VeryLazy",
opts_extend = { "spec" },
opts = { opts = {
preset = "helix", preset = "helix",
spec = { spec = {
{ { "<leader>a", group = "ai", mode = { "n", "v" }, icon = { icon = "󰚩", color = "green" } },
mode = { "n", "x" }, { "<leader>aa", icon = { icon = "󰆍", color = "green" } },
{ "<leader><tab>", group = "tabs" }, { "<leader>ac", icon = { icon = "󰧑", color = "orange" } },
{ "<leader>c", group = "code" }, { "<leader>as", icon = { icon = "󰉹", color = "azure" } },
{ "<leader>d", group = "debug" }, { "<leader>ad", icon = { icon = "󰅖", color = "red" } },
{ "<leader>dp", group = "profiler" }, { "<leader>at", icon = { icon = "󰆤", color = "yellow" }, mode = { "n", "x" } },
{ "<leader>f", group = "file/find" }, { "<leader>af", icon = { icon = "󰈙", color = "blue" } },
{ "<leader>g", group = "git" }, { "<leader>av", icon = { icon = "󰒅", color = "cyan" }, mode = "x" },
{ "<leader>gh", group = "hunks" }, { "<leader>ap", icon = { icon = "󰍩", color = "purple" }, mode = { "n", "x" } },
{ "<leader>q", group = "quit/session" },
{ "<leader>s", group = "search" },
{ "<leader>u", group = "ui" },
{ "<leader>x", group = "diagnostics/quickfix" },
{ "[", group = "prev" },
{ "]", group = "next" },
{ "g", group = "goto" },
{ "gs", group = "surround" },
{ "z", group = "fold" },
{
"<leader>b",
group = "buffer",
expand = function()
return require("which-key.extras").expand.buf()
end,
},
{
"<leader>w",
group = "windows",
proxy = "<c-w>",
expand = function()
return require("which-key.extras").expand.win()
end,
},
-- better descriptions
{ "gx", desc = "Open with system app" },
{ "gc", group = "comment", desc = "Toggle comment" },
},
}, },
}, },
keys = { keys = {
-- disable LazyVim's default <leader>? so the snacks keymaps picker owns it -- disable LazyVim's default <leader>? so the snacks keymaps picker owns it
{ "<leader>?", false }, { "<leader>?", false },
{
"<c-w><space>",
function()
require("which-key").show({ keys = "<c-w>", loop = true })
end,
desc = "Window Hydra Mode (which-key)",
},
}, },
}, },
} }
+1
View File
@@ -96,3 +96,4 @@ wine
mono mono
avahi avahi
tree-sitter-cli
+6
View File
@@ -161,6 +161,11 @@ uninstall_vim() {
remove_line "$HOME/.vimrc" "source ~/scripts/vimrc" remove_line "$HOME/.vimrc" "source ~/scripts/vimrc"
} }
uninstall_kde() {
echo "Uninstalling KDE (Hyprland-style) config..."
"$SCRIPTS_DIR/kde/apply.sh" --reset
}
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
usage usage
exit 1 exit 1
@@ -205,6 +210,7 @@ for target in "${targets[@]}"; do
tmux) uninstall_tmux ;; tmux) uninstall_tmux ;;
nvim) uninstall_nvim ;; nvim) uninstall_nvim ;;
vim) uninstall_vim ;; vim) uninstall_vim ;;
kde) uninstall_kde ;;
*) *)
echo "Unknown target: $target" echo "Unknown target: $target"
usage usage