This commit is contained in:
2026-07-12 15:25:55 -03:00
commit 29377d0c9a
160 changed files with 6138 additions and 0 deletions
@@ -0,0 +1,56 @@
{
inputs,
lib,
config,
pkgs,
...
}:
{
options.custom = {
alacritty.enable = lib.mkEnableOption "enable alacritty terminal emulator";
};
config = lib.mkIf config.custom.alacritty.enable {
programs.alacritty = {
enable = true;
settings = {
font = {
size = 10.3;
normal = {
family = "BerkeleyMono Nerd Font Mono";
};
bold = {
family = "BerkeleyMono Nerd Font Mono";
};
italic = {
family = "BerkeleyMono Nerd Font Mono";
};
bold_italic = {
family = "BerkeleyMono Nerd Font Mono";
};
};
window = {
decorations = "None";
opacity = 0.8;
blur = true;
dynamic_padding = true;
padding = {
x = 10;
y = 16;
};
};
keyboard = {
bindings = [
{
key = "Return";
mods = "Shift";
chars = "\u001B\r";
}
];
};
};
};
};
}
@@ -0,0 +1,169 @@
{ pkgs, ... }:
let
claude-code = pkgs.symlinkJoin {
name = "claude-code-wrapped";
paths = [ pkgs.claude-code ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/claude \
--suffix PATH : ${pkgs.lib.makeBinPath [ pkgs.python3 ]}
'';
};
in
{
home.packages = with pkgs; [
# ---- shell & core CLI ----
tree
worktrunk
zoxide
fzf
eza
fd
bc
wget
which
entr
stow
bat-extras.batman
bat-extras.batgrep
bat-extras.batdiff
bat-extras.batpipe
bat-extras.batwatch
bat-extras.prettybat
fastfetch
tldr
superfile
silicon
expect
jq
killall
gnupg
pinentry-gtk2
# nitch
# ---- editors & dev tooling ----
tree
ffmpeg
chromium
neovim
vim
tree-sitter
stylua
lua5_1
luarocks
ruby
git
gh
lazygit
tmux
sesh
serie
gcc
gnumake
pandoc
typst
tectonic
mkcert
sqlc
rainfrog
unzip
# Languages
go
cargo
php
julia
eslint_d
golangci-lint
rust-analyzer
imagemagick
ghostscript
ripgrep
gopls
typescript-language-server
nixfmt
# ---- cloud / infra ----
awscli2
kubectl
kubernetes-helm
k9s
kind
opentofu
hasura-cli
docker-compose
platformio
claude-code
jujutsu
# ---- hyprland / wayland desktop ----
hyprshot
waybar
wofi
wlogout
rofi
quickshell
grim
slurp
wl-clipboard
wl-color-picker
swayimg
wev
wiremix
matugen
dmenu-wayland
udiskie
networkmanagerapplet
pywal16
# swaync
# ---- theming & fonts ----
adw-gtk3
bibata-cursors
papirus-icon-theme
papirus-folders
rose-pine-hyprcursor
nwg-look
nerd-fonts.jetbrains-mono
noto-fonts-color-emoji
libsForQt5.qtstyleplugin-kvantum
# ---- GUI apps ----
obsidian
obs-cmd
qbittorrent
zathura
mpv
yt-dlp
libreoffice-fresh
evolution
slack
spotify
zoom-us
localsend
feishin
darktable
gthumb
kdePackages.kdenlive
shotcut
video-trimmer
kdePackages.dolphin
thunar
gnome-calendar
gnome-clocks
gnome-weather
pass
bluetuith
cameractrls
gphoto2
gnuplot
pnpm
hyprshutdown
sl
p7zip
# surfshark-client -> no package; use their generic linux app or wireguard configs
# tidaler, awww, hyprpwcenter, hyprshutdown
];
}
+129
View File
@@ -0,0 +1,129 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.custom.awww;
# Picks a random image from the (mutable) wallpaper dir at runtime and hands
# it to the running daemon. Only this script lives in the nix store — the
# images are read live on every cycle, so they are never copied into the store.
cycleScript = pkgs.writeShellScript "awww-cycle" ''
set -euo pipefail
dir="${cfg.wallpaperDir}"
if [ ! -d "$dir" ]; then
echo "awww-cycle: wallpaper dir '$dir' does not exist" >&2
exit 0
fi
# -L follows symlinks, so $dir (or files inside it) may be symlinks.
img="$(${pkgs.findutils}/bin/find -L "$dir" -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \
-o -iname '*.webp' -o -iname '*.bmp' -o -iname '*.gif' \) \
| ${pkgs.coreutils}/bin/shuf -n1)"
if [ -z "''${img:-}" ]; then
echo "awww-cycle: no images found in '$dir'" >&2
exit 0
fi
exec ${lib.getExe cfg.package} img "$img" \
--transition-type "${cfg.transition.type}" \
--transition-fps ${toString cfg.transition.fps} \
--transition-step ${toString cfg.transition.step} \
--transition-duration ${cfg.transition.duration}
'';
in
{
options.custom.awww = {
enable = lib.mkEnableOption "awww (ex-swww) animated wallpaper daemon with timed random cycling";
package = lib.mkPackageOption pkgs "awww" { };
wallpaperDir = lib.mkOption {
type = lib.types.str;
default = "${config.home.homeDirectory}/Wallpapers";
description = ''
Directory scanned at runtime for wallpapers. Its contents are read live on
every cycle and are never copied into the nix store, so you can add, remove
or edit images freely without a rebuild. Symlinks are followed.
'';
};
interval = lib.mkOption {
type = lib.types.str;
default = "15min";
example = "1h";
description = "How often to switch wallpaper, as a systemd time span.";
};
transition = {
type = lib.mkOption {
type = lib.types.str;
default = "random";
example = "grow";
description = "awww --transition-type (random, grow, wipe, fade, simple, outer, center, any, ...).";
};
fps = lib.mkOption {
type = lib.types.int;
default = 60;
description = "awww --transition-fps.";
};
step = lib.mkOption {
type = lib.types.int;
default = 90;
description = "awww --transition-step (how abruptly the transition advances).";
};
duration = lib.mkOption {
type = lib.types.str;
default = "1.5";
description = "awww --transition-duration, in seconds.";
};
};
};
config = lib.mkIf cfg.enable {
# Runs awww-daemon as a systemd user service, bound to graphical-session.target
# and gated on WAYLAND_DISPLAY. Also installs the awww package.
services.awww = {
enable = true;
inherit (cfg) package;
};
# Ensure the wallpaper directory exists (left empty and mutable — you own it).
home.activation.createWallpaperDir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run mkdir -p ${lib.escapeShellArg cfg.wallpaperDir}
'';
# Oneshot that sets a single random wallpaper. Waits for the daemon to be up.
systemd.user.services.awww-cycle = {
Unit = {
Description = "Set a random wallpaper via awww";
After = [ "awww.service" ];
Requires = [ "awww.service" ];
PartOf = [ config.wayland.systemd.target ];
};
Service = {
Type = "oneshot";
ExecStart = "${cycleScript}";
};
};
# Timer that fires the oneshot shortly after login and then every ${interval}.
# Tied to the graphical session, so it starts/stops with Hyprland.
systemd.user.timers.awww-cycle = {
Unit = {
Description = "Cycle wallpaper every ${cfg.interval} via awww";
PartOf = [ config.wayland.systemd.target ];
};
Timer = {
OnActiveSec = "3s";
OnUnitActiveSec = cfg.interval;
};
Install.WantedBy = [ config.wayland.systemd.target ];
};
};
}
+17
View File
@@ -0,0 +1,17 @@
{ lib, config, ... }:
{
options.custom = {
bat.enable = lib.mkEnableOption "enable bat - color cat alternative";
};
config = lib.mkIf config.custom.bat.enable {
programs.bat = {
enable = true;
config = {
theme = "ansi";
style = "numbers,changes";
};
};
};
}
+240
View File
@@ -0,0 +1,240 @@
{
inputs,
lib,
config,
pkgs,
...
}:
{
accounts = {
calendar = {
basePath = "${config.home.homeDirectory}/.calendars";
accounts = {
inbox = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/3a35411d-3b32-854e-9a57-1cca5510fd8e/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "light blue";
};
};
avodah = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/f3901be0-8dca-7856-d1cb-fe7869e92c1e/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "light red";
};
};
casa = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/4f26caba-3134-4253-cdb6-16d34df2a109/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "dark red";
};
};
exercicio = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/773de611-4f21-053f-e916-f48f1b3f0e24/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "dark green";
};
};
familia = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/4fb446ab-33a1-1a91-c009-5b69316c8cea/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "dark blue";
};
};
saude = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/4b455515-de59-2bdb-9e51-aee5a1a2d960/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "light magenta";
};
};
teleo = {
remote = {
type = "caldav";
url = "https://cal.joaoporta.com/jpporta/dd52bfd0-c8c4-2d7b-6469-25244f69fe3a/";
userName = "jpporta";
passwordCommand = [
"pass"
"show"
"personal/caldav"
];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
vdirsyncer = {
enable = true;
collections = null;
conflictResolution = "remote wins";
metadata = [
"color"
"displayname"
];
};
khal = {
enable = true;
type = "calendar";
color = "yellow";
};
};
};
};
};
}
+41
View File
@@ -0,0 +1,41 @@
{
inputs,
lib,
config,
pkgs,
...
}:
{
imports = [
./accounts.nix
];
options.custom = {
jpporta-calendars.enable = lib.mkEnableOption "enable personal jpporta calendars";
};
config = lib.mkIf config.custom.jpporta-calendars.enable {
programs = {
vdirsyncer.enable = true;
khal = {
enable = true;
locale = {
timeformat = "%H:%M";
dateformat = "%Y-%m-%d";
longdateformat = "%Y-%m-%d";
datetimeformat = "%Y-%m-%d %H:%M";
longdatetimeformat = "%Y-%m-%d %H:%M";
};
};
};
services.vdirsyncer = {
enable = true;
frequency = "*:0/15"; # every 15 minutes; systemd OnCalendar format
};
};
}
+29
View File
@@ -0,0 +1,29 @@
{ lib, config, ... }:
{
options.custom = {
cedilla.enable = lib.mkEnableOption "enable cedilla - apply Compose configuration for cedilla";
};
config = lib.mkIf config.custom.cedilla.enable {
home.file.".XCompose".text = ''
include "%L"
<dead_acute> <c> : "ç" ccedilla
<dead_acute> <C> : "Ç" Ccedilla
'';
systemd.user.services.fcitx5 = {
Unit = {
Description = "Fcitx5 input method";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "/run/current-system/sw/bin/fcitx5";
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};
};
}
+69
View File
@@ -0,0 +1,69 @@
{
lib,
config,
pkgs,
...
}:
let
schemaDir = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-${pkgs.gsettings-desktop-schemas.version}/glib-2.0/schemas";
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
ensureHis = ''
if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
export HYPRLAND_INSTANCE_SIGNATURE="$(${pkgs.coreutils}/bin/ls -t "$XDG_RUNTIME_DIR/hypr" | ${pkgs.coreutils}/bin/head -n1)"
fi
'';
hyprsunsetEnabled = config.custom.hyprsunset.enable or false;
in
{
options.custom = {
darkman.enable = lib.mkEnableOption "enable darkman - auto dark/light switch";
};
config = lib.mkIf config.custom.darkman.enable {
home.packages = with pkgs; [
glib
gsettings-desktop-schemas
];
services.darkman = {
enable = true;
settings = {
lat = -22.48;
lng = -47.08;
usegeoclue = false;
};
darkModeScripts = {
gtk-theme = ''
export GSETTINGS_SCHEMA_DIR=${schemaDir}
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'
'';
}
// lib.optionalAttrs hyprsunsetEnabled {
hyprsunset = ''
${ensureHis}
${hyprctl} hyprsunset temperature 4000
${hyprctl} hyprsunset gamma 85
'';
};
lightModeScripts = {
gtk-theme = ''
export GSETTINGS_SCHEMA_DIR=${schemaDir}
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
'';
}
// lib.optionalAttrs hyprsunsetEnabled {
hyprsunset = ''
${ensureHis}
${hyprctl} hyprsunset identity
${hyprctl} hyprsunset gamma 100
'';
};
};
};
}
+168
View File
@@ -0,0 +1,168 @@
{ config, lib, pkgs, ... }:
let
cfg = config.custom.dictation;
# AMD GPU: Vulkan backend (works on any RADV-capable Radeon, no ROCm stack).
# Swap to { rocmSupport = true; } if you'd rather use ROCm (see notes).
whisper = pkgs.whisper-cpp.override { vulkanSupport = true; };
# Declaratively pinned GGML model. Build once with the default fakeHash and
# paste back the sha256 Nix reports.
model = pkgs.fetchurl {
url = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-${cfg.model}.bin";
hash = cfg.modelHash;
};
port = toString cfg.port;
histRel = "dictation/history.jsonl";
dictate = pkgs.writeShellApplication {
name = "dictate-toggle";
runtimeInputs = with pkgs; [ pipewire curl jq wtype wl-clipboard libnotify coreutils ];
text = ''
# -c / --clipboard: put the transcript on the clipboard instead of typing it.
clipboard=0
case "''${1:-}" in
-c|--clipboard) clipboard=1 ;;
esac
run="''${XDG_RUNTIME_DIR:-/tmp}"
pid="$run/dictate.pid"
wav="$run/dictate.wav"
hist="''${XDG_STATE_HOME:-$HOME/.local/state}/${histRel}"
if [ -f "$pid" ] && kill -0 "$(cat "$pid")" 2>/dev/null; then
# ---- second press: stop, transcribe, type ----
kill "$(cat "$pid")" 2>/dev/null || true
rm -f "$pid"
sleep 0.2
# ignore fat-finger taps (<~0.5s @ 16kHz*2B mono = 16000 bytes)
bytes="$(stat -c%s "$wav" 2>/dev/null || echo 0)"
if [ "$bytes" -lt 16000 ]; then
notify-send -t 1000 -a dictation "🎤 too short"
rm -f "$wav"; exit 0
fi
notify-send -t 1200 -a dictation "🧠 transcribing"
args=(-sS "http://127.0.0.1:${port}/inference"
-F file=@"$wav" -F temperature=0 -F response_format=json
-F language=${cfg.language})
result="$(curl "''${args[@]}" | jq -r '.text' \
| tr '\n' ' ' \
| sed -e 's/ */ /g' -e 's/^ *//' -e 's/ *$//')"
if [ -n "$result" ]; then
# log it (newest last), then keep only the most recent N entries
mkdir -p "$(dirname "$hist")"
jq -cn --arg ts "$(date -Is)" --arg text "$result" \
'{ts: $ts, text: $text}' >> "$hist"
tmp="$(mktemp -p "$(dirname "$hist")")"
tail -n ${toString cfg.historyMax} "$hist" > "$tmp" && mv -f "$tmp" "$hist"
if [ "$clipboard" -eq 1 ]; then
printf '%s' "$result" | wl-copy
notify-send -t 1500 -a dictation "📋 copied to clipboard"
else
wtype -- "$result"
fi
fi
rm -f "$wav"
else
# ---- first press: start recording ----
rm -f "$wav"
pw-record --rate 16000 --channels 1 --format s16 "$wav" &
echo "$!" > "$pid"
notify-send -t 1200 -a dictation "🎤 recording F5 to stop"
fi
'';
};
history = pkgs.writeShellApplication {
name = "dictate-history";
runtimeInputs = with pkgs; [ jq rofi wl-clipboard libnotify coreutils ];
text = ''
hist="''${XDG_STATE_HOME:-$HOME/.local/state}/${histRel}"
if [ ! -s "$hist" ]; then
notify-send -t 1500 -a dictation "📋 no dictation history yet"
exit 0
fi
# newest first; keep full texts and menu rows index-aligned
mapfile -t texts < <(tac "$hist" | jq -r '.text')
mapfile -t menu < <(tac "$hist" | jq -r '
(.ts[5:16] | sub("T"; " ")) as $t
| (if (.text | length) > 60 then .text[0:60] + "" else .text end) as $p
| "\($t) \($p)"')
idx="$(printf '%s\n' "''${menu[@]}" \
| rofi -dmenu -i -format i -p "dictation" || true)"
[[ "$idx" =~ ^[0-9]+$ ]] || exit 0
printf '%s' "''${texts[$idx]}" | wl-copy
notify-send -t 1500 -a dictation "📋 copied to clipboard"
'';
};
in
{
options.custom.dictation = {
enable = lib.mkEnableOption "local F5 push-to-talk dictation (whisper.cpp + wtype)";
model = lib.mkOption {
type = lib.types.str;
default = "large-v3";
description = ''GGML model stem, e.g. "large-v3" or "large-v3-turbo".'';
};
modelHash = lib.mkOption {
type = lib.types.str;
default = lib.fakeHash;
description = "sha256 of the model. Build once with the default, paste the reported hash.";
};
language = lib.mkOption {
type = lib.types.str;
default = "auto";
description = ''Pin a language ("en", "pt") or "auto" to detect per utterance.'';
};
port = lib.mkOption {
type = lib.types.port;
default = 8117;
};
historyMax = lib.mkOption {
type = lib.types.int;
default = 1000;
description = "Keep only the most recent N transcriptions in the history log.";
};
};
config = lib.mkIf cfg.enable {
home.packages = [ dictate history whisper ]; # whisper-cli also available for testing
systemd.user.services.whisper-server = {
Unit = {
Description = "whisper.cpp server (keeps the model warm in VRAM)";
After = [ "graphical-session.target" ];
};
Service = {
# If your build names it 'whisper-whisper-server', adjust the path below
# (nixpkgs has occasionally double-prefixed it). `ls ${whisper}/bin`.
ExecStart = lib.escapeShellArgs [
"${whisper}/bin/whisper-server"
"--model" "${model}"
"--host" "127.0.0.1"
"--port" port
"--max-len" "100000" # default 0 is silently coerced to 60; large = don't chop
];
Restart = "on-failure";
};
Install.WantedBy = [ "default.target" ];
};
};
}
+224
View File
@@ -0,0 +1,224 @@
{ lib, config, ... }:
{
options.custom = {
fastfetch.enable = lib.mkEnableOption "enable fastfetch - system prompt decoration";
};
config = lib.mkIf config.custom.fastfetch.enable {
programs.fastfetch = {
enable = true;
settings = {
logo = {
source = "nixos_small";
padding = {
top = 4;
left = 0;
right = 2;
};
position = "right";
};
display = {
stat = false;
pipe = false;
showErrors = false;
disableLinewrap = true;
hideCursor = false;
separator = ": ";
color = {
keys = "";
title = "";
output = "";
separator = "";
};
brightColor = true;
duration = {
abbreviation = false;
spaceBeforeUnit = "default";
};
size = {
maxPrefix = "YB";
binaryPrefix = "iec";
ndigits = 2;
spaceBeforeUnit = "default";
};
temp = {
unit = "D";
ndigits = 1;
color = {
green = 32;
yellow = 93;
red = 91;
};
spaceBeforeUnit = "default";
};
percent = {
type = [
"num"
"num-color"
];
ndigits = 0;
color = {
green = 32;
yellow = 93;
red = 91;
};
spaceBeforeUnit = "default";
width = 0;
};
bar = {
char = {
elapsed = "";
total = "-";
};
border = {
left = "[ ";
right = " ]";
leftElapsed = "";
rightElapsed = "";
};
color = {
elapsed = "auto";
total = 97;
border = 97;
};
width = 10;
};
fraction = {
ndigits = 2;
};
noBuffer = false;
key = {
width = 0;
type = "string";
paddingLeft = 0;
};
freq = {
ndigits = 2;
spaceBeforeUnit = "default";
};
constants = [ ];
};
general = {
thread = true;
processingTimeout = 5000;
detectVersion = true;
playerName = "";
dsForceDrm = false;
};
modules = [
{
type = "title";
key = "";
keyIcon = "";
fqdn = false;
color = {
user = "";
at = "";
host = "";
};
}
{
type = "separator";
string = "-";
outputColor = "";
times = 0;
}
{
type = "os";
keyIcon = "";
}
{
type = "uptime";
keyIcon = "";
}
{
type = "shell";
keyIcon = "";
}
{
type = "display";
keyIcon = "󰍹";
compactType = "none";
preciseRefreshRate = false;
order = null;
}
{
type = "wm";
keyIcon = "";
detectPlugin = false;
}
{
type = "terminal";
keyIcon = "";
}
{
type = "terminalfont";
keyIcon = "";
}
{
type = "cpu";
keyIcon = "";
temp = false;
showPeCoreCount = false;
}
{
type = "gpu";
keyIcon = "󰾲";
driverSpecific = false;
detectionMethod = "pci";
temp = true;
hideType = "none";
percent = {
green = 50;
yellow = 80;
type = 0;
};
}
{
type = "memory";
keyIcon = "";
percent = {
green = 50;
yellow = 80;
type = 0;
};
}
{
type = "disk";
keyIcon = "";
showRegular = true;
showExternal = true;
showHidden = false;
showSubvolumes = false;
showReadOnly = true;
showUnknown = false;
folders = "";
hideFolders = [
"/efi"
"/boot"
"/boot/*"
];
hideFS = "";
useAvailable = false;
percent = {
green = 50;
yellow = 80;
type = 0;
};
}
{ }
{
type = "colors";
key = "";
keyIcon = "";
symbol = "block";
paddingLeft = 0;
block = {
width = 3;
range = "[0, 15]";
};
}
];
};
};
};
}
+43
View File
@@ -0,0 +1,43 @@
{
config,
lib,
pkgs,
...
}:
{
options.custom = {
hypridle.enable = lib.mkEnableOption "enable hypridle - screen lock";
};
config = lib.mkIf config.custom.hypridle.enable {
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 600;
on-timeout = "loginctl lock-session";
}
{
timeout = 660;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
};
}
+332
View File
@@ -0,0 +1,332 @@
{
config,
lib,
pkgs,
...
}:
let
dotfiles = "${config.home.homeDirectory}/nixos-config/modules/home-manager/hyprland/hypr";
in
{
options.custom.hyprland.enable = lib.mkEnableOption "Hyprland user config";
config = lib.mkIf config.custom.hyprland.enable {
systemd.user.targets.hyprland-session = {
Unit = {
Description = "hyprland compositor session";
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ];
};
};
wayland.windowManager.hyprland.settings.input.numlock_by_default = true;
xdg.configFile."hypr/hyprland.lua".text = ''
local home = os.getenv("HOME")
local config_dir = home .. "/.config/hypr"
package.path = config_dir .. "/?.lua;" .. config_dir .. "/?/init.lua;" .. package.path
-- Monitors ----------------------------------------
hl.monitor({
output = "DP-1",
mode = "1920x1080@239.96Hz",
position = "1080x0",
scale = 1,
})
-- Looks ----------------------------------------
hl.env("HYPRCURSOR_THEME", "Bibata-Modern-Ice-Right")
hl.env("HYPRCURSOR_SIZE", "24")
hl.config({
input = {
kb_layout = "us,us",
kb_variant = ",intl",
kb_options = "grp:alt_shift_toggle",
},
general = {
gaps_in = 7,
gaps_out = 10,
border_size = 2,
col = {
active_border = "rgba(ebcc71ff)",
inactive_border = "rgba(54461eff)",
},
layout = "dwindle",
},
scrolling = {
fullscreen_on_one_column = true,
column_width = 0.95,
focus_fit_method = 0,
},
dwindle = {
preserve_split = true,
},
master = {
new_status = "slave",
allow_small_split = false,
special_scale_factor = 0.75,
mfact = 0.40,
orientation = "center",
new_on_top = true,
},
})
hl.device({
name = "8bitdo-retro-18-numpad-keyboard",
kb_options = "numpad:mac",
numlock_by_default = true,
})
hl.config({
decoration = {
rounding = 15,
rounding_power = 2,
active_opacity = 1.0,
inactive_opacity = 0.75,
fullscreen_opacity = 1.0,
blur = {
enabled = true,
size = 1,
passes = 2,
new_optimizations = true,
vibrancy = 0.5,
vibrancy_darkness = 0.2,
},
shadow = {
enabled = true,
range = 15,
render_power = 3,
color = "rgba(121212aa)",
},
},
})
hl.layer_rule({
name = "swaync-control-center-blur",
match = { namespace = "swaync-control-center" },
blur = true,
dim_around = true,
ignore_alpha = 0.5,
no_screen_share = true,
})
hl.layer_rule({
name = "swaync-notification-blur",
match = { namespace = "swaync-notification-window" },
blur = true,
ignore_alpha = 0.5,
no_screen_share = true,
})
-- Animations ----------------------------------------
hl.config({ animations = { enabled = true } })
-- Bezier curves
hl.curve("easeOutQuint", { type = "bezier", points = { { 0.23, 1 }, { 0.32, 1 } } })
hl.curve("easeInOutCubic", { type = "bezier", points = { { 0.65, 0.05 }, { 0.36, 1 } } })
hl.curve("linear", { type = "bezier", points = { { 0, 0 }, { 1, 1 } } })
hl.curve("almostLinear", { type = "bezier", points = { { 0.5, 0.5 }, { 0.75, 1 } } })
hl.curve("quick", { type = "bezier", points = { { 0.15, 0 }, { 0.1, 1 } } })
-- Animations
hl.animation({ leaf = "global", enabled = true, speed = 10, bezier = "default" })
hl.animation({ leaf = "border", enabled = true, speed = 5.39, bezier = "easeOutQuint" })
hl.animation({ leaf = "windows", enabled = true, speed = 4.79, bezier = "easeOutQuint" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 4.1, bezier = "easeOutQuint", style = "popin 95%" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 1.49, bezier = "linear", style = "popin 95%" })
hl.animation({ leaf = "fadeIn", enabled = true, speed = 1.73, bezier = "almostLinear" })
hl.animation({ leaf = "fadeOut", enabled = true, speed = 1.46, bezier = "almostLinear" })
hl.animation({ leaf = "fade", enabled = true, speed = 3.03, bezier = "quick" })
hl.animation({ leaf = "layers", enabled = true, speed = 3.81, bezier = "easeOutQuint" })
hl.animation({ leaf = "layersIn", enabled = true, speed = 4, bezier = "easeOutQuint", style = "fade" })
hl.animation({ leaf = "layersOut", enabled = true, speed = 1.5, bezier = "linear", style = "fade" })
hl.animation({ leaf = "fadeLayersIn", enabled = true, speed = 1.79, bezier = "almostLinear" })
hl.animation({ leaf = "fadeLayersOut", enabled = true, speed = 1.39, bezier = "almostLinear" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 1.94, bezier = "almostLinear", style = "slidefade 10%" })
hl.animation({ leaf = "workspacesIn", enabled = true, speed = 1.21, bezier = "almostLinear", style = "slidefade 10%" })
hl.animation({ leaf = "workspacesOut", enabled = true, speed = 1.94, bezier = "almostLinear", style = "slidefade 10%" })
-- Autostart ----------------------------------------
hl.on("hyprland.start", function()
hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE")
hl.exec_cmd("systemctl --user start hyprland-session.target")
hl.exec_cmd("waybar")
hl.exec_cmd("hypridle")
hl.exec_cmd("swaync")
hl.exec_cmd("hyprctl setcursor Bibata-Modern-Ice-Right 24")
end)
-- Programs ----------------------------------------
local p = {
terminal = "alacritty",
file_manager = "thunar",
menu = "pkill rofi || " .. home .. "/.config/rofi/launchers/type-7/launcher.sh",
logout_menu = "wlogout -b 5 -T 400 -B 400",
toggle_notifications = "swaync-client -t -sw",
screen_ocr = home .. "/.local/bin/read-screen",
}
-- Binds ----------------------------------------
local mod = "SUPER"
local mod_shft = "SUPER + SHIFT"
local mod_ctrl = "SUPER + CTRL"
local mod_alt = "SUPER + ALT"
-- ---------- App launchers / global actions ----------
hl.bind(mod .. " + Return", hl.dsp.exec_cmd(p.terminal))
hl.bind(mod .. " + Q", hl.dsp.window.close())
hl.bind(mod_shft .. " + Q", hl.dsp.exec_cmd("killall zoom"))
hl.bind(mod .. " + E", hl.dsp.exec_cmd(p.file_manager))
hl.bind(mod .. " + V", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mod .. " + F", hl.dsp.window.fullscreen())
hl.bind(mod .. " + M", hl.dsp.layout("togglesplit")) -- dwindle
hl.bind(mod .. " + N", hl.dsp.exec_cmd(p.toggle_notifications))
hl.bind(mod .. " + Space", hl.dsp.exec_cmd(p.menu))
hl.bind("CTRL + ALT + DELETE", hl.dsp.exec_cmd(p.logout_menu))
-- ---------- Focus movement (vim) ----------
hl.bind(mod .. " + H", hl.dsp.focus({ direction = "left" }))
hl.bind(mod .. " + L", hl.dsp.focus({ direction = "right" }))
hl.bind(mod .. " + K", hl.dsp.focus({ direction = "up" }))
hl.bind(mod .. " + J", hl.dsp.focus({ direction = "down" }))
-- ---------- Move window ----------
hl.bind(mod_shft .. " + H", hl.dsp.window.move({ direction = "left" }))
hl.bind(mod_shft .. " + L", hl.dsp.window.move({ direction = "right" }))
hl.bind(mod_shft .. " + K", hl.dsp.window.move({ direction = "up" }))
hl.bind(mod_shft .. " + J", hl.dsp.window.move({ direction = "down" }))
-- ---------- Splitratio (dwindle layoutmsg) ----------
hl.bind(mod .. " + comma", hl.dsp.layout("splitratio -0.1"))
hl.bind(mod .. " + period", hl.dsp.layout("splitratio 0.1"))
-- ---------- Workspaces (Y U I O P -> 1..5) ----------
local ws_keys = { Y = 1, U = 2, I = 3, O = 4, P = 5 }
for key, ws in pairs(ws_keys) do
hl.bind(mod .. " + " .. key, hl.dsp.focus({ workspace = ws }))
hl.bind(mod_shft .. " + " .. key, hl.dsp.window.move({ workspace = ws }))
end
-- ---------- Special workspace (scratchpad) ----------
hl.bind(mod .. " + S", hl.dsp.workspace.toggle_special("magic"))
hl.bind(mod_shft .. " + S", hl.dsp.window.move({ workspace = "special:magic" }))
-- ---------- Workspace scroll ----------
hl.bind(mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
-- ---------- Mouse drag/resize ----------
hl.bind(mod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- ---------- Multimedia (locked + repeating) ----------
local el = { locked = true, repeating = true }
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), el)
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), el)
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), el)
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), el)
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 10%+"), el)
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 10%-"), el)
-- ---------- Media (locked, no repeat) ----------
local l = { locked = true }
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), l)
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), l)
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), l)
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), l)
-- ---------- Screenshots ----------
hl.bind(mod_shft .. " + 2", hl.dsp.exec_cmd("hyprshot -m output -m DP-1 -o ~/Pictures/Screenshots"))
hl.bind(mod_shft .. " + 3", hl.dsp.exec_cmd("hyprshot -m window -m active -o ~/Pictures/Screenshots"))
hl.bind(mod_shft .. " + 4", hl.dsp.exec_cmd("hyprshot -m region -o ~/Pictures/Screenshots"))
-- ---------- OBS Recording ----------
hl.bind(mod_shft .. " + 9", hl.dsp.exec_cmd("obs-cmd recording toggle"))
hl.bind(mod .. " + 9", hl.dsp.exec_cmd("obs-cmd recording toggle-pause"))
-- Disable animations on the screenshot selection layer
hl.layer_rule({
name = "no-anim-selection",
match = { namespace = "selection" },
no_anim = true,
})
hl.bind(mod_shft .. " + 0", hl.dsp.exec_cmd(p.screen_ocr))
-- ---------- Lock / suspend ----------
hl.bind(mod_alt .. " + L", hl.dsp.exec_cmd("hyprlock"))
hl.bind(mod .. " + ALT + CTRL + L", hl.dsp.exec_cmd("systemctl suspend"))
-- ---------- Waybar reload ----------
hl.bind(mod_alt .. " + R", hl.dsp.exec_cmd("/home/jpporta/.config/waybar/scripts/launch.sh"))
-- ---------- Dictation ----------
hl.bind(mod .. " + code:71", hl.dsp.exec_cmd("dictate-toggle"))
hl.bind(mod .. " + code:72", hl.dsp.exec_cmd("dictate-history"))
hl.bind(mod_shft .. " + code:71", hl.dsp.exec_cmd("dictate-toggle -c"))
-- ---------- misc ----------
hl.config({
misc = {
force_default_wallpaper = 0,
disable_hyprland_logo = true,
},
})
-- ---------- window rules ----------
-- Zoom Behave -----------
hl.window_rule({
match = { class = "^zoom$", title = "^annotate_toolbar$" },
float = true,
})
hl.window_rule({
match = { class = "^zoom$" },
no_blur = true,
border_size = 0,
no_initial_focus = true,
no_shadow = true,
})
-- Ignore maximize requests from apps.
hl.window_rule({
name = "Ignore Maximize Requests",
match = { class = ".*" },
suppress_event = "maximize",
})
-- Fix some dragging issues with XWayland.
hl.window_rule({
name = "XWayland Drag Fix",
match = {
xwayland = 1,
title = "^$",
class = "^$",
float = true,
fullscreen = false,
pin = false,
},
no_focus = true,
})
hl.window_rule({
name = "Pinentry Center",
match = { class = "^(pinentry-.*)$" },
float = true,
center = true,
stay_focused = true,
})
-- Picture-in-Picture: pinned floating mini-player in bottom-right quadrant.
hl.window_rule({
name = "PIP",
match = { title = "Picture-in-Picture" },
pin = 1,
float = 1,
size = "(monitor_w/4) (monitor_h/4)",
move = "(3*monitor_w/4)-22 (monitor_h-window_h-22)",
})
hl.env("QT_QPA_PLATFORMTHEME", "hyprqt6engine")
'';
};
}
+105
View File
@@ -0,0 +1,105 @@
{
config,
lib,
pkgs,
...
}:
let
font = "BerkeleyMono Nerd Font Mono";
monitor = "DP-1";
bg = "rgba(1d202144)"; # hard dark background
bg1 = "rgb(3c3836)"; # input fill
fg = "rgb(ebdbb2)"; # main text
muted = "rgb(928374)"; # dim text
orange = "rgb(fe8019)"; # accent — echoes your rofi orange
yellow = "rgb(fabd2f)"; # caps-lock
green = "rgb(b8bb26)"; # correct password
red = "rgb(fb4934)"; # wrong password
in
{
options.custom = {
hyprlock.enable = lib.mkEnableOption "enable hyprlock - lock splash screen";
};
config = lib.mkIf config.custom.hyprlock.enable {
programs.hyprlock = {
enable = true;
settings = {
general = {
hide_cursor = true;
ignore_empty_input = true;
# grace = 2 # seconds to dismiss with mouse before a password is required
};
# ---------- Background ----------
background = {
monitor = "${monitor}";
color = "${bg}";
# Prefer a wallpaper? drop `color` above and use:
# path = ~/nixos-config/wallpapers/lock.png
# blur_passes = 3
# blur_size = 6
};
# ---------- Clock ----------
label = [
{
monitor = "${monitor}";
text = "$TIME";
color = "${fg}";
font_size = 96;
font_family = "${font}";
position = "0, 120";
halign = "center";
valign = "center";
}
{
monitor = "${monitor}";
text = "cmd[update:60000] date +\"%A, %d %B\"";
color = "${muted}";
font_size = 18;
font_family = "${font}";
position = "0, 48";
halign = "center";
valign = "center";
}
{
monitor = "${monitor}";
text = "Hey, $USER";
color = "${orange}";
font_size = 16;
font_family = "${font}";
position = "0, -20";
halign = "center";
valign = "center";
}
];
# ---------- Input field ----------
input-field = {
monitor = "${monitor}";
size = "300, 54";
rounding = 14;
outline_thickness = 2;
dots_size = 0.25;
dots_spacing = 0.3;
dots_center = true;
outer_color = "${orange}";
inner_color = "${bg1}";
font_color = "${fg}";
check_color = "${green}";
fail_color = "${red}";
capslock_color = "${yellow}";
fade_on_empty = false;
placeholder_text = "<span foreground=\"##928374\"><i>󰌾 Enter password</i></span>";
fail_text = "<span foreground=\"##fb4934\"><i>$FAIL ($ATTEMPTS)</i></span>";
position = "0, -95";
halign = "center";
valign = "center";
};
};
};
};
}
@@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
let
font = "BerkeleyMono Nerd Font Mono";
monitor = "DP-1";
in{
options.custom = {
hyprpaper.enable = lib.mkEnableOption "enable hyprpaper - wallpaper manager";
};
config = lib.mkIf config.custom.hyprpaper.enable {
services.hyprpaper = {
enable = true;
settings = {
splash = false;
wallpaper = [
{
fit_mode = "cover";
monitor = "DP-1";
path = "/home/jpporta/dotfiles/colorschemes/.config/colorschemes/gruvbox-dark/wallpapers/wallhaven-9oxg98.jpg";
}
];
};
};
};
}
@@ -0,0 +1,36 @@
{
config,
lib,
pkgs,
...
}:
{
options.custom = {
hyprsunset.enable = lib.mkEnableOption "enable hyprsunset - eye saver";
};
config = lib.mkIf config.custom.hyprsunset.enable {
services.hyprsunset = {
enable = true;
settings = {
max-gamma = 150;
# profile = [
# {
# time = "7:30";
# identity = true;
# }
# {
# time = "18:00";
# temperature = 4000;
# gamma = 1;
# }
# {
# time = "20:00";
# temperature = 4000;
# gamma = 0.8;
# }
# ];
};
};
};
}
+16
View File
@@ -0,0 +1,16 @@
{ lib, config, pkgs, ... }:
{
options.custom = {
nvim.enable = lib.mkEnableOption "enable nvim - symlink config files";
};
config = lib.mkIf config.custom.nvim.enable {
home.packages = with pkgs; [
neovim
fzf
];
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nixos-config/modules/home-manager/nvim/nvim";
};
}
+27
View File
@@ -0,0 +1,27 @@
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.opt.termguicolors = true
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stayle release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.g.language = "en_US"
require("lazy").setup("plugins")
require("jpporta.autocommands")
require("jpporta.remaps")
require("jpporta.sets")
require("jpporta.lsp")
require("jpporta.theme")
require("jpporta.snippets")
require("jpporta.macros")
@@ -0,0 +1,72 @@
{
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
"base16-nvim": { "branch": "master", "commit": "21233d5fd574439ae1e2f5e4bfbc574214f4ab3d" },
"catppuccin": { "branch": "main", "commit": "05e8787020dcfdb937bf2ff23855ea2415b4e072" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"cobalt2.nvim": { "branch": "main", "commit": "0cc17f3491feba19ed62b2d9622577f7822a0113" },
"colorbuddy.nvim": { "branch": "master", "commit": "cdb5b0654d3cafe61d2a845e15b2b4b0e78e752a" },
"copilot.vim": { "branch": "release", "commit": "a12fd5672110c8aa7e3c8419e28c96943ca179be" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dracula.nvim": { "branch": "main", "commit": "ae752c13e95fb7c5f58da4b5123cb804ea7568ee" },
"everforest": { "branch": "master", "commit": "85a86eb62409e3ec88713bff3d1b9d7374e112e4" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"git-blame.nvim": { "branch": "main", "commit": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7" },
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
"gruvbox.nvim": { "branch": "main", "commit": "154eb5ff5b96d0641307113fa385eaf0d36d9796" },
"icalendar.vim": { "branch": "master", "commit": "542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f" },
"kanagawa.nvim": { "branch": "master", "commit": "bb85e4bfc8d89b0e62c8fa53ccdd13d12e2f77b3" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
"leetcode.nvim": { "branch": "master", "commit": "4e8b3683940a8377379ce9398e7f329e3560b42c" },
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
"lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
"mini.comment": { "branch": "main", "commit": "27a29d6b949b9497f80a0a03421e89fed71d8c37" },
"mini.nvim": { "branch": "main", "commit": "928971c3cfe99ddf29659acc31214cfa836fabe4" },
"monochrome.nvim": { "branch": "main", "commit": "2de78d9688ea4a177bcd9be554ab9192337d35ff" },
"monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" },
"neoformat": { "branch": "master", "commit": "9d95e5ca3ab263363758d5b1d7a174a30556ab2d" },
"neovim": { "branch": "main", "commit": "ff483051a47e27d84bdef47703538df1ed9f4a47" },
"neovim-ayu": { "branch": "master", "commit": "e5a9f0fa2918d6b5f57c21b3ac014314ee5e41c8" },
"nightfox.nvim": { "branch": "main", "commit": "4dacd3f0185a2227bdf3b6c0975a8f0bf87cac9a" },
"none-ls-extras.nvim": { "branch": "main", "commit": "27681d797a26f1b4d6119296df42f5204c88a2dc" },
"none-ls.nvim": { "branch": "main", "commit": "01f8e62ea11603e59ad9ff7afcfa94fd183f76d6" },
"nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
"nvim-colorizer.lua": { "branch": "master", "commit": "664c0b7cea1de71f8b65dfe951b7996fc3e6ccde" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-parinfer": { "branch": "master", "commit": "3968e669d9f02589aa311d33cb475b16b27c5fbb" },
"nvim-silicon": { "branch": "main", "commit": "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32" },
"nvim-snazzy": { "branch": "main", "commit": "2d53dc44eac2e13cb205270cb534a500971d3ad5" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" },
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"quicker.nvim": { "branch": "master", "commit": "4a6883cb13fe097a20a046eb55f6dffd239276e3" },
"render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" },
"rustaceanvim": { "branch": "main", "commit": "3ace64feb1ce3cf3c63e6297e1378a82fe548618" },
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
"telescope-emoji": { "branch": "master", "commit": "86248d97be84a1ce83f0541500ef9edc99ea2aa1" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
"transparent.nvim": { "branch": "main", "commit": "e00ca1cf09caef575edf8da7e5a8b9193893b4c7" },
"vim-markdown": { "branch": "master", "commit": "f9f845f28f4da33a7655accb22f4ad21f7d9fb66" },
"vim-polyglot": { "branch": "master", "commit": "f061eddb7cdcc614c8406847b2bfb53099832a4e" },
"vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" },
"vimwiki": { "branch": "dev", "commit": "a54a3002e229c4b43d69ced170ff77663a5b2c40" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" },
"zk": { "branch": "main", "commit": "bca7e4a119353f18f2a819385fb7ce10269ef747" }
}
@@ -0,0 +1,28 @@
return {
cmd = { 'gopls' },
filetypes = {
'go',
'gomod',
'gowork',
'gotmpl',
'gosum'
},
root_markers = {
'go.mod',
'go.work',
'.git'
},
settings = {
gopls = {
gofumpt = true,
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
}
}
}
@@ -0,0 +1,162 @@
local function insert_package_json(root_files, field, fname)
local pkg_path = vim.fs.find("package.json", { upward = true, path = fname })[1]
if pkg_path then
local ok, content = pcall(vim.fn.readfile, pkg_path)
if ok then
local json = table.concat(content, "\n")
if string.find(json, '"' .. field .. '"') then
table.insert(root_files, pkg_path)
end
end
end
return root_files
end
local function root_markers_with_field(root_files, files, field, fname)
for _, f in ipairs(files) do
local path = vim.fs.find(f, { upward = true, path = fname })[1]
if path then
local ok, content = pcall(vim.fn.readfile, path)
if ok then
local text = table.concat(content, "\n")
if string.find(text, field) then
table.insert(root_files, path)
end
end
end
end
return root_files
end
---@brief
--- https://github.com/tailwindlabs/tailwindcss-intellisense
---
--- Tailwind CSS Language Server can be installed via npm:
---
--- npm install -g @tailwindcss/language-server
---@type vim.lsp.Config
return {
cmd = { "tailwindcss-language-server", "--stdio" },
-- filetypes copied and adjusted from tailwindcss-intellisense
filetypes = {
-- html
"aspnetcorerazor",
"astro",
"astro-markdown",
"blade",
"clojure",
"django-html",
"htmldjango",
"edge",
"eelixir", -- vim ft
"elixir",
"ejs",
"erb",
"eruby", -- vim ft
"gohtml",
"gohtmltmpl",
"haml",
"handlebars",
"hbs",
"html",
"htmlangular",
"html-eex",
"heex",
"jade",
"leaf",
"liquid",
"markdown",
"mdx",
"mustache",
"njk",
"nunjucks",
"php",
"razor",
"slim",
"twig",
-- css
"css",
"less",
"postcss",
"sass",
"scss",
"stylus",
"sugarss",
-- js
"javascript",
"javascriptreact",
"reason",
"rescript",
"typescript",
"typescriptreact",
-- mixed
"vue",
"svelte",
"templ",
},
settings = {
tailwindCSS = {
validate = true,
lint = {
cssConflict = "warning",
invalidApply = "error",
invalidScreen = "error",
invalidVariant = "error",
invalidConfigPath = "error",
invalidTailwindDirective = "error",
recommendedVariantOrder = "warning",
},
classAttributes = {
"class",
"className",
"class:list",
"classList",
"ngClass",
},
includeLanguages = {
eelixir = "html-eex",
elixir = "phoenix-heex",
eruby = "erb",
heex = "phoenix-heex",
htmlangular = "html",
templ = "html",
},
},
},
before_init = function(_, config)
if not config.settings then
config.settings = {}
end
if not config.settings.editor then
config.settings.editor = {}
end
if not config.settings.editor.tabSize then
config.settings.editor.tabSize = vim.lsp.util.get_effective_tabstop()
end
end,
workspace_required = true,
root_dir = function(bufnr, on_dir)
local root_files = {
-- Generic
"tailwind.config.js",
"tailwind.config.cjs",
"tailwind.config.mjs",
"tailwind.config.ts",
"postcss.config.js",
"postcss.config.cjs",
"postcss.config.mjs",
"postcss.config.ts",
-- Django
"theme/static_src/tailwind.config.js",
"theme/static_src/tailwind.config.cjs",
"theme/static_src/tailwind.config.mjs",
"theme/static_src/tailwind.config.ts",
"theme/static_src/postcss.config.js",
-- Fallback for tailwind v4, where tailwind.config.* is not required anymore
".git",
}
local fname = vim.api.nvim_buf_get_name(bufnr)
root_files = insert_package_json(root_files, "tailwindcss", fname)
root_files = root_markers_with_field(root_files, { "mix.lock", "Gemfile.lock" }, "tailwind", fname)
on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
end,
}
@@ -0,0 +1,7 @@
return {
cmd = { "tinymist" },
filetypes = { "typst" },
settings = {
formatterMode = "typstyle"
}
}
@@ -0,0 +1,69 @@
return {
init_options = { hostInfo = 'neovim' },
cmd = { 'typescript-language-server', '--stdio' },
filetypes = {
'javascript',
'javascriptreact',
'javascript.jsx',
'typescript',
'typescriptreact',
'typescript.tsx',
},
root_markers = { 'tsconfig.json', 'jsconfig.json', 'package.json', '.git' },
handlers = {
-- handle rename request for certain code actions like extracting functions / types
['_typescript.rename'] = function(_, result, ctx)
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
vim.lsp.util.show_document({
uri = result.textDocument.uri,
range = {
start = result.position,
['end'] = result.position,
},
}, client.offset_encoding)
vim.lsp.buf.rename()
return vim.NIL
end,
},
commands = {
['editor.action.showReferences'] = function(command, ctx)
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
local file_uri, position, references = unpack(command.arguments)
local quickfix_items = vim.lsp.util.locations_to_items(references, client.offset_encoding)
vim.fn.setqflist({}, ' ', {
title = command.title,
items = quickfix_items,
context = {
command = command,
bufnr = ctx.bufnr,
},
})
vim.lsp.util.show_document({
uri = file_uri,
range = {
start = position,
['end'] = position,
},
}, client.offset_encoding)
vim.cmd('botright copen')
end,
},
on_attach = function(client, bufnr)
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
vim.api.nvim_buf_create_user_command(bufnr, 'LspTypescriptSourceAction', function()
local source_actions = vim.tbl_filter(function(action)
return vim.startswith(action, 'source.')
end, client.server_capabilities.codeActionProvider.codeActionKinds)
vim.lsp.buf.code_action({
context = {
only = source_actions,
},
})
end, {})
end,
}
@@ -0,0 +1,33 @@
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = "*.http", command = "set ft=http" })
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = "*.templ", command = "set ft=templ" })
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = "**/inbox/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].md",
callback = function()
-- Run `date` and capture output
local handle = io.popen('date "+%H:%M"')
local time = handle:read("*l")
handle:close()
-- Build the line with a trailing colon and space
local line = time .. ": "
-- Append it at the bottom
local last_line = vim.api.nvim_buf_line_count(0)
vim.api.nvim_buf_set_lines(0, last_line, last_line, false, { line })
-- Place cursor at the end of the inserted line
vim.api.nvim_win_set_cursor(0, { last_line + 1, #line })
-- Enter insert mode
vim.cmd("startinsert")
end,
})
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = "*",
})
@@ -0,0 +1,154 @@
return {
kind = {
Array = "",
Boolean = "",
Class = "",
Color = "",
Constant = "",
Constructor = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "󰉋 ",
Function = "",
Interface = "",
Key = "",
Keyword = "",
Method = "",
Module = "",
Namespace = "",
Null = "󰟢 ",
Number = "",
Object = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
Snippet = "",
String = "",
Struct = "",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = ""
},
git = {
LineAdded = "",
LineModified = "",
LineRemoved = "",
FileDeleted = "",
FileIgnored = "",
FileRenamed = "",
FileStaged = "S",
FileUnmerged = "",
FileUnstaged = "",
FileUntracked = "U",
Diff = "",
Repo = "",
Octoface = "",
Branch = ""
},
ui = {
ArrowCircleDown = "",
ArrowCircleLeft = "",
ArrowCircleRight = "",
ArrowCircleUp = "",
BoldArrowDown = "",
BoldArrowLeft = "",
BoldArrowRight = "",
BoldArrowUp = "",
BoldClose = "",
BoldDividerLeft = "",
BoldDividerRight = "",
BoldLineLeft = "",
BookMark = "",
BoxChecked = "",
Bug = "",
Stacks = "",
Scopes = "",
Watches = "󰂥",
DebugConsole = "",
Calendar = "",
Check = "",
ChevronRight = "",
ChevronShortDown = "",
ChevronShortLeft = "",
ChevronShortRight = "",
ChevronShortUp = "",
Circle = "",
Close = "󰅖",
CloudDownload = "",
Code = "",
Comment = "",
Dashboard = "",
DividerLeft = "",
DividerRight = "",
DoubleChevronRight = "»",
Ellipsis = "",
EmptyFolder = "",
EmptyFolderOpen = "",
File = "",
FileSymlink = "",
Files = "",
FindFile = "󰈞",
FindText = "󰊄",
Fire = "",
Folder = "󰉋 ",
FolderOpen = "",
FolderSymlink = "",
Forward = "",
Gear = "",
History = "",
Lightbulb = "",
LineLeft = "",
LineMiddle = "",
List = "",
Lock = "",
NewFile = " ",
Note = "",
Package = "",
Pencil = "󰏫 ",
Plus = "",
Project = "",
Search = "",
SignIn = "",
SignOut = "",
Tab = "󰌒 ",
Table = "",
Target = "󰀘 ",
Telescope = "",
Text = "",
Tree = "",
Triangle = "󰐊",
TriangleShortArrowDown = "",
TriangleShortArrowLeft = "",
TriangleShortArrowRight = "",
TriangleShortArrowUp = ""
},
diagnostics = {
BoldError = "",
Error = "",
BoldWarning = "",
Warning = "",
BoldInformation = "",
Information = "",
BoldQuestion = "",
Question = "",
BoldHint = "",
Hint = "󰌶",
Debug = "",
Trace = ""
},
misc = {
Robot = "󰚩 ",
Squirrel = "",
Tag = "",
Watch = "",
Smiley = "",
Package = "",
CircuitBoard = ""
}
}
@@ -0,0 +1,62 @@
vim.lsp.enable("ts_ls")
vim.lsp.enable("gopls")
-- vim.lsp.enable("tailwindcss")
-- Auto complete
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
-- if client:supports_method("textDocument/completion") then
-- vim.opt.completeopt = { "menu", "menuone", "noinsert", "fuzzy", "popup" }
-- vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
-- vim.keymap.set("i", "<C-Space>", function()
-- vim.lsp.completion.get()
-- end)
-- end
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
vim.api.nvim_clear_autocmds({ group = augroup, buffer = args.buf })
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = augroup,
-- buffer = args.buf,
-- callback = function()
-- vim.cmd("Neoformat")
-- end,
-- })
if client:supports_method("textDocument/inlayHint") then
vim.lsp.inlay_hint.enable(true)
vim.keymap.set("n", "gp", function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
end, {
desc = "Toggle Inlay Hints",
})
end
vim.keymap.set("n", "gd", function()
vim.lsp.buf.type_definition()
end, {
desc = "Go to Type Definition",
})
vim.keymap.set("n", "gi", function()
vim.lsp.buf.implementation()
end, {
desc = "Go to Implementation",
})
end,
})
vim.diagnostic.config({
virtual_text = {
spacing = 4,
},
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "󰠠 ",
},
},
update_in_insert = false,
severity_sort = true,
})
@@ -0,0 +1,4 @@
local esc = vim.api.nvim_replace_termcodes("<Esc>", true, true, true)
local ret = vim.api.nvim_replace_termcodes("<CR>", true, true, true)
vim.fn.setreg('o', "jjo€ - " ..esc.. "p4j0f:llv$hP3j0wv$hP" ..esc.. ":w" ..ret)
@@ -0,0 +1,27 @@
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
vim.keymap.set("n", "<leader>qq", function()
local wins = vim.fn.getwininfo()
for _, win in pairs(wins) do
if win["quickfix"] == 1 then
vim.cmd.cclose()
return
end
end
vim.cmd.copen()
end, { desc = "Toggle quickfix list" })
vim.keymap.set("n", "<leader>bo", "<cmd>%bd|e#<cr>", { desc = "Close all buffers but the current one" }) -- https://stackoverflow.com/a/42071865/516188
vim.keymap.set("n", "<leader>tt", function()
vim.cmd("TransparentToggle")
source_matugen()
end, { desc = "Toggle transparency" })
@@ -0,0 +1,39 @@
vim.opt.guicursor = ""
vim.opt.relativenumber = true
vim.o.hlsearch = false
vim.wo.number = true
vim.o.mouse = "a"
vim.o.clipboard = "unnamedplus"
vim.o.breakindent = true
vim.o.undofile = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.wo.signcolumn = "yes"
vim.o.updatetime = 250
vim.o.tabstop = 2
vim.o.shiftwidth = 4
vim.o.timeout = true
vim.o.timeoutlen = 300
vim.opt.scrolloff = 8
vim.o.completeopt = "menuone,noselect"
vim.o.termguicolors = true
vim.o.swapfile = false
vim.o.cursorline = true
vim.cmd.set("cursorline")
vim.cmd.set("cursorcolumn")
vim.opt.conceallevel = 2
vim.opt.colorcolumn = "80"
vim.api.nvim_create_user_command("CpFullPath", function()
local path = vim.fn.expand("%:p")
vim.fn.setreg("+", path)
vim.notify('Copied "' .. path .. '" to the clipboard!')
end, {})
vim.api.nvim_create_user_command("CpRelPath", function()
local path = vim.fn.expand("%")
vim.fn.setreg("+", path)
vim.notify('Copied "' .. path .. '" to the clipboard!')
end, {})
vim.g.neoformat_try_node_exe = 1
vim.opt.winborder = 'rounded'
@@ -0,0 +1,31 @@
local ls = require("luasnip")
local s = ls.snippet
local i = ls.insert_node
local t = ls.text_node
local extras = require("luasnip.extras")
local rep = extras.rep
vim.keymap.set({ "i", "s" }, "<A-k>", function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<A-j>", function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, { silent = true })
local console_log_snippet = s("cl", {
t("console.log('"),
i(1, "var"),
t(":', "),
rep(1),
t(");"),
})
ls.add_snippets("typescript", { console_log_snippet })
ls.add_snippets("javascript", { console_log_snippet })
ls.add_snippets("typescriptreact", { console_log_snippet })
ls.add_snippets("javascriptreact", { console_log_snippet })
@@ -0,0 +1,18 @@
function source_matugen()
local matugen_path = os.getenv("HOME") .. "/.config/nvim/lua/jpporta/themes/gruvbox-dark.lua"
-- dofile doesn't expand $HOME or ~
dofile(matugen_path)
end
-- local function auxiliary_function()
-- source_matugen()
-- vim.cmd("TransparentEnable")
-- end
--
-- -- Register an autocmd to listen for matugen updates
-- vim.api.nvim_create_autocmd("Signal", {
-- pattern = "SIGUSR1",
-- callback = auxiliary_function,
-- })
source_matugen()
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme ayu-dark")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme ayu-light")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme catppuccin-latte")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme catppuccin-mocha")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme cobalt2")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme dracula")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme gruvbox")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme gruvbox")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme monokai_pro")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme monokai_ristretto")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme rose-pine")
@@ -0,0 +1,2 @@
vim.o.background = "light"
vim.cmd("colorscheme rose-pine")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme snazzy")
@@ -0,0 +1,2 @@
vim.o.background = "dark"
vim.cmd("colorscheme tokyonight")
@@ -0,0 +1,10 @@
return {
"OlegGulevskyy/better-ts-errors.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
opts = {
keymaps = {
toggle = "<leader>dd",
go_to_definition = "<leader>dx",
},
},
}
@@ -0,0 +1,54 @@
return {
{
"folke/zen-mode.nvim",
opts = {
window = {
width = 80,
},
plugins = {
options = {
ruler = false,
enabled = true,
},
kitty = {
enabled = true,
},
gitsigns = {
enabled = true,
},
tmux = { enabled = true },
twilight = {
enabled = true,
},
},
},
keys = {
{
"<leader>zm",
":ZenMode<CR>",
desc = "Zen Mode",
mode = "n",
},
},
cmd = {
"ZenMode",
},
},
{
"folke/twilight.nvim",
opts = {},
cmd = { "Twilight" },
keys = {
{
"<leader>tw",
":Twilight<CR>",
desc = "Twilight",
mode = "n",
},
},
},
{
"preservim/vim-pencil",
cmd = { "Pencil", "NoPencil", "TogglePencil", "SoftPencil", "HardPencil" },
},
}
@@ -0,0 +1,127 @@
local js_based_languages = {
"typescript",
"javascript",
"typescriptreact",
"javascriptreact",
"vue",
}
return {
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
dependencies = {
{ "mfussenegger/nvim-dap" },
{ "nvim-neotest/nvim-nio" },
{
"microsoft/vscode-js-debug",
-- After install, build it and rename the dist directory to out
build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
version = "1.*",
},
{
"mxsdev/nvim-dap-vscode-js",
config = function()
---@diagnostic disable-next-line: missing-fields
require("dap-vscode-js").setup({
debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"),
adapters = {
"chrome",
"pwa-node",
"pwa-chrome",
"pwa-msedge",
"pwa-extensionHost",
"node-terminal",
},
})
end,
},
{
"Joakker/lua-json5",
build = "./install.sh",
},
},
config = function()
local dap = require("dap")
local dapui = require("dapui")
dapui.setup()
-- ADAPTERS
for _, language in ipairs(js_based_languages) do
dap.configurations[language] = {
-- Debug single nodejs files
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug nodejs processes (make sure to add --inspect when you run the process)
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug web applications (client side)
{
type = "pwa-chrome",
request = "launch",
name = "Launch & Debug Chrome",
url = function()
local co = coroutine.running()
return coroutine.create(function()
vim.ui.input({
prompt = "Enter URL: ",
default = "http://localhost:3000",
}, function(url)
if url == nil or url == "" then
return
else
coroutine.resume(co, url)
end
end)
end)
end,
webRoot = vim.fn.getcwd(),
protocol = "inspector",
sourceMaps = true,
userDataDir = false,
},
-- Divider for the launch.json derived configs
{
name = "----- ↓ launch.json configs ↓ -----",
type = "",
request = "launch",
},
}
end
-- EVENT LISTENERS
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
-- MAPPINGS
vim.keymap.set("n", "<leader>db", "<cmd>DapToggleBreakpoint<CR>", { desc = "[D]ap [B]reakpoint" })
vim.keymap.set("n", "<leader>dc", "<cmd>DapContinue<CR>", { desc = "[D]ap [C]ontinue" })
vim.keymap.set("n", "<leader>da", function()
if vim.fn.filereadable(".vscode/launch.json") then
local dap_vscode = require("dap.ext.vscode")
dap_vscode.load_launchjs(nil, {
["pwa-node"] = js_based_languages,
["chrome"] = js_based_languages,
["pwa-chrome"] = js_based_languages,
})
end
require("dap").continue()
end, { desc = "[D]ap [A]ttach" })
end,
}
@@ -0,0 +1,4 @@
return {
"stevearc/dressing.nvim",
event = "VeryLazy",
}
@@ -0,0 +1,14 @@
return {
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}
@@ -0,0 +1,40 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters = {
csharpier = {
command = "csharpier",
args = { "format" },
},
},
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettierd", "prettier", stop_after_first = true },
typescript = { "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
json = { "prettierd", "prettier", stop_after_first = true },
markdown = { "prettierd", "prettier", stop_after_first = true },
go = { "gofmt" },
nix = { "nixfmt" },
templ = { "gofmt" },
cs = { "csharpier" },
},
format_on_save = {
timeout_ms = 500,
lsp_fomrat = "fallback",
},
})
vim.keymap.set({ "n", "v" }, "<leader>f", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end, { desc = "Format" })
end,
}
@@ -0,0 +1,111 @@
return {
"mhartington/formatter.nvim",
event = "VeryLazy",
keys = {
{
"<leader>f",
":Format<CR>",
desc = "Format file",
mode = "n",
},
},
config = function()
require("formatter").setup({
filetype = {
javascript = { require("formatter.filetypes.javascript").prettierd },
typescript = { require("formatter.filetypes.typescript").prettierd },
javascriptreact = { require("formatter.filetypes.javascriptreact").prettierd },
typescriptreact = { require("formatter.filetypes.typescriptreact").prettierd },
json = { require("formatter.filetypes.json").jq },
lua = { require("formatter.filetypes.lua").stylua },
rust = { require("formatter.filetypes.rust").rustfmt },
go = { require("formatter.filetypes.go").goimports },
markdown = { require("formatter.filetypes.markdown").prettierd },
html = { require("formatter.filetypes.html").prettierd },
css = { require("formatter.filetypes.css").prettierd },
nix = { require("formatter.filetypes.nix").nixpkgs_fmt },
["*"] = {
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})
vim.api.nvim_create_autocmd("BufWritePost", { command = "FormatWriteLock" })
end,
}
-- return {
-- "stevearc/conform.nvim",
-- event = { "BufReadPre", "BufNewFile" },
-- cmd = "ConformInfo",
-- opts = {
-- formatters_by_ft = {
-- javascript = { { "prettier", "jsbeautify" } },
-- typescript = { "prettier" },
-- javascriptreact = { { "prettier", "jsbeautify" } },
-- typescriptreact = { "prettier" },
-- json = { "prettier" },
-- lua = { "stylua" },
-- rust = { "rustfmt" },
-- go = { "goimports" },
-- markdown = { { "deno_fmt", "prettier", "prettierd" } },
-- html = { "prettier" },
-- css = { "prettier" },
-- },
-- format_on_save = function(bufnr)
-- -- Disable with a global or buffer-local variable
-- if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
-- return
-- end
-- return { timeout_ms = 500, lsp_fallback = true }
-- end,
-- },
-- keys = {
-- {
-- "<leader>f",
-- function()
-- require("conform").format({
-- lsp_fallback = true,
-- async = true,
-- })
-- end,
-- desc = "Format file",
-- },
-- },
-- config = function()
-- local notify = require("notify")
-- local function show_notification(message, level)
-- notify(message, level, { title = "conform.nvim" })
-- end
-- vim.api.nvim_create_user_command("FormatToggle", function(args)
-- local is_global = not args.bang
-- if is_global then
-- vim.g.disable_autoformat = not vim.g.disable_autoformat
-- if vim.g.disable_autoformat then
-- show_notification("Autoformat-on-save disabled globally", "info")
-- else
-- show_notification("Autoformat-on-save enabled globally", "info")
-- end
-- else
-- vim.b.disable_autoformat = not vim.b.disable_autoformat
-- if vim.b.disable_autoformat then
-- show_notification("Autoformat-on-save disabled for this buffer", "info")
-- else
-- show_notification("Autoformat-on-save enabled for this buffer", "info")
-- end
-- end
-- end, {
-- desc = "Toggle autoformat-on-save",
-- bang = true,
-- })
-- vim.api.nvim_create_user_command("Format", function(args)
-- local range = nil
-- if args.count ~= -1 then
-- local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
-- range = {
-- start = { args.line1, 0 },
-- ["end"] = { args.line2, end_line:len() },
-- }
-- end
-- require("conform").format({ async = true, lsp_fallback = true, range = range })
-- end, { range = true })
-- end,
-- }
@@ -0,0 +1,3 @@
return {
"tpope/vim-fugitive",
}
@@ -0,0 +1,4 @@
return {
"gleam-lang/gleam.vim",
ft = "gleam",
}
@@ -0,0 +1 @@
return { "ellisonleao/glow.nvim", config = true, cmd = "Glow" }
@@ -0,0 +1,35 @@
return {
"nvimdev/guard.nvim",
dependencies = { "nvimdev/guard-collection" },
ft = {
"typescript",
"javascript",
"typescriptreact",
"json",
"markdown",
"lua",
"go",
},
config = function()
local ft = require("guard.filetype")
local mdformat = {
cmd = "mdformat",
stdin = true,
}
ft("typescript"):fmt("prettierd"):lint("eslint_d")
ft("javascript"):fmt("prettierd"):lint("eslint_d")
ft("typescriptreact"):fmt("prettierd"):lint("eslint_d")
ft("json"):fmt("prettierd"):lint("eslint_d")
ft("markdown"):fmt(mdformat):lint("eslint_d")
ft("lua"):fmt("stylua")
ft("go"):fmt("gofmt"):lint("golangci_lint")
vim.keymap.set("n", "<leader>f", "<cmd>Guard fmt<CR>", { desc = "Format" })
vim.g.guard_config = {
fmt_on_save = true,
save_on_fmt = false,
}
end,
}
@@ -0,0 +1,53 @@
return {
"mfussenegger/nvim-lint",
event = {
"BufReadPre",
"BufNewFile",
},
opts = {
-- other config
linters = {
eslint_d = {
args = {
"--no-warn-ignored", -- <-- this is the key argument
"--format",
"json",
"--stdin",
"--stdin-filename",
function()
return vim.api.nvim_buf_get_name(0)
end,
},
},
},
},
config = function()
local lint = require("lint")
lint.linters_by_ft = {
javascript = { "eslint" },
typescript = { "eslint" },
javascriptreact = { "eslint" },
typescriptreact = { "eslint" },
json = { "eslint" },
lua = { "luac" },
go = { "golangcilint" },
templ = { "golangcilint" },
}
local lint_autogroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_autogroup,
callback = function()
lint.try_lint()
lint.try_lint("cspell")
end,
})
vim.keymap.set("n", "<leader>ll", function()
lint.try_lint()
end, { desc = "Trigger linting for current file" })
end,
}
@@ -0,0 +1,34 @@
return {
"mfussenegger/nvim-lint",
event = {
"BufReadPre",
"BufNewFile",
},
config = function()
local lint = require("lint")
lint.linters_by_ft = {
javascript = { "eslint" },
typescript = { "eslint" },
javascriptreact = { "eslint" },
typescriptreact = { "eslint" },
json = { "eslint", "jsonlint" },
go = { "golangcilint" },
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({
"BufEnter",
"InsertLeave",
}, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
vim.keymap.set("n", "<leader>l", function()
lint.try_lint()
end, { desc = "Lint current file" })
end,
}
@@ -0,0 +1,137 @@
return {
{ "williamboman/mason.nvim", lazy = false, config = true },
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"html",
"ts_ls",
"tailwindcss",
"gopls",
"lua_ls",
"csharp_ls",
},
automatic_installation = true,
})
end,
},
{
"neovim/nvim-lspconfig",
dependencies = { "folke/neodev.nvim", "j-hui/fidget.nvim", "hrsh7th/cmp-nvim-lsp" },
event = { "BufReadPre", "BufNewFile" },
config = function()
local keymap = vim.keymap
local opts = { noremap = true, silent = true }
local on_attach = function(client, bufnr)
opts.buffer = bufnr
opts.desc = "[G]oto [D]eclaration"
keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
opts.desc = "[C]ode [A]ction"
keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "[G]oto [D]efinition"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "[R]e[n]ame"
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "Diagnostics"
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
opts.desc = "File [D]iagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Hover Documentation"
keymap.set("n", "K", vim.lsp.buf.hover, opts)
opts.desc = "Type Definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "[G]oto [I]mplementation"
keymap.set("n", "gI", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Signature Documentation"
keymap.set("n", "<C-i>", vim.lsp.buf.signature_help, opts)
opts.desc = "[W]orkspace [L]ist Folders"
keymap.set("n", "<leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts)
end
vim.diagnostic.config({
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "󰠠 ",
},
linehl = {
[vim.diagnostic.severity.ERROR] = "Error",
[vim.diagnostic.severity.WARN] = "Warn",
[vim.diagnostic.severity.INFO] = "Info",
[vim.diagnostic.severity.HINT] = "Hint",
},
},
})
local lspconfig = require("lspconfig")
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local capabilities = cmp_nvim_lsp.default_capabilities()
-- local servers = {
-- html = {
-- "emmet-ls",
-- },
-- ts_ls = {
-- filetypes = {
-- "html",
-- "css",
-- "javascript",
-- "typescript",
-- "typescriptreact",
-- "javascriptreact",
-- },
-- },
-- tailwindcss = {
-- filetypes = {
-- "html",
-- "css",
-- "javascript",
-- "typescript",
-- "typescriptreact",
-- "javascriptreact",
-- },
-- },
-- gopls = {
-- cmd = { "gopls" },
-- filetypes = {
-- "go",
-- "gomod",
-- "gowork",
-- "gotmpl",
-- },
-- },
-- lua_ls = {
-- Lua = {
-- workspace = { checkThirdParty = false },
-- telemetry = { enable = false },
-- diagnostics = { globals = { "vim" } },
-- },
-- },
-- csharp_ls = {
-- cmd = { "csharp-ls" },
-- filetypes = {
-- "cs",
-- "csproj",
-- },
-- },
-- }
--
-- for server, settings in pairs(servers) do
-- lspconfig[server].setup({
-- capabilities = capabilities,
-- on_attach = on_attach,
-- settings = settings,
-- filetypes = (settings or {}).filetypes,
-- })
-- end
end,
},
}
@@ -0,0 +1,6 @@
return {
{
"mracos/mermaid.vim",
ft = "markdown",
},
}
@@ -0,0 +1,10 @@
return {
"iamcco/markdown-preview.nvim",
cmd = {
"MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop"
},
build = "cd app && yarn install",
init = function() vim.g.mkdp_filetypes = {"markdown"} end,
ft = {"markdown"},
event="VeryLazy"
}
@@ -0,0 +1,4 @@
return {
"williamboman/mason.nvim",
opts = {},
}
@@ -0,0 +1,22 @@
return {
"nvim-neorg/neorg",
dependencies = { "vhyrro/luarocks.nvim", "nvim-treesitter" },
lazy = false,
version = "*",
config = function()
require("neorg").setup({
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/Documents/notes",
},
default_workspace = "notes",
},
},
},
})
end,
}
@@ -0,0 +1,53 @@
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
},
config = function()
local setup, null_ls = pcall(require, "null-ls")
if not setup then
return
end
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
sources = {
-- Completion
null_ls.builtins.completion.spell,
null_ls.builtins.completion.luasnip,
null_ls.builtins.completion.nvim_snippets,
-- Code Actions
require("none-ls.code_actions.eslint_d"),
-- Formatters
null_ls.builtins.formatting.prettierd,
null_ls.builtins.formatting.stylua,
-- Diagnostics
require("none-ls.diagnostics.eslint_d"),
null_ls.builtins.diagnostics.golangci_lint,
},
-- configure format on save
vim.keymap.set("n", "<leader>f", function()
vim.lsp.buf.format({ async = true })
end, { desc = "Format current buffer" }),
on_attach = function(current_client, bufnr)
if current_client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
filter = function(client)
-- only use null-ls for formatting instead of lsp server
return client.name == "null-ls"
end,
bufnr = bufnr,
})
end,
})
end
end,
})
end,
}
@@ -0,0 +1,18 @@
return {
"rcarriga/nvim-notify",
event = "VeryLazy",
opts = {
timeout = 500,
render = "compact",
background_colour = "#000000",
max_height = function()
return math.floor(vim.o.lines * 0.75)
end,
max_width = function()
return math.floor(vim.o.columns * 0.25)
end,
on_open = function(win)
vim.api.nvim_win_set_config(win, { zindex = 100 })
end,
},
}
@@ -0,0 +1,151 @@
return {
"epwalsh/obsidian.nvim",
version = "*",
lazy = true,
ft = "markdown",
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{
"<leader>oo",
function()
vim.cmd("ObsidianToday")
end,
desc = "[O]bsidian T[o]day",
},
{
"<leader>os",
function()
vim.cmd("ObsidianSearch")
end,
desc = "[O]bsidian [S]earch",
},
{
"<leader>on",
function()
vim.cmd("ObsidianNew")
end,
desc = "[O]bsidian [N]ew",
},
{
"<leader>oe",
":ObsidianExtractNote<CR>",
desc = "[O]bsidian [E]xtract",
mode = "v",
},
{
"<leader>ot",
":ObsidianTemplate<CR>",
desc = "[O]bsidian [T]emplate",
mode = "n",
},
},
opts = {
mappings = {
-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
["gf"] = {
action = function()
return require("obsidian").util.gf_passthrough()
end,
opts = { noremap = false, expr = true, buffer = true },
},
-- Toggle check-boxes.
["<leader>ch"] = {
action = function()
return require("obsidian").util.toggle_checkbox()
end,
opts = { buffer = true },
},
},
templates = {
subdir = "Templates",
date_format = "%Y-%m-%d",
time_format = "%H:%M",
-- A map for custom variables, the key should be the variable and the value a function
substitutions = {
date_format = function()
return os.date("%Y-%m-%d")
end,
date_full = function()
return os.date("%B %-d, %Y")
end,
},
},
note_id_func = function(title)
local suffix = ""
if title ~= nil then
-- If title is given, transform it into valid file name.
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
else
-- If title is nil, just add 4 random uppercase letters to the suffix.
for _ = 1, 4 do
suffix = suffix .. string.char(math.random(65, 90))
end
end
return os.date("%s", os.time())
end,
note_frontmatter_func = function(note)
-- This is equivalent to the default frontmatter function.
local out = {
tags = { "#note", "#journal" },
created = os.date("%Y-%m-%d %H:%M:%S"),
}
-- `note.metadata` contains any manually added fields in the frontmatter.
-- So here we just make sure those fields are kept in the frontmatter.
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
for k, v in pairs(note.metadata) do
out[k] = v
end
end
return out
end,
follow_url_func = function(url)
-- vim.fn.jobstart({"xdg-open", url}) -- linux
vim.ui.open(url) -- need Neovim 0.10.0+
end,
-- Optional, configure additional syntax highlighting / extmarks.
ui = {
enable = true, -- set to false to disable all additional syntax features
update_debounce = 200, -- update delay after a text change (in milliseconds)
-- Define how various check-boxes are displayed
checkboxes = {
-- NOTE: the 'char' value has to be a single character, and the highlight groups are defined below.
[" "] = { char = "", hl_group = "ObsidianTodo" },
["x"] = { char = "", hl_group = "ObsidianDone" },
[">"] = { char = "", hl_group = "ObsidianRightArrow" },
["<"] = { char = "", hl_group = "ObsidianLeftArrow" },
["~"] = { char = "", hl_group = "ObsidianTilde" },
["v"] = { char = "", hl_group = "ObsidianPlay" },
["?"] = { char = "", hl_group = "ObsidianQuestion" },
["I"] = { char = "", hl_group = "ObsidianIdea" },
},
external_link_icon = {
char = "",
hl_group = "ObsidianExtLinkIcon",
},
-- Replace the above with this if you don't have a patched font:
-- external_link_icon = { char = "", hl_group = "ObsidianExtLinkIcon" },
reference_text = { hl_group = "ObsidianRefText" },
highlight_text = { hl_group = "ObsidianHighlightText" },
tags = { hl_group = "ObsidianTag" },
hl_groups = {
-- The options are passed directly to `vim.api.nvim_set_hl()`. See `:help nvim_set_hl`.
ObsidianTodo = { bold = true, fg = "#7f849c" },
ObsidianDone = { bold = true, fg = "#a6e3a1" },
ObsidianPlay = { bold = true, fg = "#89b4fa" },
ObsidianRightArrow = { bold = true, fg = "#fab387" },
ObsidianLeftArrow = { bold = true, fg = "#f5c2e7" },
ObsidianTilde = { bold = true, fg = "#f38ba8" },
ObsidianQuestion = { bold = true, fg = "#b4befe" },
ObsidianIdea = { bold = true, fg = "#f9e2af" },
ObsidianRefText = { underline = true, fg = "#c792ea" },
ObsidianExtLinkIcon = { fg = "#c792ea" },
ObsidianTag = { italic = true, fg = "#89ddff" },
ObsidianHighlightText = { bg = "#75662e" },
},
},
dir = "~/Documents/Notes",
new_notes_location = "notes_subdir",
notes_subdir = "",
},
}
@@ -0,0 +1,41 @@
return {
'prettier/vim-prettier',
ft = {
'javascript',
'javascriptreact',
'javascript.jsx',
'typescript',
'typescriptreact',
'typescript.tsx',
"vue",
"css",
"scss",
"less",
"html",
"json",
"jsonc",
"yaml",
"markdown",
"graphql",
"handlebars",
"svelte",
"astro",
"htmlangular",
},
config = function()
vim.g["prettier#autoformat"] = 1
vim.g["prettier#autoformat_require_pragma"] = 0
vim.g["prettier#quickfix_enabled"] = 0
-- use prettier with prettierd
vim.b["prettier_exec_cmd"] = "prettierd"
end,
keys = {
{
"<leader>f",
function()
vim.cmd("Prettier")
end,
desc = "Format with Prettier",
},
},
}
@@ -0,0 +1,5 @@
return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {},
}
@@ -0,0 +1,67 @@
return {
init_options = { hostInfo = "neovim" },
cmd = { "typescript-language-server", "--stdio" },
filetypes = {
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
},
root_markers = { "tsconfig.json", "jsconfig.json", "package.json", ".git" },
handlers = {
-- handle rename request for certain code actions like extracting functions / types
["_typescript.rename"] = function(_, result, ctx)
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
vim.lsp.util.show_document({
uri = result.textDocument.uri,
range = {
start = result.position,
["end"] = result.position,
},
}, client.offset_encoding)
vim.lsp.buf.rename()
return vim.NIL
end,
},
commands = {
["editor.action.showReferences"] = function(command, ctx)
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
local file_uri, position, references = unpack(command.arguments)
local quickfix_items = vim.lsp.util.locations_to_items(references, client.offset_encoding)
vim.fn.setqflist({}, " ", {
title = command.title,
items = quickfix_items,
context = {
command = command,
bufnr = ctx.bufnr,
},
})
vim.lsp.util.show_document({
uri = file_uri,
range = {
start = position,
["end"] = position,
},
}, client.offset_encoding)
vim.cmd("botright copen")
end,
},
on_attach = function(client, bufnr)
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
vim.api.nvim_buf_create_user_command(bufnr, "LspTypescriptSourceAction", function()
local source_actions = vim.tbl_filter(function(action)
return vim.startswith(action, "source.")
end, client.server_capabilities.codeActionProvider.codeActionKinds)
vim.lsp.buf.code_action({
context = {
only = source_actions,
},
})
end, {})
end,
}
@@ -0,0 +1,10 @@
return {
"vim-scripts/icalendar.vim",
setup = function()
vim.filetype.add({
extension = {
ics = "icalendar",
},
})
end,
}
@@ -0,0 +1,72 @@
return {
"hrsh7th/nvim-cmp",
event = { "InsertEnter", "CmdlineEnter" },
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
"onsails/lspkind.nvim",
"roobert/tailwindcss-colorizer-cmp.nvim",
"hrsh7th/cmp-nvim-lsp",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
completion = {
autocomplete = { cmp.TriggerEvent.TextChanged },
completeopt = "menu,menuone,noselect", -- standard Vim option
},
preselect = cmp.PreselectMode.Item,
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-u>"] = cmp.mapping.scroll_docs(-4),
["<C-d>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources({
-- LSP completions first
{ name = "nvim_lsp", priority = 1000 },
{ name = "nvim_lsp_signature_help", priority = 900 },
-- Snippets below LSP
{ name = "luasnip", priority = 700 },
-- Then none-ls / buffer / path
{ name = "buffer", priority = 400 },
{ name = "path", priority = 300 },
{ name = "none-ls", priority = 200 },
}),
formatting = {
format = function(entry, vim_item)
-- lspkind icons
vim_item.kind = lspkind.symbolic(vim_item.kind, { mode = "symbol_text" })
-- tailwindcss-colorizer
if entry.source.name == "nvim_lsp" then
local ok, tw = pcall(require, "tailwindcss-colorizer-cmp")
if ok then
vim_item = tw.formatter(entry, vim_item)
end
end
return vim_item
end,
},
})
end,
}
@@ -0,0 +1,7 @@
return {
{
"nvim-mini/mini.comment",
version = false,
},
{ "windwp/nvim-autopairs", event = "InsertEnter", opts = {} },
}
@@ -0,0 +1,13 @@
return {
"github/copilot.vim",
config = function()
vim.keymap.set("i", "<M-Space>", 'copilot#Accept("\\<CR>")', {
expr = true,
replace_keycodes = false,
})
vim.g.copilot_no_tab_map = true
vim.cmd("Copilot disable")
vim.keymap.set("n", "<leader>cd", ":Copilot disable<CR>")
vim.keymap.set("n", "<leader>ce", ":Copilot enable<CR>")
end,
}
@@ -0,0 +1,32 @@
return {
"sbdchd/neoformat",
cmd = { "Neoformat" },
keys = {
{
"<leader>f",
function()
vim.cmd("Neoformat")
end,
desc = "Format",
},
},
config = function()
vim.g.neoformat_try_node_exe = 1
vim.g.neoformat_enabled_go = { "gofmt", "goimports" } -- tries gofmt first, then goimports
-- Optional: Configure specific formatter options
-- For gofmt (usually no args needed)
vim.g.neoformat_go_gofmt = {
exe = "gofmt",
args = {},
stdin = 1, -- send buffer data via stdin
}
-- For goimports (if you want to use it)
vim.g.neoformat_go_goimports = {
exe = "goimports",
args = {},
stdin = 1,
}
end,
}
@@ -0,0 +1 @@
return {'nvim-telescope/telescope-fzf-native.nvim', build = 'make', lazy=true}
@@ -0,0 +1,18 @@
return {
{
"f-person/git-blame.nvim",
lazy = true,
cmd = { "GitBlameEnable", "GitBlameDisable", "GitBlameToggle" },
keys = {
{
"<leader>gb",
":GitBlameToggle<CR>",
desc = "Toggle Git Blame",
mode = "n",
},
},
},
{
"sindrets/diffview.nvim",
},
}
@@ -0,0 +1,13 @@
return {
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = {text = '+'},
change = {text = '~'},
delete = {text = '_'},
topdelete = {text = ''},
changedelete = {text = '~'}
}
},
event="VeryLazy"
}
@@ -0,0 +1,9 @@
return {
'kdheepak/lazygit.nvim',
config = function()
vim.keymap.set('n', '<leader>gg', function() vim.cmd('LazyGit') end,
{desc = "LazyGit"})
end,
event = "VeryLazy"
}
@@ -0,0 +1,19 @@
return {
"kawre/leetcode.nvim",
build = ":TSUpdate html",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim", -- required by telescope
"MunifTanjim/nui.nvim",
-- optional
"nvim-treesitter/nvim-treesitter",
"rcarriga/nvim-notify",
"nvim-tree/nvim-web-devicons",
},
cmd = "Leet",
opts = {
lang = "golang"
-- configuration goes here
},
}
@@ -0,0 +1,12 @@
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = {
options = {
icons_enabled = true,
theme = "auto",
component_separators = "|",
section_separators = "",
},
},
}
@@ -0,0 +1,20 @@
return {
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
},
{
"MeanderingProgrammer/render-markdown.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-mini/mini.nvim" }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
},
}
@@ -0,0 +1 @@
return {'chentoast/marks.nvim', opts = {}}
@@ -0,0 +1,4 @@
return {
"mason-org/mason.nvim",
opts = {}
}
@@ -0,0 +1,15 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons", -- optional, but recommended
},
lazy = false, -- neo-tree will lazily load itself
config = function()
vim.keymap.set("n", "<leader>e", ":Neotree toggle right<CR>", { desc = "Toggle File Explorer" })
end,
},
}
@@ -0,0 +1,53 @@
return {
{
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
},
config = function()
local setup, null_ls = pcall(require, "null-ls")
if not setup then
return
end
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
sources = {
-- Code Actions
require("none-ls.code_actions.eslint_d"),
null_ls.builtins.code_actions.gitsigns, -- Optional: git-related code actions
null_ls.builtins.code_actions.refactoring,
-- Diagnostics
require("none-ls.diagnostics.eslint_d"),
null_ls.builtins.diagnostics.golangci_lint,
-- Hover documentation (optional)
null_ls.builtins.hover.dictionary,
},
vim.keymap.set("n", "<leader>rn", function()
vim.lsp.buf.rename()
end, { desc = "Rename Variable" }),
})
end,
},
{
"mrcjkb/rustaceanvim",
version = "^7", -- Recommended
lazy = false, -- This plugin is already lazy
},
{
{
"antosha417/nvim-lsp-file-operations",
dependencies = {
"nvim-lua/plenary.nvim",
-- Uncomment whichever supported plugin(s) you use
-- "nvim-tree/nvim-tree.lua",
-- "nvim-neo-tree/neo-tree.nvim",
-- "simonmclean/triptych.nvim"
},
config = function()
require("lsp-file-operations").setup()
end,
},
},
}
@@ -0,0 +1,32 @@
return {
"stevearc/oil.nvim",
config = function()
require("oil").setup({
columns = { "icon" },
keymaps = {
["g?"] = "actions.show_help",
["gs"] = "actions.change_sort",
["<CR>"] = "actions.select",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-l>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["g."] = "actions.toggle_hidden",
},
use_default_keymaps = false,
view_options = {
show_hidden = true,
sort = { { "type", "asc" }, { "name", "asc" } },
},
skip_confirm_for_simple_edits = true,
})
vim.keymap.set("n", "-", function(dir)
require("oil").open(dir)
end, { desc = "Open parent directory" })
end,
dependencies = { "nvim-tree/nvim-web-devicons" },
}
@@ -0,0 +1,3 @@
return {
'gpanders/nvim-parinfer'
}
@@ -0,0 +1,3 @@
return {
'sheerun/vim-polyglot'
}
@@ -0,0 +1,4 @@
return { 'stevearc/quicker.nvim',
event = "FileType qf",
opts = {},
}
@@ -0,0 +1,41 @@
return {
"michaelrommel/nvim-silicon",
lazy = true,
cmd = "Silicon",
config = function()
local get_visual = function()
local curpos = vim.fn.getcurpos()
local one = { row = curpos[2] - 1, col = curpos[3] - 1 }
local two = { row = vim.fn.line("v") - 1, col = vim.fn.col("v") - 1 }
if one.row == two.row then
if one.col > two.col then
local tmp = one
one = two
two = tmp
end
elseif one.row > two.row then
local tmp = one
one = two
two = tmp
end
two.col = two.col + 1
return one.row
end
require("nvim-silicon").setup({
font = "JetBrainsMono Nerd Font=24",
no_window_controls = true,
no_line_number = false,
line_offset = get_visual() + 1,
to_clipboard = true,
window_title = function()
return vim.fn.fnamemodify(vim.fn.bufname(vim.fn.bufnr()), ":~:.") .. " -  @jpporta"
end,
language = function()
return vim.bo.filetype
end,
})
vim.keymap.set("v", "<leader>cs", "<cmd>'<,'>Silicon<CR>", { desc = "[C]ode [S]elfie" })
end,
}
@@ -0,0 +1,23 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = false },
indent = { enabled = false },
input = { enabled = true },
picker = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = false },
statuscolumn = { enabled = true },
words = { enabled = true },
},
}
@@ -0,0 +1,10 @@
return {
{
"NvChad/nvim-colorizer.lua",
opts = {
user_default_options = {
tailwind = true,
},
},
},
}
@@ -0,0 +1,72 @@
return {
"nvim-telescope/telescope.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"xiyaowong/telescope-emoji",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-tree/nvim-web-devicons",
},
opts = {
defaults = { mappings = { i = { ["<C-u>"] = false, ["<C-d>"] = false } } },
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
},
},
pickers = { colorscheme = { enable_preview = true } },
},
config = function()
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "emoji")
vim.keymap.set(
"n",
"<leader>?",
require("telescope.builtin").oldfiles,
{ desc = "[?] Find recently opened files" }
)
vim.keymap.set("n", "<leader><space>", function()
require("telescope.builtin").buffers({
sort_mru = true,
ignore_current_buffer = true,
})
end, { desc = "[ ] Find existing buffers" })
vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, { desc = "[G]oto [R]eferences" })
vim.keymap.set(
"n",
"<leader>ds",
require("telescope.builtin").lsp_document_symbols,
{ desc = "[D]ocument [S]ymbols" }
)
vim.keymap.set(
"n",
"<leader>ws",
require("telescope.builtin").lsp_dynamic_workspace_symbols,
{ desc = "[W]orkspace [S]ymbols" }
)
vim.keymap.set("n", "<leader>/", function()
require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
winblend = 10,
previewer = false,
}))
end, { desc = "[/] Fuzzily search in current buffer" })
vim.keymap.set("n", "<leader>sf", require("telescope.builtin").find_files, { desc = "[S]earch [F]iles" })
vim.keymap.set("n", "<leader>sh", require("telescope.builtin").help_tags, { desc = "[S]earch [H]elp" })
vim.keymap.set(
"n",
"<leader>sw",
require("telescope.builtin").grep_string,
{ desc = "[S]earch current [W]ord" }
)
vim.keymap.set("n", "<leader>sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" })
vim.keymap.set("n", "<leader>sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" })
vim.keymap.set("n", "<leader>ss", require("telescope.builtin").git_files, { desc = "Search Git Files" })
vim.keymap.set("n", "<leader>sb", ":Telescope file_browser<CR>", { desc = "File browser" })
vim.keymap.set("n", "<leader>st", ":Telescope colorscheme<CR>", { desc = "Switch Theme" })
vim.keymap.set("n", "<leader>se", ":Telescope emoji<CR>", { desc = "Search Emoji" })
end,
event = "VeryLazy",
}
@@ -0,0 +1,123 @@
return {
-- {
-- "rebelot/kanagawa.nvim", -- neorg needs a colorscheme with treesitter support
-- config = function()
-- vim.cmd.colorscheme("kanagawa")
-- end,
-- },
{
"RRethy/base16-nvim",
priority = 1000,
},
{
"EdenEast/nightfox.nvim",
priority = 1000, -- Ensure it loads first
},
{
"shaunsingh/nord.nvim",
priority = 1000, -- Ensure it loads first
},
{
"Mofiqul/dracula.nvim",
priority = 1000, -- Ensure it loads first
},
-- {
-- "olimorris/onedarkpro.nvim",
-- priority = 1000, -- Ensure it loads first
-- },
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
},
{ "sainnhe/everforest", priority = 1000 },
{ "kdheepak/monochrome.nvim", priority = 1000 },
{ "ellisonleao/gruvbox.nvim", priority = 1000 },
{
"xiyaowong/transparent.nvim",
priority = 1000,
opts = {
groups = {
"Normal",
"NormalNC",
"Comment",
"Constant",
"Special",
"Identifier",
"Statement",
"PreProc",
"Type",
"Underlined",
"Todo",
"String",
"Function",
"Conditional",
"Repeat",
"Operator",
"Structure",
"LineNr",
"NonText",
"SignColumn",
"CursorLine",
"CursorLineNr",
"StatusLine",
"StatusLineNC",
"EndOfBuffer",
},
extra_groups = {
"NormalFloat", -- plugins which have float panel such as Lazy, Mason, LspInfo
"NvimTreeNormal", -- NvimTree
},
},
},
-- {
-- "fynnfluegge/monet.nvim",
-- name = "monet",
-- opts = {
-- tranparent_background = true,
-- dark_mode = true,
-- },
-- },
{
"folke/tokyonight.nvim",
priority = 1000,
opts = {},
},
{
"rebelot/kanagawa.nvim",
priority = 1000,
},
-- { "kepano/flexoki-neovim", priority = 1000, name = "flexoki" },
-- { "jacoborus/tender.vim", priority = 1000, name = "tender" },
-- { "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false, priority = 1000 },
-- {
-- "scottmckendry/cyberdream.nvim",
-- lazy = false,
-- priority = 1000,
-- config = function()
-- require("cyberdream").setup({
-- -- Recommended - see "Configuring" below for more config options
-- transparent = true,
-- italic_comments = true,
-- hide_fillchars = true,
-- borderless_telescope = true,
-- terminal_colors = true,
-- })
-- vim.cmd("colorscheme cyberdream") -- set the colorscheme
-- end,
-- },
{ "rose-pine/neovim", as = "rose-pine" },
{ "Shatur/neovim-ayu" },
{
"lalitmee/cobalt2.nvim",
dependencies = { "tjdevries/colorbuddy.nvim", tag = "v1.0.0" },
},
{ "tanvirtin/monokai.nvim" },
{
"alexwu/nvim-snazzy",
dependencies = { "rktjmp/lush.nvim" },
lazy = false,
priority = 1000,
},
}
@@ -0,0 +1,6 @@
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
event = "VeryLazy",
}
@@ -0,0 +1,65 @@
return {
{
-- Highlight, edit, and navigate code
"nvim-treesitter/nvim-treesitter",
dependencies = { "tpope/vim-markdown" },
build = ":TSUpdate",
config = function()
---@diagnostic disable-next-line: missing-fields
require("nvim-treesitter").setup({
disable = { "markdown" },
auto_install = true,
highlight = { enable = true },
indent = { enable = true, disable = { "python" } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<c-space>",
node_incremental = "<c-space>",
scope_incremental = "<c-s>",
node_decremental = "<M-space>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer",
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer",
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer",
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer",
},
},
swap = {
enable = true,
swap_next = { ["<leader>sa"] = "@parameter.inner" },
swap_previous = { ["<leader>sA"] = "@parameter.inner" },
},
},
})
end,
},
}
@@ -0,0 +1,14 @@
return {
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft", "TmuxNavigateDown", "TmuxNavigateUp",
"TmuxNavigateRight", "TmuxNavigatePrevious"
},
keys = {
{"<M-h>", "<cmd>TmuxNavigateLeft<cr>"},
{"<M-j>", "<cmd>TmuxNavigateDown<cr>"},
{"<M-k>", "<cmd>TmuxNavigateUp<cr>"},
{"<M-l>", "<cmd>TmuxNavigateRight<cr>"},
{"<M-\\>", "<cmd>TmuxNavigatePrevious<cr>"}
}
}
@@ -0,0 +1,5 @@
return {
'folke/which-key.nvim',
opts = {},
event="VeryLazy"
}
@@ -0,0 +1,9 @@
return {
"vimwiki/vimwiki",
init = function()
vim.g.vimwiki_path = "~/docs/Wiki/"
vim.g.vimwiki_syntax = "markdown"
vim.g.vimwiki_ext = "md"
vim.g.vimwiki_global_ext = 0
end,
}
@@ -0,0 +1,25 @@
return {
"zk-org/zk-nvim",
name = "zk",
opts = {
-- Can be "telescope", "fzf", "fzf_lua", "minipick", "snacks_picker",
-- or select" (`vim.ui.select`).
picker = "select",
lsp = {
-- `config` is passed to `vim.lsp.start(config)`
config = {
name = "zk",
cmd = { "zk", "lsp" },
filetypes = { "markdown" },
-- on_attach = ...
-- etc, see `:h vim.lsp.start()`
},
-- automatically attach buffers in a zk notebook that match the given filetypes
auto_attach = {
enabled = true,
},
},
},
}
@@ -0,0 +1,13 @@
websocket
telehealth
diarization
Veradigm
EMR
cronjob
JSON
Serverless
serverless
colorschemes
Avodah
Gitea
Unescapable

Some files were not shown because too many files have changed in this diff Show More