diff --git a/.config/btop/btop.conf b/.config/btop/btop.conf index 9ab983f..2fb3895 100644 --- a/.config/btop/btop.conf +++ b/.config/btop/btop.conf @@ -2,8 +2,8 @@ color_theme = "Default" theme_background = False truecolor = True force_tty = False -presets = "proc:0:default,cpu:1:default mem:0:default net:0:tty" -vim_keys = True +presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" +vim_keys = False rounded_corners = True graph_symbol = "braille" graph_symbol_cpu = "default" @@ -48,7 +48,7 @@ mem_below_net = False zfs_arc_cached = True show_swap = True swap_disk = True -show_disks = False +show_disks = True only_physical = True use_fstab = True zfs_hide_datasets = False diff --git a/.config/easyeffects/input/default.json b/.config/easyeffects/input/default.json index 9457c25..0e3b9df 100644 --- a/.config/easyeffects/input/default.json +++ b/.config/easyeffects/input/default.json @@ -1,5 +1,16 @@ { "input": { + "bass_enhancer#0": { + "amount": 3.0, + "blend": 0.0, + "bypass": false, + "floor": 12.0, + "floor-active": true, + "harmonics": 10.0, + "input-gain": 0.0, + "output-gain": 0.0, + "scope": 150.0 + }, "blocklist": [], "limiter#0": { "alr": false, @@ -23,7 +34,7 @@ }, "plugins_order": [ "rnnoise#0", - "speex#0", + "bass_enhancer#0", "limiter#0" ], "rnnoise#0": { @@ -35,20 +46,6 @@ "release": 20.0, "vad-thres": 50.0, "wet": 0.0 - }, - "speex#0": { - "bypass": false, - "enable-agc": false, - "enable-denoise": true, - "enable-dereverb": true, - "input-gain": 0.0, - "noise-suppression": -70, - "output-gain": 0.0, - "vad": { - "enable": true, - "probability-continue": 90, - "probability-start": 95 - } } } -} +} \ No newline at end of file diff --git a/.config/easyeffects/output/default.json b/.config/easyeffects/output/default.json index e2c2a7a..63bd8ed 100644 --- a/.config/easyeffects/output/default.json +++ b/.config/easyeffects/output/default.json @@ -1,15 +1,15 @@ { "output": { "bass_enhancer#0": { - "amount": 0.0, + "amount": 3.0, "blend": 0.0, "bypass": false, "floor": 12.0, "floor-active": true, - "harmonics": 8.5, + "harmonics": 10.0, "input-gain": 0.0, "output-gain": 0.0, - "scope": 100.0 + "scope": 150.0 }, "blocklist": [], "filter#0": { diff --git a/.config/environment.d/10-xdg.conf b/.config/environment.d/10-xdg.conf new file mode 100644 index 0000000..d1372d1 --- /dev/null +++ b/.config/environment.d/10-xdg.conf @@ -0,0 +1,6 @@ +XDG_CACHE_HOME=$HOME/.cache +XDG_CONFIG_HOME=$HOME/.config +XDG_DATA_HOME=$HOME/.local/share +XDG_BIN_HOME=$HOME/.local/bin +XDG_LIB_HOME=$HOME/.local/lib +XDG_STATE_HOME=$HOME/.local/state \ No newline at end of file diff --git a/.config/environment.d/20-dirs.conf b/.config/environment.d/20-dirs.conf new file mode 100644 index 0000000..9f11f31 --- /dev/null +++ b/.config/environment.d/20-dirs.conf @@ -0,0 +1,11 @@ +CARGO_HOME=$XDG_DATA_HOME/cargo +CUDA_CACHE_PATH=$XDG_CACHE_HOME/nv +DOTNET_CLI_HOME=$XDG_DATA_HOME/dotnet +GOPATH=$XDG_DATA_HOME/go +GTK2_RC_FILES=$XDG_CONFIG_HOME/gtk-2.0/gtkrc +HISTFILE=$XDG_STATE_HOME/bash/history +NIMBLE_DIR=$XDG_DATA_HOME/nimble +NUGET_PACKAGES=$XDG_CACHE_HOME/nuget +RUSTUP_HOME=$XDG_DATA_HOME/rustup +W3M_DIR=$XDG_DATA_HOME/w3m +WINEPREFIX=$XDG_DATA_HOME/wine \ No newline at end of file diff --git a/.config/environment.d/30-general.conf b/.config/environment.d/30-general.conf new file mode 100644 index 0000000..8ce7a7a --- /dev/null +++ b/.config/environment.d/30-general.conf @@ -0,0 +1,6 @@ +BROWSER=firefox +EDITOR=nvim +LANG=en_US.UTF-8 +PAGER=less +SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket +TERMINAL=foot \ No newline at end of file diff --git a/.config/fish/alias.fish b/.config/fish/alias.fish index 49a3ace..5fbd36d 100644 --- a/.config/fish/alias.fish +++ b/.config/fish/alias.fish @@ -1,124 +1,84 @@ # Git -if command -q git - alias g "git" - alias gc "git clone" - alias gd "git diff --ignore-space-at-eol" - alias gds "git diff --ignore-space-at-eol --compact-summary" - alias gl "git log --oneline" - alias gp "git pull" - alias gs "git status" - alias home "git --git-dir=$HOME/.home/ --work-tree=$HOME" - alias homeinit "git clone --bare https://git.urbach.dev/sys/home $HOME/.home && home checkout" - alias h "home" - alias hs "home status" - alias hd "home diff --ignore-space-at-eol" - alias hds "home diff --ignore-space-at-eol --compact-summary" - alias hp "home pull" -end +alias g "git" +alias gc "git clone" +alias gd "git diff --ignore-space-at-eol" +alias gl "git log --oneline" +alias gp "git pull" +alias gs "git status" # Go -if command -q go - alias gb "go build -v" - alias godeps "go list -f '{{ join .Deps \"\n\"}}' ." - alias gt "go test -v" - alias gts "gotestsum" -end +alias gb "go build -v" +alias godeps "go list -f '{{ join .Deps \"\n\"}}' ." +alias gt "go test -v" +alias gts "gotestsum" + +# Home +alias home "git --git-dir=$HOME/.home/ --work-tree=$HOME" +alias homeinit "git clone --bare https://git.urbach.dev/sys/home $HOME/.home && home checkout" +alias h "home" +alias hs "home status" +alias hd "home diff --ignore-space-at-eol" +alias hp "home pull" # Hyperfine -if command -q hyperfine - alias bench "hyperfine --shell=none" -end +alias bench "hyperfine --shell=none" # Kernel -if command -q dmesg - alias kerr "sudo dmesg --level=emerg,alert,crit,err" - alias klog "sudo dmesg" -end +alias kerr "sudo dmesg --level=emerg,alert,crit,err" +alias klog "sudo dmesg" # List -if command -q ls - alias l "ls" - alias ll "ls -l" - alias l2 "ls -T -L2" - alias lu "ls -l --total-size --sort=size --reverse --no-permissions --no-user --no-time" - alias lp "ls -l --no-filesize --no-time" -end +alias l "ls" +alias ll "ls -l" +alias l2 "ls -T -L2" +alias lu "ls -l --total-size --sort=size --reverse --no-permissions --no-user --no-time" +alias lp "ls -l --no-filesize --no-time" # Lsof -if command -q lsof - alias tcp "lsof -PniTCP" - alias udp "lsof -PniUDP" -end - -# MPV -if command -q mpv - alias music "mpv music --shuffle --no-video" -end +alias tcp "lsof -PniTCP" +alias udp "lsof -PniUDP" # Neovim -if command -q nvim - alias e nvim -end +alias e "nvim" +alias n "nvim" # Pacman -if command -q apk - alias p "apk" - alias pi "sudo apk add" - alias pr "sudo apk del" - alias pu "sudo apk update && sudo apk upgrade" - alias pl "apk info" - alias po "apk info --who-owns" -else if command -q pacman - alias p "pacman" - alias pi "sudo pacman -S" - alias pr "sudo pacman -Rs" - alias pu "sudo pacman -Syu" - alias pl "pacman -Qq" - alias pe "pacman -Qe" - alias pc "sudo pacman -Sc" - alias paur "pacman -Qm" - alias pfiles "pacman -Ql" - alias porphan "pacman -Qtdq" - alias po "pacman -Qo" -end - -# Sudo -if command -q doas - alias sudo "doas" -end +alias p "pacman" +alias pi "sudo pacman -S" +alias pr "sudo pacman -Rs" +alias pu "sudo pacman -Syu" +alias pl "pacman -Qq" +alias pe "pacman -Qe" +alias pc "sudo pacman -Sc" +alias paur "pacman -Qm" +alias pfiles "pacman -Ql" +alias porphan "pacman -Qtdq" +alias powner "pacman -Qo" # Systemctl -if command -q service - alias services "service -l" -else if command -q systemctl - alias start "sudo systemctl start" - alias stop "sudo systemctl stop" - alias enable "sudo systemctl enable" - alias disable "sudo systemctl disable" - alias restart "sudo systemctl restart" - alias running "systemctl list-units --type=service --state=running" - alias disabled "systemctl list-unit-files --type=service --state=disabled" - alias enabled "systemctl list-unit-files --type=service --state=enabled" - alias timers "systemctl list-timers" - alias bios "systemctl reboot --firmware-setup" -end +alias start "sudo systemctl start" +alias stop "sudo systemctl stop" +alias enable "sudo systemctl enable" +alias disable "sudo systemctl disable" +alias restart "sudo systemctl restart" +alias running "systemctl list-units --type=service --state=running" +alias disabled "systemctl list-unit-files --type=service --state=disabled" +alias enabled "systemctl list-unit-files --type=service --state=enabled" +alias timers "systemctl list-timers" # Tmux -if command -q tmux - alias ta "tmux attach" - alias td "tmux detach" - alias tl "tmux ls" - alias tk "tmux kill-server" -end +alias ta "tmux attach" +alias td "tmux detach" +alias tl "tmux ls" +alias tk "tmux kill-server" # ... -alias align "column -t -o ' '" +alias bios "systemctl reboot --firmware-setup" alias cfg "config" alias cls "clear" alias debug "blinkenlights" alias disasm "llvm-objdump --disassembler-color=on --x86-asm-syntax=intel -d" alias ff "fastfetch" -alias fn "rg --files | rg" alias hex "hexdump -C" alias log "journalctl" alias utc "date -u +'%Y-%m-%dT%H:%M:%SZ'" diff --git a/.config/fish/config.fish b/.config/fish/config.fish index b4bace5..e5dfdee 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,13 +1,16 @@ +# Interactive mode if status is-interactive - # Aliases source $HOME/.config/fish/alias.fish + set -x LS_COLORS di=0:ln=0:so=0:pi=0:ex=0:bd=0:cd=0:su=0:sg=0:tw=0:ow=0 +end - # Set environment variables from .env - while read -la line - set -l keyval (string split -m1 "=" $line) - set -l key (string trim $keyval[1]) - set -l value (string trim $keyval[2..]) - set -l value (eval echo $value) - set -xg $key $value - end < ~/.env -end \ No newline at end of file +# Load systemd user environment +set GENERATOR /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator + +if test -e $GENERATOR + export ($GENERATOR) +end + +# Add to PATH +fish_add_path (go env GOPATH)/bin +fish_add_path $XDG_CONFIG_HOME/fish/scripts \ No newline at end of file diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index 8369e25..8070b83 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -41,4 +41,5 @@ SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dFFCC66 SETUVAR fish_pager_color_selected_completion:\x1d SETUVAR fish_pager_color_selected_description:\x1d SETUVAR fish_pager_color_selected_prefix:\x1d -SETUVAR fish_prompt_pwd_dir_length:0 \ No newline at end of file +SETUVAR fish_prompt_pwd_dir_length:0 +SETUVAR fish_user_paths:/home/eduard/\x2econfig/fish/scripts\x1e/home/eduard/\x2elocal/share/go/bin\x1e/home/eduard/\x2elocal/bin diff --git a/.config/fish/functions/config.fish b/.config/fish/functions/config.fish index 0fb4829..85d8819 100644 --- a/.config/fish/functions/config.fish +++ b/.config/fish/functions/config.fish @@ -1,3 +1,3 @@ function config - f $HOME/.config/$argv + $EDITOR $HOME/.config/$argv end diff --git a/.config/fish/functions/f.fish b/.config/fish/functions/f.fish index bfde20b..651a4af 100644 --- a/.config/fish/functions/f.fish +++ b/.config/fish/functions/f.fish @@ -1,19 +1,8 @@ -function f --wraps nnn --description 'support nnn quit and change directory' - if test -n "$NNNLVL" -a "$NNNLVL" -ge 1 - echo "nnn is already running" - return - end - - if test -n "$XDG_CONFIG_HOME" - set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" - else - set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd" - end - - command nnn $argv - - if test -e $NNN_TMPFILE - source $NNN_TMPFILE - rm -- $NNN_TMPFILE +function f + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" end + rm -f -- "$tmp" end \ No newline at end of file diff --git a/.config/fish/functions/ls.fish b/.config/fish/functions/ls.fish index b407316..81daf1e 100644 --- a/.config/fish/functions/ls.fish +++ b/.config/fish/functions/ls.fish @@ -1,4 +1,4 @@ -function ls --wraps eza +function ls if command -q eza eza --group-directories-first --time-style relative -T -L1 $argv else diff --git a/.config/fish/functions/t.fish b/.config/fish/functions/t.fish index 4ef6470..6f3f549 100644 --- a/.config/fish/functions/t.fish +++ b/.config/fish/functions/t.fish @@ -8,13 +8,7 @@ end function init_session tmux new-session -d -s main -d -x (tput cols) -y (tput lines) - - if command -q journalctl - tmux split-window -v -l 10 journalctl -f - else if command -q logread - tmux split-window -v -l 10 logread -f - end - + tmux split-window -v -l 10 journalctl -f tmux select-pane -t 0 tmux split-window -h -l 50 btop tmux select-pane -t 0 diff --git a/.config/fish/scripts/backup b/.config/fish/scripts/backup index 4495c2b..626b4c8 100755 --- a/.config/fish/scripts/backup +++ b/.config/fish/scripts/backup @@ -1,26 +1,20 @@ -#!/usr/bin/fish +#!/bin/fish set DIRECTORIES documents music pictures projects videos set EXCLUDES node_modules .cache .godot .svelte-kit -set FLAGS --archive --compress --delete --human-readable --progress +set FLAGS -avz --delete set HOSTS $argv set USER (whoami) -set DESTINATION "~/" +set DESTINATION "~/files/" for exclude in $EXCLUDES set -a FLAGS --exclude $exclude end for host in $HOSTS - set_color yellow - echo " $host" + echo "[$host]" - for dir in $DIRECTORIES - set_color blue - echo "  $dir" - - set_color normal - rsync $FLAGS ~/$dir $host:$DESTINATION + for DIR in $DIRECTORIES + echo "Backing up $DIR..." + rsync $FLAGS ~/$DIR $USER@$host:$DESTINATION end - - echo "" end \ No newline at end of file diff --git a/.config/fish/scripts/gitloc b/.config/fish/scripts/gitloc index e93b45d..c9ea178 100755 --- a/.config/fish/scripts/gitloc +++ b/.config/fish/scripts/gitloc @@ -1,4 +1,4 @@ -#!/usr/bin/fish +#!/bin/fish echo "This will modify your git repository to count the lines of code for each commit." read -l -P "Do you want to continue? [y/N] " CONFIRM diff --git a/.config/hypr/autostart.conf b/.config/hypr/autostart.conf index c791a3e..1d84f1d 100644 --- a/.config/hypr/autostart.conf +++ b/.config/hypr/autostart.conf @@ -1,12 +1,5 @@ -# Autostart -exec-once = swaybg -i ~/pictures/wallpapers/01.png +exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +exec-once = waypaper --restore exec-once = wl-paste --watch cliphist store -exec-once = $statusbar -exec-once = ssh-agent -D -a $SSH_AUTH_SOCK -exec-once = openrc --user gui - -# Disabled -#exec-once = /usr/libexec/pipewire-launcher -#exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP -#exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 -#exec-once = waypaper --restore \ No newline at end of file +exec-once = $statusbar \ No newline at end of file diff --git a/.config/hypr/general.conf b/.config/hypr/general.conf index d0bdf8e..8d099b6 100644 --- a/.config/hypr/general.conf +++ b/.config/hypr/general.conf @@ -46,7 +46,6 @@ misc { vfr = true animate_manual_resizes = false render_ahead_of_time = false - disable_hyprland_qtutils_check = true } cursor { @@ -56,7 +55,7 @@ cursor { input { accel_profile = flat - sensitivity = -0.75 + sensitivity = 0 } dwindle { @@ -68,10 +67,6 @@ ecosystem { no_donation_nag = true } -xwayland { - enabled = false -} - debug { overlay = false } \ No newline at end of file diff --git a/.config/hypr/keys.conf b/.config/hypr/keys.conf index b2b2422..a585578 100644 --- a/.config/hypr/keys.conf +++ b/.config/hypr/keys.conf @@ -2,26 +2,24 @@ $main = SUPER # Apps bind = $main, B, exec, $browser -bind = $main, E, exec, $editor -bind = $main, F, exec, $files -bind = $main, K, exec, $calendar +bind = $main, D, exec, $editor +bind = $main, E, exec, $files +bind = $main, F1, exec, $systeminfo bind = $main, L, exec, $lockscreen -bind = $main, M, exec, $email bind = $main, P, exec, $processmonitor +bind = $main, Return, exec, $floating bind = $main, S, exec, pkill $statusbar || $statusbar +bind = $main, Space, exec, pkill $menu || $menu bind = $main, T, exec, $terminal bind = $main, W, exec, $wallpaper bind = $main, U, exec, $update -bind = $main, F1, exec, $systeminfo -bind = $main, Return, exec, $floating -bind = $main, Space, exec, pkill $menu || $menu -bind =, Print, exec, $screenshot +bind = , Print, exec, $screenshot # Window management bind = $main, C, killactive, -bind = $main, J, togglesplit, +bind = $main, F, fullscreen, bind = $main, V, togglefloating, -bind = $main, Super_R, fullscreen, +bind = $main, J, togglesplit, # Session management bind = $main, Backspace, exit, @@ -90,6 +88,6 @@ bindl =, XF86AudioNext, exec, playerctl next bindl =, XF86AudioPrev, exec, playerctl previous # Volume control -bindle =, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+ -bindle =, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02- +bindle =, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+ +bindle =, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05- bindl =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle \ No newline at end of file diff --git a/.config/hypr/programs.conf b/.config/hypr/programs.conf index f39c23d..ba3365b 100644 --- a/.config/hypr/programs.conf +++ b/.config/hypr/programs.conf @@ -1,21 +1,19 @@ # Apps $browser = firefox +$email = evolution +$files = thunar $logout = wlogout $lockscreen = swaylock $menu = fuzzel $screenshot = IMG=~/pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png && grim -g "$(slurp -d)" $IMG && wl-copy < $IMG -$shell = fish $statusbar = waybar $terminal = foot $wallpaper = waypaper # Terminal based -$calendar = $terminal -e calcurse $editor = $terminal -e nvim -$email = $terminal -e aerc -$files = $terminal -e nnn $center = [float;size 960 540;center] $floating = $center $terminal -$systeminfo = $floating --hold -e fastfetch -$processmonitor = $floating -e btop -$update = $floating -e fish \ No newline at end of file +$systeminfo = $center $terminal --hold -e fastfetch +$processmonitor = $terminal -e btop +$update = $floating -e sudo pacman -Syu \ No newline at end of file diff --git a/.config/nvim/colors/monokai.lua b/.config/nvim/colors/monokai.lua deleted file mode 100644 index e52480a..0000000 --- a/.config/nvim/colors/monokai.lua +++ /dev/null @@ -1,246 +0,0 @@ -vim.cmd("highlight clear") -vim.o.background = "dark" -vim.o.termguicolors = true -vim.g.colors_name = "monokai" - -local c = { - base0 = "#222426", - base1 = "#272a30", - base2 = "#26292C", - base3 = "#2E323C", - base4 = "#333842", - base5 = "#4d5154", - base6 = "#9ca0a4", - base7 = "#b1b1b1", - base8 = "#e3e3e1", - border = "#a1b5b1", - brown = "#504945", - white = "#f8f8f0", - grey = "#8F908A", - black = "#000000", - pink = "#f92672", - green = "#a6e22e", - aqua = "#66d9ef", - yellow = "#e6db74", - orange = "#fd971f", - purple = "#ae81ff", - red = "#e95678", - diff_add = "#3d5213", - diff_remove = "#4a0f23", - diff_change = "#27406b", - diff_text = "#23324d", -} - -local hl = function(group, opts) - vim.api.nvim_set_hl(0, group, opts) -end - --- Syntax -hl("Normal", { fg = c.white, bg = c.base2 }) -hl("NormalFloat", { bg = c.base1 }) -hl("Pmenu", { fg = c.white, bg = c.base3 }) -hl("PmenuSel", { fg = c.base4, bg = c.orange }) -hl("PmenuSelBold", { fg = c.base4, bg = c.orange }) -hl("PmenuThumb", { fg = c.purple, bg = c.green }) -hl("PmenuSbar", { bg = c.base3 }) -hl("Cursor", { reverse = true }) -hl("ColorColumn", { bg = c.base3 }) -hl("CursorLine", { bg = c.base3 }) -hl("NonText", { fg = c.base5 }) -hl("Visual", { bg = c.base4 }) -hl("VisualNOS", { bg = c.base3 }) -hl("Search", { fg = c.base2, bg = c.yellow }) -hl("IncSearch", { fg = c.base2, bg = c.orange }) -hl("CursorLineNr", { fg = c.orange, bg = c.base2 }) -hl("MatchParen", { fg = c.pink }) -hl("Question", { fg = c.yellow }) -hl("ModeMsg", { fg = c.white, bold = true }) -hl("MoreMsg", { fg = c.white, bold = true }) -hl("ErrorMsg", { fg = c.red, bold = true }) -hl("WarningMsg", { fg = c.yellow, bold = true }) -hl("VertSplit", { fg = c.brown }) -hl("LineNr", { fg = c.base5, bg = c.base2 }) -hl("SignColumn", { fg = c.white, bg = c.base2 }) -hl("StatusLine", { fg = c.base7, bg = c.base3 }) -hl("StatusLineNC", { fg = c.grey, bg = c.base3 }) -hl("Tabline", {}) -hl("TabLineFill", {}) -hl("TabLineSel", { bg = c.base4 }) -hl("SpellBad", { fg = c.red, undercurl = true }) -hl("SpellCap", { fg = c.purple, undercurl = true }) -hl("SpellRare", { fg = c.aqua, undercurl = true }) -hl("SpellLocal", { fg = c.pink, undercurl = true }) -hl("SpecialKey", { fg = c.pink }) -hl("Title", { fg = c.yellow, bold = true }) -hl("Directory", { fg = c.aqua }) -hl("DiffAdd", { bg = c.diff_add }) -hl("DiffDelete", { bg = c.diff_remove }) -hl("DiffChange", { bg = c.diff_change }) -hl("DiffText", { bg = c.diff_text }) -hl("diffAdded", { fg = c.green }) -hl("diffRemoved", { fg = c.pink }) -hl("Folded", { fg = c.grey, bg = c.base3 }) -hl("FoldColumn", { fg = c.white, bg = c.black }) -hl("Constant", { fg = c.aqua }) -hl("Number", { fg = c.purple }) -hl("Float", { fg = c.purple }) -hl("Boolean", { fg = c.purple }) -hl("Character", { fg = c.yellow }) -hl("String", { fg = c.yellow }) -hl("Type", { fg = c.aqua }) -hl("Structure", { fg = c.aqua }) -hl("StorageClass", { fg = c.aqua }) -hl("Typedef", { fg = c.aqua }) -hl("Identifier", { fg = c.white }) -hl("Function", { fg = c.green, italic = true }) -hl("Statement", { fg = c.pink }) -hl("Operator", { fg = c.pink }) -hl("Label", { fg = c.pink }) -hl("Keyword", { fg = c.pink, italic = true }) -hl("PreProc", { fg = c.green }) -hl("Include", { fg = c.aqua, italic = true }) -hl("Define", { fg = c.pink }) -hl("Macro", { fg = c.pink }) -hl("PreCondit", { fg = c.pink }) -hl("Special", { fg = c.white }) -hl("SpecialChar", { fg = c.pink }) -hl("Delimiter", { fg = c.white }) -hl("SpecialComment", { fg = c.grey, italic = true }) -hl("Tag", { fg = c.orange }) -hl("Todo", { fg = c.orange }) -hl("Comment", { fg = c.base6, italic = true }) -hl("Underlined", { underline = true }) -hl("Ignore", {}) -hl("Error", { fg = c.red }) -hl("Terminal", { fg = c.white, bg = c.base2 }) -hl("EndOfBuffer", { fg = c.base2 }) -hl("Conceal", { fg = c.grey }) -hl("vCursor", { reverse = true }) -hl("iCursor", { reverse = true }) -hl("lCursor", { reverse = true }) -hl("CursorIM", { reverse = true }) -hl("CursorColumn", { bg = c.base3 }) -hl("Whitespace", { fg = c.base5 }) -hl("WildMenu", { fg = c.white, bg = c.orange }) -hl("QuickFixLine", { fg = c.purple, bold = true }) -hl("Debug", { fg = c.orange }) -hl("debugBreakpoint", { fg = c.base2, bg = c.red }) -hl("Conditional", { fg = c.pink }) -hl("Repeat", { fg = c.pink }) -hl("Exception", { fg = c.pink }) - --- Plugins ---hl("@annotation", { fg = c.green }) ---hl("@attribute", { fg = c.green }) ---hl("@boolean", { fg = c.purple }) ---hl("@character", { fg = c.yellow }) ---hl("@character.special", { fg = c.purple }) ---hl("@comment", { fg = c.base6, italic = true }) ---hl("@conceal", { fg = c.grey }) ---hl("@conditional", { fg = c.pink }) ---hl("@conditional.ternary", { fg = c.pink }) ---hl("@constant", { fg = c.aqua }) ---hl("@constant.builtin", { fg = c.purple }) ---hl("@constant.macro", { fg = c.purple }) ---hl("@constructor", { fg = c.aqua }) ---hl("@debug", { fg = c.pink }) ---hl("@define", { fg = c.aqua }) ---hl("@definition", { fg = c.green }) ---hl("@definition.associated", { fg = c.green }) ---hl("@definition.constant", { fg = c.green }) ---hl("@definition.enum", { fg = c.green }) ---hl("@definition.field", { fg = c.green }) ---hl("@definition.function", { fg = c.green }) ---hl("@definition.import", { fg = c.white }) ---hl("@definition.macro", { fg = c.green, italic = true }) ---hl("@definition.method", { fg = c.green }) ---hl("@definition.namespace", { fg = c.white }) ---hl("@definition.parameter", { fg = c.orange }) ---hl("@definition.type", { fg = c.green }) ---hl("@definition.var", { fg = c.green }) ---hl("@error", { fg = c.red }) ---hl("@exception", { fg = c.pink }) ---hl("@field", { fg = c.white }) ---hl("@float", { fg = c.purple }) ---hl("@function", { fg = c.green, italic = true }) ---hl("@function.builtin", { fg = c.aqua }) ---hl("@function.call", { fg = c.white }) ---hl("@function.macro", { fg = c.green, italic = true }) ---hl("@include", { fg = c.aqua, italic = true }) ---hl("@keyword", { fg = c.pink, italic = true }) ---hl("@keyword.function", { fg = c.aqua, italic = true }) ---hl("@keyword.operator", { fg = c.pink }) ---hl("@keyword.return", { fg = c.pink }) ---hl("@label", { fg = c.pink }) ---hl("@math", { fg = c.yellow }) ---hl("@method", { fg = c.green }) ---hl("@method.call", { fg = c.white }) ---hl("@namespace", { fg = c.purple }) ---hl("@number", { fg = c.purple }) ---hl("@operator", { fg = c.pink }) ---hl("@parameter", { fg = c.orange }) ---hl("@parameter.reference", { fg = c.white }) ---hl("@preproc", { fg = c.green }) ---hl("@property", { fg = c.white }) ---hl("@punctuation.bracket", { fg = c.white }) ---hl("@punctuation.delimiter", { fg = c.white }) ---hl("@punctuation.special", { fg = c.pink }) ---hl("@reference", { fg = c.white }) ---hl("@repeat", { fg = c.pink }) ---hl("@scope", { fg = c.white }) ---hl("@storageclass", { fg = c.aqua }) ---hl("@storageclass.lifetime", { fg = c.aqua }) ---hl("@strike", { fg = c.grey }) ---hl("@string", { fg = c.yellow }) ---hl("@string.escape", { fg = c.purple }) ---hl("@string.regex", { fg = c.purple }) ---hl("@string.special", { fg = c.purple }) ---hl("@symbol", { fg = c.purple }) ---hl("@tag", { fg = c.pink }) ---hl("@tag.attribute", { fg = c.green }) ---hl("@tag.delimiter", { fg = c.white }) ---hl("@text", { fg = c.green }) ---hl("@text.danger", { fg = c.red, bold = true }) ---hl("@text.diff.add", { fg = c.diff_add }) ---hl("@text.diff.delete", { fg = c.diff_remove }) ---hl("@text.emphasis", { bold = true }) ---hl("@text.environment", { fg = c.purple }) ---hl("@text.environment.name", { fg = c.aqua }) ---hl("@text.literal", { fg = c.yellow }) ---hl("@text.math", { fg = c.yellow }) ---hl("@text.note", { fg = c.aqua, bold = true }) ---hl("@text.quote", { fg = c.grey }) ---hl("@text.reference", { fg = c.orange, italic = true }) ---hl("@text.strike", { fg = c.grey }) ---hl("@text.strong", { bold = true }) ---hl("@text.title", { fg = c.yellow, bold = true }) ---hl("@text.todo", { fg = c.aqua }) ---hl("@text.underline", { underline = true }) ---hl("@text.uri", { fg = c.aqua, underline = true }) ---hl("@text.warning", { fg = c.yellow, bold = true }) ---hl("@todo", { fg = c.aqua }) ---hl("@type", { fg = c.aqua }) ---hl("@type.builtin", { fg = c.aqua }) ---hl("@type.definition", { fg = c.aqua }) ---hl("@type.qualifier", { fg = c.pink }) ---hl("@uri", { fg = c.aqua, underline = true }) ---hl("@variable", { fg = c.white }) ---hl("@variable.builtin", { fg = c.orange }) ---hl("dbui_tables", { fg = c.white }) ---hl("DiagnosticSignError", { fg = c.red }) ---hl("DiagnosticSignWarn", { fg = c.yellow }) ---hl("DiagnosticSignInfo", { fg = c.white }) ---hl("DiagnosticSignHint", { fg = c.aqua }) ---hl("DiagnosticVirtualTextError", { fg = c.red }) ---hl("DiagnosticVirtualTextWarn", { fg = c.yellow }) ---hl("DiagnosticVirtualTextInfo", { fg = c.white }) ---hl("DiagnosticVirtualTextHint", { fg = c.aqua }) ---hl("DiagnosticUnderlineError", { undercurl = true, sp = c.red }) ---hl("DiagnosticUnderlineWarn", { undercurl = true, sp = c.yellow }) ---hl("DiagnosticUnderlineInfo", { undercurl = true, sp = c.white }) ---hl("DiagnosticUnderlineHint", { undercurl = true, sp = c.aqua }) ---hl("CursorWord0", { bg = c.white, fg = c.black }) ---hl("CursorWord1", { bg = c.white, fg = c.black }) ---hl("NvimTreeFolderName", { fg = c.white }) ---hl("NvimTreeRootFolder", { fg = c.pink }) ---hl("NvimTreeSpecialFile", { fg = c.white }) \ No newline at end of file diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 30972e0..13fa7bf 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,7 +1,6 @@ -require("boot") require("settings") -require("colors") +require("lsp") +require("packages") require("keys") -require("events") -require("commands") -require("languages") \ No newline at end of file +require("autocmds") +require("usercmds") \ No newline at end of file diff --git a/.config/nvim/lsp/clangd.lua b/.config/nvim/lsp/clangd.lua index 626d4e2..ef2ede0 100644 --- a/.config/nvim/lsp/clangd.lua +++ b/.config/nvim/lsp/clangd.lua @@ -1,5 +1,5 @@ return { cmd = { "clangd", "--background-index" }, - root_markers = { "meson_options.txt", "CMakePresets.json", "compile_commands.json" }, + root_markers = { "meson_options.txt", "CMakePresets.json" }, filetypes = { "c", "cpp" }, } \ No newline at end of file diff --git a/.config/nvim/lua/events.lua b/.config/nvim/lua/autocmds.lua similarity index 56% rename from .config/nvim/lua/events.lua rename to .config/nvim/lua/autocmds.lua index 440e4a6..6cced5c 100644 --- a/.config/nvim/lua/events.lua +++ b/.config/nvim/lua/autocmds.lua @@ -1,26 +1,6 @@ local on = vim.api.nvim_create_autocmd local group = vim.api.nvim_create_augroup("autocmds", {clear = true}) -on({ "LspAttach" }, { - desc = "LSP completion", - group = group, - callback = function(ev) - local client = vim.lsp.get_client_by_id(ev.data.client_id) - - if client:supports_method("textDocument/completion") then - vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) - end - end, -}) - -on({ "TextYankPost" }, { - desc = "Highlight when copying text", - group = group, - callback = function() - vim.highlight.on_yank() - end, -}) - on({ "BufNewFile", "BufRead" }, { desc = "Enable word wrap in text files and markdown documents", group = group, @@ -31,10 +11,60 @@ on({ "BufNewFile", "BufRead" }, { end, }) +on({ "LspAttach" }, { + desc = "LSP completion", + group = group, + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client:supports_method("textDocument/completion") then + vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) + end + end, +}) + on({ "TermOpen", "TermEnter" }, { desc = "Disable sign column in terminals", group = group, callback = function() vim.opt_local.signcolumn = "no" end, +}) + +on({ "TextYankPost" }, { + desc = "Highlight when copying text", + group = group, + callback = function() + vim.highlight.on_yank() + end, +}) + +on({ "VimEnter" }, { + desc = "Allow opening a directory and jumping to project root", + group = group, + callback = function() + -- Change file to its directory if needed + local name = vim.api.nvim_buf_get_name(0) + local is_directory = vim.fn.isdirectory(name) + + if is_directory == 0 then + name = vim.fs.dirname(name) + end + + -- Switch to root directory of the project + local root_patterns = { ".git", "go.mod", "init.lua" } + local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { + upward = true, + path = name, + })[1]) + + if root_dir then + vim.api.nvim_set_current_dir(root_dir) + else + vim.api.nvim_set_current_dir(name) + end + + if is_directory ~= 0 then + require("telescope.builtin").find_files() + end + end, }) \ No newline at end of file diff --git a/.config/nvim/lua/boot.lua b/.config/nvim/lua/boot.lua deleted file mode 100644 index c8efd46..0000000 --- a/.config/nvim/lua/boot.lua +++ /dev/null @@ -1,31 +0,0 @@ --- Disable providers -local disabled_providers = { - "node", - "perl", - "python3", - "ruby", -} - -for _, provider in ipairs(disabled_providers) do - vim.g["loaded_" .. provider .. "_provider"] = 0 -end - --- Disable plugins -local disabled_plugins = { - "2html_plugin", - "ftplugin", - "gzip", - "man", - "netrw", - "matchit", - "remote_plugins", - "spellfile_plugin", - "shada_plugin", - "tarPlugin", - "tutor_mode_plugin", - "zipPlugin", -} - -for _, plugin in ipairs(disabled_plugins) do - vim.g["loaded_" .. plugin] = 0 -end \ No newline at end of file diff --git a/.config/nvim/lua/colors.lua b/.config/nvim/lua/colors.lua deleted file mode 100644 index 537fa75..0000000 --- a/.config/nvim/lua/colors.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd("colorscheme monokai") \ No newline at end of file diff --git a/.config/nvim/lua/disabled/cmp.lua b/.config/nvim/lua/disabled/cmp.lua new file mode 100644 index 0000000..6c10686 --- /dev/null +++ b/.config/nvim/lua/disabled/cmp.lua @@ -0,0 +1,101 @@ +local icons = { + Namespace = "󰌗", + Text = "󰉿", + Method = "󰆧", + Function = "󰆧", + Constructor = "", + Field = "󰜢", + Variable = "󰀫", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "󰑭", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈚", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "󰙅", + Event = "", + Operator = "󰆕", + TypeParameter = "󰊄", + Table = "", + Object = "󰅩", + Tag = "", + Array = "[]", + Boolean = "", + Number = "", + Null = "󰟢", + String = "󰉿", + Calendar = "", + Watch = "󰥔", + Package = "", + Copilot = "", + Codeium = "", + TabNine = "", +} + +return { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + -- "hrsh7th/cmp-nvim-lsp", + -- "hrsh7th/cmp-buffer", + -- "hrsh7th/cmp-path", + -- "L3MON4D3/LuaSnip", + }, + opts = { + completion = { + autocomplete = true, + completeopt = "menu,menuone,noinsert", + }, + formatting = { + fields = { "abbr", "kind", "menu" }, + format = function(_, item) + local icon = icons[item.kind] or "" + item.kind = string.format(" %s %s", icon, item.kind) + return item + end, + }, + -- snippet = { + -- expand = function(args) + -- require("luasnip").lsp_expand(args.body) + -- end, + -- }, + -- preselect = cmp.PreselectMode.None, + sources = { + -- { name = "nvim_lsp" }, + -- { name = "luasnip" }, + { name = "buffer" }, + -- { name = "path" }, + }, + window = { + completion = { + border = "rounded", + scrollbar = false, + }, + documentation = { + border = "rounded", + } + }, + }, + config = function(_, opts) + local cmp = require("cmp") + + opts.mapping = { + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + } + + cmp.setup(opts) + end, +} diff --git a/.config/nvim/lua/disabled/fidget.lua b/.config/nvim/lua/disabled/fidget.lua new file mode 100644 index 0000000..00a18ac --- /dev/null +++ b/.config/nvim/lua/disabled/fidget.lua @@ -0,0 +1,11 @@ +return { + "j-hui/fidget.nvim", + opts = { + integration = { + ["nvim-tree"] = { + enable = true, + }, + }, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/indent.lua b/.config/nvim/lua/disabled/indent.lua new file mode 100644 index 0000000..10d362b --- /dev/null +++ b/.config/nvim/lua/disabled/indent.lua @@ -0,0 +1,15 @@ +return { + "lukas-reineke/indent-blankline.nvim", + event = "VeryLazy", + main = "ibl", + opts = { + indent = { + char = "▏", + }, + scope = { + enabled = true, + show_start = false, + }, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/lsp-notify.lua b/.config/nvim/lua/disabled/lsp-notify.lua new file mode 100644 index 0000000..6f61709 --- /dev/null +++ b/.config/nvim/lua/disabled/lsp-notify.lua @@ -0,0 +1,4 @@ +return { + "mrded/nvim-lsp-notify", + config = true, +} diff --git a/.config/nvim/lua/disabled/lsp.lua b/.config/nvim/lua/disabled/lsp.lua new file mode 100644 index 0000000..72ec8d4 --- /dev/null +++ b/.config/nvim/lua/disabled/lsp.lua @@ -0,0 +1,103 @@ +return { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + opts = { + servers = { + clangd = {}, + gdscript = {}, + gopls = {}, + lua_ls = { + settings = { + Lua = { + completion = { + callSnippet = "Replace", + }, + runtime = { + version = "LuaJIT", + }, + workspace = { + checkThirdParty = false, + library = { + "${3rd}/luv/library", + unpack(vim.api.nvim_get_runtime_file("", true)), + }, + }, + }, + }, + }, + rust_analyzer = { + settings = { + ["rust-analyzer"] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true + }, + }, + }, + }, + }, + }, + config = function(_, opts) + -- Servers + local servers = opts.servers + + for server, server_opts in pairs(servers) do + require("lspconfig")[server].setup(server_opts) + end + + -- Icons + local icons = { + Error = " ", + Warn = " ", + Hint = " ", + Info = " ", + } + + for name, icon in pairs(icons) do + name = "DiagnosticSign" .. name + vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + end + + -- Runs when the LSP is attached + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }), + callback = function(event) + local function map(mode, lhs, rhs, info) + vim.keymap.set(mode, lhs, rhs, { buffer = event.buf, desc = "LSP: " .. info }) + end + + map("n", "gr", require("telescope.builtin").lsp_references, "References") + map("n", "gd", require("telescope.builtin").lsp_definitions, "Definition") + map({ "n", "i" }, "", vim.lsp.buf.hover, "Hover") + map({ "n", "i" }, "", vim.lsp.buf.rename, "Rename") + map({ "n", "i" }, "", vim.lsp.buf.format, "Format") + map("n", "ca", vim.lsp.buf.code_action, "Code action") + + -- Highlight the word your cursor is on + -- local client = vim.lsp.get_client_by_id(event.data.client_id) + -- + -- if client and client.server_capabilities.documentHighlightProvider then + -- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + -- buffer = event.buf, + -- callback = vim.lsp.buf.document_highlight, + -- }) + -- + -- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { + -- buffer = event.buf, + -- callback = vim.lsp.buf.clear_references, + -- }) + -- end + end, + }) + end, +} diff --git a/.config/nvim/lua/disabled/luasnip.lua b/.config/nvim/lua/disabled/luasnip.lua new file mode 100644 index 0000000..a4865c1 --- /dev/null +++ b/.config/nvim/lua/disabled/luasnip.lua @@ -0,0 +1,11 @@ +return { + "L3MON4D3/LuaSnip", + dependencies = { + "rafamadriz/friendly-snippets" + }, + event = "InsertEnter", + version = "v2.*", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, +} diff --git a/.config/nvim/lua/disabled/mini-complete.lua b/.config/nvim/lua/disabled/mini-complete.lua new file mode 100644 index 0000000..698d0e6 --- /dev/null +++ b/.config/nvim/lua/disabled/mini-complete.lua @@ -0,0 +1,8 @@ +return { + "echasnovski/mini.completion", + event = "InsertEnter", + opts = { + set_vim_settings = false, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/mini-surround.lua b/.config/nvim/lua/disabled/mini-surround.lua new file mode 100644 index 0000000..e687abe --- /dev/null +++ b/.config/nvim/lua/disabled/mini-surround.lua @@ -0,0 +1,18 @@ +return { + "echasnovski/mini.surround", + event = { "BufReadPost", "BufNewFile" }, + opts = { + mappings = { + add = 'gsa', + delete = 'gsd', + find = 'gsf', + find_left = 'gsF', + highlight = 'gsh', + replace = 'gsr', + update_n_lines = 'gsn', + suffix_last = '', + suffix_next = '', + }, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/multicursor.lua b/.config/nvim/lua/disabled/multicursor.lua new file mode 100644 index 0000000..e168951 --- /dev/null +++ b/.config/nvim/lua/disabled/multicursor.lua @@ -0,0 +1,14 @@ +return { + "mg979/vim-visual-multi", + keys = { + { "", mode = { "n", "x" }, desc = "Multicursor (word)" }, + { "", mode = { "n", "x" }, desc = "Multicursor (next line)" }, + { "", mode = { "n", "x" }, desc = "Multicursor (previous line)" }, + }, + init = function() + vim.g.VM_maps = { + ["Find Under"] = "", + ["Find Subword Under"] = "", + } + end, +} diff --git a/.config/nvim/lua/disabled/noice.lua b/.config/nvim/lua/disabled/noice.lua new file mode 100644 index 0000000..b8ce7f6 --- /dev/null +++ b/.config/nvim/lua/disabled/noice.lua @@ -0,0 +1,17 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + }, + opts = { + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/notify.lua b/.config/nvim/lua/disabled/notify.lua new file mode 100644 index 0000000..27ffe6a --- /dev/null +++ b/.config/nvim/lua/disabled/notify.lua @@ -0,0 +1,11 @@ +return { + "rcarriga/nvim-notify", + event = "VeryLazy", + opts = { + background_colour = "#000000", + fps = 60, + render = "compact", + timeout = 0, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/nvterm.lua b/.config/nvim/lua/disabled/nvterm.lua new file mode 100644 index 0000000..ae6851d --- /dev/null +++ b/.config/nvim/lua/disabled/nvterm.lua @@ -0,0 +1,7 @@ +return { + "NvChad/nvterm", + keys = { + { "", "lua require('nvterm.terminal').toggle('float')", mode = { "n", "t" }, desc = "Toggle terminal" }, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/onedark.lua b/.config/nvim/lua/disabled/onedark.lua new file mode 100644 index 0000000..33b1b5a --- /dev/null +++ b/.config/nvim/lua/disabled/onedark.lua @@ -0,0 +1,19 @@ +return { + "navarasu/onedark.nvim", + lazy = false, + priority = 1000, + opts = { + style = "dark", + transparent = true, + term_colors = true, + highlights = { + ["StatusLine"] = {fg = "$bg3", bg = "Normal"}, + ["StatusLineNC"] = {fg = "$bg3", bg = "Normal"}, + }, + }, + config = function(_, opts) + local theme = require("onedark") + theme.setup(opts) + theme.load() + end, +} diff --git a/.config/nvim/lua/disabled/snacks.lua b/.config/nvim/lua/disabled/snacks.lua new file mode 100644 index 0000000..817be35 --- /dev/null +++ b/.config/nvim/lua/disabled/snacks.lua @@ -0,0 +1,10 @@ +return { + "folke/snacks.nvim", + event = "BufReadPre", + opts = { + explorer = { + replace_netrw = true, + }, + }, + config = true, +} \ No newline at end of file diff --git a/.config/nvim/lua/disabled/spectre.lua b/.config/nvim/lua/disabled/spectre.lua new file mode 100644 index 0000000..ebbe15e --- /dev/null +++ b/.config/nvim/lua/disabled/spectre.lua @@ -0,0 +1,7 @@ +return { + "nvim-pack/nvim-spectre", + keys = { + { "sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" }, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/tree.lua b/.config/nvim/lua/disabled/tree.lua new file mode 100644 index 0000000..b97f63d --- /dev/null +++ b/.config/nvim/lua/disabled/tree.lua @@ -0,0 +1,73 @@ +local function on_attach(bufnr) + local api = require("nvim-tree.api") + + -- default mappings + api.config.mappings.default_on_attach(bufnr) + + local function opts(desc) + return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } + end + + -- navigation + vim.keymap.set("n", "", api.tree.change_root_to_parent, opts("Up")) + vim.keymap.set("n", "", api.tree.change_root_to_parent, opts("Up")) + vim.keymap.set("n", "", api.tree.change_root_to_node, opts("Enter")) + vim.keymap.set("n", "", api.tree.change_root_to_node, opts("Enter")) + + -- open folders with a single click + vim.keymap.set("n", "", function() + vim.defer_fn(function () + local win = vim.api.nvim_get_current_win() + local view = require("nvim-tree.view") + if view.get_winnr() ~= win then return end + + api.node.open.edit() + api.tree.focus() + end, 10) + end, opts("Open folder/file")) +end + +return { + "nvim-tree/nvim-tree.lua", + event = "VeryLazy", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + keys = { + { "e", function() require("nvim-tree.api").tree.toggle() end, desc = "Toggle files" }, + }, + opts = { + filesystem_watchers = { + enable = true, + }, + filters = { + dotfiles = false, + }, + on_attach = on_attach, + renderer = { + root_folder_label = false, + highlight_git = true, + icons = { + show = { + git = false, + }, + glyphs = { + git = { + unstaged = "", + untracked = "", + deleted = "", + }, + }, + }, + }, + sync_root_with_cwd = true, + update_focused_file = { + enable = true, + update_root = false, + }, + view = { + width = 30, + }, + }, + config = true, +} diff --git a/.config/nvim/lua/disabled/trouble.lua b/.config/nvim/lua/disabled/trouble.lua new file mode 100644 index 0000000..2a79606 --- /dev/null +++ b/.config/nvim/lua/disabled/trouble.lua @@ -0,0 +1,16 @@ +return { + "folke/trouble.nvim", + event = "VeryLazy", + keys = { + { "x", function() require("trouble").toggle() end, desc = "Show errors" }, + }, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + opts = { + position = "right", + padding = false, + use_diagnostic_signs = true, + }, + config = true, +} diff --git a/.config/nvim/lua/keys.lua b/.config/nvim/lua/keys.lua index c5c3936..e8088fe 100644 --- a/.config/nvim/lua/keys.lua +++ b/.config/nvim/lua/keys.lua @@ -1,49 +1,37 @@ -vim.g.mapleader = " " - local function map(mode, lhs, rhs, info) vim.keymap.set(mode, lhs, rhs, { desc = info }) end --- Enter command mode without pressing shift map("n", ";", ":", "Command mode") - --- Undo with u, Redo with U map("n", "U", "redo", "Redo") - --- Quit with q like any other terminal app +map("n", "", "ToggleWord", "Toggle word") +map("n", "", "close", "Close window") +map("n", "l", "Lazy", "Lazy") map({"n", "v"}, "q", "qa", "Quit all") -map({"n", "v"}, "Q", "qa!", "Force quit") - --- Clear search with Esc +map({"n", "v"}, "q", "qa!", "Quit all") map({"n", "i"}, "", "noh", "Clear search") - --- Ctrl S to save the file from any mode map({"n", "i", "s", "v"}, "", "w", "Save file") --- Grab the line and move it up/down +-- Add or delete empty lines map("n", "", "set pastem`O``set nopaste", "Add empty line above") map("n", "", "m`-g/\\m^\\s*$/d``noh", "Delete empty line above") - --- Grab the line below and move it up/down map("n", "", "set pastem`o``set nopaste", "Add empty line below") map("n", "", "m`+g/\\m^\\s*$/d``noh", "Delete empty line below") --- Horizontal movement -map({"n", "v"}, "H", "^", "Beginning of line") -map({"n", "v"}, "L", "", "End of line") +-- Quick movement +map("n", "J", "}", "Next paragraph") +map("n", "K", "{", "Previous paragraph") --- Vertical movement -map({"n", "v"}, "J", "}", "Next paragraph") -map({"n", "v"}, "K", "{", "Previous paragraph") +-- Editing multiple instances +map("n", "", "*#:%s///g", "Replace word under cursor") +map("v", "", "y/\"N:%s//\"/g", "Replace selection") +map("n", "", "#*", "Search word under cursor") +map("v", "", "y/\"N", "Search selection") --- Indenting -map("n", "", "V>gv") -map("n", "", "V") -map("v", "", ">gv") -map("v", "", "", "ToggleWord", "Toggle word") +-- Line movement +map({"n", "v"}, "", "^", "Beginning of line") +map("i", "", "^i", "Beginning of line") +map({"i", "n", "v"}, "", "", "End of line") -- Increasing and decreasing numbers map("n", "+", "", "Increase number") @@ -51,17 +39,30 @@ map("n", "-", "", "Decrease number") map("n", "", "", "Increase number") map("n", "", "", "Decrease number") --- Replace all instances -map("n", "", "*#:%s///g", "Replace word under cursor") -map("v", "", "y/\"N:%s//\"/g", "Replace selection") +-- Indenting +map("n", "", "V>gv") +map("n", "", "V") +map("v", "", ">gv") +map("v", "", "", "#*", "Search word under cursor") -map("v", "", "y/\"N", "Search selection") +-- Shift arrow selection +map("n", "", "v") +map("n", "", "v") +map("n", "", "v") +map("n", "", "v") --- Window management +map("v", "", "") +map("v", "", "") +map("v", "", "") +map("v", "", "") + +map("i", "", "v") +map("i", "", "v") +map("i", "", "v") +map("i", "", "v") + +-- Window switching map("n", "", "k", "Move to the window above") map("n", "", "j", "Move to the window below") map("n", "", "h", "Move to the window on the left") map("n", "", "l", "Move to the window on the right") -map("n", "", "close", "Close window") \ No newline at end of file diff --git a/.config/nvim/lua/languages.lua b/.config/nvim/lua/lsp.lua similarity index 82% rename from .config/nvim/lua/languages.lua rename to .config/nvim/lua/lsp.lua index 58f4de1..6f1d10a 100644 --- a/.config/nvim/lua/languages.lua +++ b/.config/nvim/lua/lsp.lua @@ -1,9 +1,7 @@ --- Virtual text vim.diagnostic.config({ virtual_lines = true, }) --- LSP vim.lsp.enable({ "clangd", "gopls", diff --git a/.config/nvim/lua/packages.lua b/.config/nvim/lua/packages.lua new file mode 100644 index 0000000..82a9611 --- /dev/null +++ b/.config/nvim/lua/packages.lua @@ -0,0 +1,69 @@ +-- Install the package manager if needed +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", + lazypath, + }) +end + +vim.opt.rtp:prepend(lazypath) + +-- Load plugins +require("lazy").setup("plugins", { + defaults = { + lazy = true, + }, + change_detection = { + notify = false + }, + rocks = { + enabled = false + }, + ui = { + icons = { + ft = "", + lazy = "󰂠 ", + loaded = "", + not_loaded = "", + }, + }, + performance = { + rtp = { + disabled_plugins = { + "2html_plugin", + "tohtml", + "getscript", + "getscriptPlugin", + "gzip", + "logipat", + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "matchit", + "tar", + "tarPlugin", + "rrhelper", + "spellfile_plugin", + "vimball", + "vimballPlugin", + "zip", + "zipPlugin", + "tutor", + "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", + }, + }, + }, +}) \ No newline at end of file diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..6378d47 --- /dev/null +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,5 @@ +return { + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, +} diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..b21a3d2 --- /dev/null +++ b/.config/nvim/lua/plugins/comment.lua @@ -0,0 +1,23 @@ +return { + "numToStr/Comment.nvim", + keys = { + { + "", + "lua require('Comment.api').toggle.linewise.current()", + desc = "Toggle comment", + }, + { + "", + "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", + mode = "v", + desc = "Toggle comment", + }, + }, + config = true, + opts = { + mappings = { + basic = false, + extra = false, + }, + }, +} diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua new file mode 100644 index 0000000..2f69412 --- /dev/null +++ b/.config/nvim/lua/plugins/flash.lua @@ -0,0 +1,9 @@ +return { + "folke/flash.nvim", + event = { "BufReadPost", "BufNewFile" }, + keys = { + { "s", function() require("flash").jump() end, mode = { "n", "o", "x" }, desc = "Flash" }, + { "S", function() require("flash").treesitter() end, mode = { "n", "o", "x" }, desc = "Flash Treesitter" }, + }, + config = true, +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..419cbd8 --- /dev/null +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,5 @@ +return { + "lewis6991/gitsigns.nvim", + event = "BufReadPre", + config = true, +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/monokai.lua b/.config/nvim/lua/plugins/monokai.lua new file mode 100644 index 0000000..8dd7b26 --- /dev/null +++ b/.config/nvim/lua/plugins/monokai.lua @@ -0,0 +1,7 @@ +return { + "tanvirtin/monokai.nvim", + lazy = false, + priority = 1000, + opts = {}, + config = true, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..8f18a87 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,36 @@ +return { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-project.nvim", + }, + keys = { + {"", "Telescope buffers", desc = "Buffers"}, + {"f", "Telescope find_files", desc = "Find files"}, + {"p", "Telescope project", desc = "Projects"}, + {"r", "Telescope oldfiles", desc = "Recent files"}, + }, + config = function() + require("telescope").setup({ + defaults = { + mappings = { + i = { + [""] = require("telescope.actions").close, + }, + }, + prompt_prefix = " ", + selection_caret = " ", + }, + extensions = { + project = { + base_dirs = { + { path = "~/projects", max_depth = 3 }, + }, + order_by = "desc", + sync_with_nvim_tree = true, + theme = "dropdown", + }, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..78459c1 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,18 @@ +return { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPost", "BufNewFile" }, + build = ":TSUpdate", + opts = { + ensure_installed = { + "go", + "gomod", + "gowork", + "gosum", + }, + highlight = { enable = true }, + indent = { enable = true }, + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, +} diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index c4e9067..b113589 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -1,3 +1,11 @@ +-- Globals +local g = vim.g +g.mapleader = " " + +for _, provider in ipairs { "node", "perl", "python3", "ruby" } do + g["loaded_" .. provider .. "_provider"] = 0 +end + -- Options local opt = vim.opt opt.autowrite = false @@ -43,4 +51,8 @@ opt.statusline = "%{repeat('─',winwidth('.'))}" -- Undo opt.undofile = true -opt.undolevels = 10000 \ No newline at end of file +opt.undolevels = 10000 + +-- Virtual text +vim.diagnostic.config({ virtual_lines = true }) +vim.lsp.enable({"clangd", "gopls", "rust-analyzer"}) \ No newline at end of file diff --git a/.config/nvim/lua/commands.lua b/.config/nvim/lua/usercmds.lua similarity index 97% rename from .config/nvim/lua/commands.lua rename to .config/nvim/lua/usercmds.lua index 12522d1..570d0fb 100644 --- a/.config/nvim/lua/commands.lua +++ b/.config/nvim/lua/usercmds.lua @@ -11,7 +11,6 @@ vim.api.nvim_create_user_command("ToggleWord", function() ["yes"] = "no", ["Yes"] = "No", ["YES"] = "NO", - ["y"] = "n", ["1"] = "0", ["<"] = ">", ["("] = ")", diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index ad2a19e..15b6f73 100644 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -1,7 +1,7 @@ { "layer": "top", "position": "top", - "modules-left": ["cpu", "memory", "disk"], + "modules-left": ["cpu", "custom/gpu", "memory", "disk"], "modules-center": ["hyprland/workspaces"], "modules-right": ["wireplumber", "clock"], "include": "~/.config/waybar/modules.jsonc", diff --git a/.config/waybar/modules.jsonc b/.config/waybar/modules.jsonc index e32a11c..eab87ff 100644 --- a/.config/waybar/modules.jsonc +++ b/.config/waybar/modules.jsonc @@ -1,52 +1,9 @@ { "cpu": { "interval": 2, - "format": " {usage}%", - "on-click": "$TERMINAL -- btop --preset 1", - }, - "memory": { - "interval": 2, - "format": " {used} G", - "on-click": "$TERMINAL -- btop --preset 2", - }, - "disk": { - "interval": 30, - "format": "󰋊 {specific_used:0.0f} G", - "path": "/", - "unit": "GiB", - "on-click": "$TERMINAL -- nnn -Td /", - }, - "hyprland/workspaces": { - "format": "{icon}", - "persistent-workspaces": { - "*": 9 - }, - "format-icons": { - "default": " ", - "empty": " ", - "active": " ", - "urgent": " ", - }, - "sort-by-number": true, - "on-click": "activate", - }, - "wireplumber": { - "format": "{icon} {volume}%", - "format-muted": " ", - "format-icons": [" ", " ", " "], - "scroll-step": 2, - "on-click": "easyeffects", - }, - "clock": { - "interval": 60, - "format": " {:%H:%M}", - "tooltip-format": "{calendar}", - "calendar": { - "format": { - "today": "{}" - } - }, - "on-click": "date -u +'%Y-%m-%dT%H:%M:%SZ' | wl-copy", + "format": "{icon} {usage}%", + "format-icons": ["󰾆 ", "󰾅 ", "󰓅 "], + "on-click": "$TERMINAL -- btop", }, "custom/gpu": { "interval": 2, @@ -55,6 +12,18 @@ "return-type": "", "on-click": "$TERMINAL -- nvtop", }, + "memory": { + "interval": 2, + "format": " {used} G", + "on-click": "$TERMINAL -- btop", + }, + "disk": { + "interval": 30, + "format": "󰋊 {specific_used:0.0f} G", + "path": "/", + "unit": "GiB", + "on-click": "$TERMINAL -- dua i /", + }, "custom/pacman": { "format": " {}", "interval": 30, @@ -88,4 +57,36 @@ "tooltip-format": "Number of processes with UDP connections", "on-click": "$TERMINAL -- bandwhich", }, + "hyprland/workspaces": { + "format": "{icon}", + "persistent-workspaces": { + "*": 9 + }, + "format-icons": { + "default": " ", + "empty": " ", + "active": " ", + "urgent": " ", + }, + "sort-by-number": true, + "on-click": "activate", + }, + "wireplumber": { + "format": "{icon} {volume}%", + "format-muted": " ", + "format-icons": [" ", " ", " "], + "scroll-step": 5, + "on-click": "easyeffects", + }, + "clock": { + "interval": 60, + "format": " {:%H:%M}", + "tooltip-format": "{calendar}", + "calendar": { + "format": { + "today": "{}" + } + }, + "on-click": "date -u +'%Y-%m-%dT%H:%M:%SZ' | wl-copy", + }, } \ No newline at end of file diff --git a/.config/wlogout/layout b/.config/wlogout/layout index 3faf70d..e125ce4 100644 --- a/.config/wlogout/layout +++ b/.config/wlogout/layout @@ -6,13 +6,13 @@ } { "label" : "shutdown", - "action" : "doas poweroff", + "action" : "systemctl poweroff", "text" : "Shutdown", "keybind" : "s" } { "label" : "reboot", - "action" : "doas reboot", + "action" : "systemctl reboot", "text" : "Reboot", "keybind" : "r" } diff --git a/.config/yazi/keymap.toml b/.config/yazi/keymap.toml new file mode 100644 index 0000000..b5f0281 --- /dev/null +++ b/.config/yazi/keymap.toml @@ -0,0 +1,4 @@ +[[manager.prepend_keymap]] +on = [ "" ] +run = 'shell "$SHELL" --block --confirm' +desc = "Open shell here" \ No newline at end of file diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml new file mode 100644 index 0000000..a01d710 --- /dev/null +++ b/.config/yazi/yazi.toml @@ -0,0 +1,2 @@ +[manager] +show_hidden = true \ No newline at end of file diff --git a/.env b/.env deleted file mode 100644 index 4e93052..0000000 --- a/.env +++ /dev/null @@ -1,32 +0,0 @@ -XDG_CACHE_HOME=$HOME/.cache -XDG_CONFIG_HOME=$HOME/.config -XDG_DATA_HOME=$HOME/.local/share -XDG_BIN_HOME=$HOME/.local/bin -XDG_LIB_HOME=$HOME/.local/lib -XDG_STATE_HOME=$HOME/.local/state -CARGO_HOME=$XDG_DATA_HOME/cargo -CUDA_CACHE_PATH=$XDG_CACHE_HOME/nv -DOTNET_CLI_HOME=$XDG_DATA_HOME/dotnet -GOPATH=$XDG_DATA_HOME/go -GTK2_RC_FILES=$XDG_CONFIG_HOME/gtk-2.0/gtkrc -HISTFILE=$XDG_STATE_HOME/bash/history -NIMBLE_DIR=$XDG_DATA_HOME/nimble -NUGET_PACKAGES=$XDG_CACHE_HOME/nuget -RUSTUP_HOME=$XDG_DATA_HOME/rustup -W3M_DIR=$XDG_DATA_HOME/w3m -WINEPREFIX=$XDG_DATA_HOME/wine -GOAMD64=v3 -GOARM64=v8.2 -BROWSER=firefox -EDITOR=nvim -VISUAL=$EDITOR -LANG=en_US.UTF-8 -PAGER=less -SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket -TERMINAL=foot -PATH="/usr/sbin:/usr/bin:/sbin:/bin" -PATH="/usr/lib/ccache/bin:$PATH" -PATH="$GOPATH/bin:$PATH" -PATH="$CARGO_HOME/bin:$PATH" -PATH="$XDG_BIN_HOME:$PATH" -PATH="$XDG_CONFIG_HOME/fish/scripts:$PATH" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9d7d6e9..3ac64d3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,13 +6,13 @@ lazy-lock.json !.editorconfig !.gitignore !.init -!.env !/.config /.config/* !/.config/alacritty !/.config/btop !/.config/cava !/.config/easyeffects +!/.config/environment.d !/.config/fastfetch !/.config/foot !/.config/fish diff --git a/.init b/.init index ce30d1c..5a7901a 100755 --- a/.init +++ b/.init @@ -1,2 +1,2 @@ -#!/usr/bin/fish -dbus-run-session Hyprland \ No newline at end of file +#!/bin/fish +uwsm start hyprland.desktop \ No newline at end of file