diff --git a/README.md b/README.md index 60995a8..5642066 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ # 🐱 dotfiles My dotfiles. + +## Installing packages + +```shell +pacman --sync - < packages.txt +``` + +## Installing dotfiles + +```shell +plow --force +``` + +or... + +```shell +plow --force --from ./home --to ~ +``` diff --git a/flake.nix b/flake.nix index 58daebb..e6e57f7 100644 --- a/flake.nix +++ b/flake.nix @@ -14,15 +14,17 @@ flake-parts.lib.mkFlake {inherit inputs;} { systems = nixpkgs.lib.systems.flakeExposed; - perSystem = {pkgs, ...}: { - devShells.default = pkgs.mkShellNoCC { - packages = [ - (pkgs.writeShellApplication { - name = "plow"; + perSystem = { + pkgs, + self', + ... + }: { + packages.plow = pkgs.callPackage ./plow {}; - text = builtins.readFile ./plow.sh; - }) - ]; + devShells.default = pkgs.mkShellNoCC { + PLOW_FROM = "./home"; + + packages = [self'.packages.plow]; }; }; }; diff --git a/bash/.bashrc b/home/bash/.bashrc similarity index 100% rename from bash/.bashrc rename to home/bash/.bashrc diff --git a/fish/.config/fish/config.fish b/home/fish/.config/fish/config.fish similarity index 100% rename from fish/.config/fish/config.fish rename to home/fish/.config/fish/config.fish diff --git a/git/.config/git/config b/home/git/.config/git/config similarity index 61% rename from git/.config/git/config rename to home/git/.config/git/config index 48d9595..f759e09 100644 --- a/git/.config/git/config +++ b/home/git/.config/git/config @@ -1,7 +1,12 @@ [user] name = Lukas Wurzinger email = lukas@wrz.one + signingkey = ~/.ssh/id_ed25519.pub [core] excludesFile = ~/.config/git/ignore [init] defaultBranch = main +[gpg] + format = ssh +[commit] + gpgsign = true diff --git a/git/.config/git/ignore b/home/git/.config/git/ignore similarity index 100% rename from git/.config/git/ignore rename to home/git/.config/git/ignore diff --git a/home/gitui/.config/gitui/theme.ron b/home/gitui/.config/gitui/theme.ron new file mode 100644 index 0000000..dd31525 --- /dev/null +++ b/home/gitui/.config/gitui/theme.ron @@ -0,0 +1,23 @@ +( + selected_tab: Some("Reset"), + command_fg: Some("#cdd6f4"), + selection_bg: Some("#585b70"), + selection_fg: Some("#cdd6f4"), + cmdbar_bg: Some("#181825"), + cmdbar_extra_lines_bg: Some("#181825"), + disabled_fg: Some("#7f849c"), + diff_line_add: Some("#a6e3a1"), + diff_line_delete: Some("#f38ba8"), + diff_file_added: Some("#a6e3a1"), + diff_file_removed: Some("#eba0ac"), + diff_file_moved: Some("#cba6f7"), + diff_file_modified: Some("#fab387"), + commit_hash: Some("#b4befe"), + commit_time: Some("#bac2de"), + commit_author: Some("#74c7ec"), + danger_fg: Some("#f38ba8"), + push_gauge_bg: Some("#89b4fa"), + push_gauge_fg: Some("#1e1e2e"), + tag_fg: Some("#f5e0dc"), + branch_fg: Some("#94e2d5") +) diff --git a/helix/.config/helix/config.toml b/home/helix/.config/helix/config.toml similarity index 83% rename from helix/.config/helix/config.toml rename to home/helix/.config/helix/config.toml index 2d4d0bb..ed3136d 100644 --- a/helix/.config/helix/config.toml +++ b/home/helix/.config/helix/config.toml @@ -13,12 +13,41 @@ select = "underline" [editor.lsp] display-messages = true +[editor.whitespace.render] +space = "none" +tab = "none" +nbsp = "all" +nnbsp = "all" +newline = "none" + [editor.whitespace.characters] -space = " " -newline = "⏎" -tab = "→" -tabpad = "·" +space = "·" nbsp = "⍽" +nnbsp = "␣" +tab = "→" +newline = "⏎" +tabpad = "·" + +[editor.indent-guides] +render = true +character = "▏" +skip-levels = 1 + +[editor.soft-wrap] +enable = true + +[editor.file-picker] +hidden = false + +[editor.statusline] +mode.normal = "NORMAL" +mode.insert = "INSERT" +mode.select = "SELECT" + +[editor.auto-save] +focus-lost = true +after-delay.enable = true +after-delay.timeout = 3000 [keys.normal] # Nicities @@ -60,7 +89,6 @@ u = ["undo", "collapse_selection"] "#" = ["move_char_right", "move_prev_word_start", "move_next_word_end", "search_selection", "search_prev"] [keys.insert] -# Nicities esc = ["collapse_selection", "normal_mode"] [keys.select] diff --git a/helix/.config/helix/languages.toml b/home/helix/.config/helix/languages.toml similarity index 100% rename from helix/.config/helix/languages.toml rename to home/helix/.config/helix/languages.toml diff --git a/helix/.config/helix/themes/github_dark_high_contrast_transparent.toml b/home/helix/.config/helix/themes/github_dark_high_contrast_transparent.toml similarity index 100% rename from helix/.config/helix/themes/github_dark_high_contrast_transparent.toml rename to home/helix/.config/helix/themes/github_dark_high_contrast_transparent.toml diff --git a/nix/.config/nix/nix.conf b/home/nix/.config/nix/nix.conf similarity index 100% rename from nix/.config/nix/nix.conf rename to home/nix/.config/nix/nix.conf diff --git a/home/ripgrep/.config/ripgrep/ripgreprc b/home/ripgrep/.config/ripgrep/ripgreprc new file mode 100644 index 0000000..06348ff --- /dev/null +++ b/home/ripgrep/.config/ripgrep/ripgreprc @@ -0,0 +1,6 @@ +--hidden + +--glob +!.git/* + +--smart-case diff --git a/ssh/.ssh/config b/home/ssh/.ssh/config similarity index 100% rename from ssh/.ssh/config rename to home/ssh/.ssh/config diff --git a/starship/.config/starship/starship.toml b/home/starship/.config/starship/starship.toml similarity index 100% rename from starship/.config/starship/starship.toml rename to home/starship/.config/starship/starship.toml diff --git a/home/zellij/.config/zellij/config.kdl b/home/zellij/.config/zellij/config.kdl new file mode 100644 index 0000000..4bea7a5 --- /dev/null +++ b/home/zellij/.config/zellij/config.kdl @@ -0,0 +1,293 @@ +keybinds clear-defaults=true { + locked { + bind "Ctrl g" { SwitchToMode "normal"; } + } + pane { + bind "left" { MoveFocus "left"; } + bind "down" { MoveFocus "down"; } + bind "up" { MoveFocus "up"; } + bind "right" { MoveFocus "right"; } + bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; } + bind "d" { NewPane "down"; SwitchToMode "normal"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; } + bind "j" { MoveFocus "down"; } + bind "k" { MoveFocus "up"; } + bind "l" { MoveFocus "right"; } + bind "n" { NewPane; SwitchToMode "normal"; } + bind "p" { SwitchFocus; } + bind "Ctrl p" { SwitchToMode "normal"; } + bind "r" { NewPane "right"; SwitchToMode "normal"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "normal"; } + bind "z" { TogglePaneFrames; SwitchToMode "normal"; } + } + tab { + bind "left" { GoToPreviousTab; } + bind "down" { GoToNextTab; } + bind "up" { GoToPreviousTab; } + bind "right" { GoToNextTab; } + bind "1" { GoToTab 1; SwitchToMode "normal"; } + bind "2" { GoToTab 2; SwitchToMode "normal"; } + bind "3" { GoToTab 3; SwitchToMode "normal"; } + bind "4" { GoToTab 4; SwitchToMode "normal"; } + bind "5" { GoToTab 5; SwitchToMode "normal"; } + bind "6" { GoToTab 6; SwitchToMode "normal"; } + bind "7" { GoToTab 7; SwitchToMode "normal"; } + bind "8" { GoToTab 8; SwitchToMode "normal"; } + bind "9" { GoToTab 9; SwitchToMode "normal"; } + bind "[" { BreakPaneLeft; SwitchToMode "normal"; } + bind "]" { BreakPaneRight; SwitchToMode "normal"; } + bind "b" { BreakPane; SwitchToMode "normal"; } + bind "h" { GoToPreviousTab; } + bind "j" { GoToNextTab; } + bind "k" { GoToPreviousTab; } + bind "l" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "normal"; } + bind "r" { SwitchToMode "renametab"; TabNameInput 0; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "normal"; } + bind "Ctrl t" { SwitchToMode "normal"; } + bind "x" { CloseTab; SwitchToMode "normal"; } + bind "tab" { ToggleTab; } + } + resize { + bind "left" { Resize "Increase left"; } + bind "down" { Resize "Increase down"; } + bind "up" { Resize "Increase up"; } + bind "right" { Resize "Increase right"; } + bind "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + bind "=" { Resize "Increase"; } + bind "H" { Resize "Decrease left"; } + bind "J" { Resize "Decrease down"; } + bind "K" { Resize "Decrease up"; } + bind "L" { Resize "Decrease right"; } + bind "h" { Resize "Increase left"; } + bind "j" { Resize "Increase down"; } + bind "k" { Resize "Increase up"; } + bind "l" { Resize "Increase right"; } + bind "Ctrl n" { SwitchToMode "normal"; } + } + move { + bind "left" { MovePane "left"; } + bind "down" { MovePane "down"; } + bind "up" { MovePane "up"; } + bind "right" { MovePane "right"; } + bind "h" { MovePane "left"; } + bind "Ctrl h" { SwitchToMode "normal"; } + bind "j" { MovePane "down"; } + bind "k" { MovePane "up"; } + bind "l" { MovePane "right"; } + bind "n" { MovePane; } + bind "p" { MovePaneBackwards; } + bind "tab" { MovePane; } + } + scroll { + bind "Alt left" { MoveFocusOrTab "left"; SwitchToMode "normal"; } + bind "Alt down" { MoveFocus "down"; SwitchToMode "normal"; } + bind "Alt up" { MoveFocus "up"; SwitchToMode "normal"; } + bind "Alt right" { MoveFocusOrTab "right"; SwitchToMode "normal"; } + bind "e" { EditScrollback; SwitchToMode "normal"; } + bind "Alt h" { MoveFocusOrTab "left"; SwitchToMode "normal"; } + bind "Alt j" { MoveFocus "down"; SwitchToMode "normal"; } + bind "Alt k" { MoveFocus "up"; SwitchToMode "normal"; } + bind "Alt l" { MoveFocusOrTab "right"; SwitchToMode "normal"; } + bind "s" { SwitchToMode "entersearch"; SearchInput 0; } + } + search { + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "n" { Search "down"; } + bind "o" { SearchToggleOption "WholeWord"; } + bind "p" { Search "up"; } + bind "w" { SearchToggleOption "Wrap"; } + } + session { + bind "c" { + LaunchOrFocusPlugin "configuration" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "Ctrl o" { SwitchToMode "normal"; } + bind "p" { + LaunchOrFocusPlugin "plugin-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + bind "w" { + LaunchOrFocusPlugin "session-manager" { + floating true + move_to_focused_tab true + } + SwitchToMode "normal" + } + } + shared_except "locked" { + bind "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + bind "Alt =" { Resize "Increase"; } + bind "Alt [" { PreviousSwapLayout; } + bind "Alt ]" { NextSwapLayout; } + bind "Alt f" { ToggleFloatingPanes; } + bind "Ctrl g" { SwitchToMode "locked"; } + bind "Alt i" { MoveTab "left"; } + bind "Alt n" { NewPane; } + bind "Alt o" { MoveTab "right"; } + bind "Ctrl q" { Quit; } + } + shared_except "locked" "move" { + bind "Ctrl h" { SwitchToMode "move"; } + } + shared_except "locked" "session" { + bind "Ctrl o" { SwitchToMode "session"; } + } + shared_except "locked" "scroll" { + bind "Alt left" { MoveFocusOrTab "left"; } + bind "Alt down" { MoveFocus "down"; } + bind "Alt up" { MoveFocus "up"; } + bind "Alt right" { MoveFocusOrTab "right"; } + bind "Alt h" { MoveFocusOrTab "left"; } + bind "Alt j" { MoveFocus "down"; } + bind "Alt k" { MoveFocus "up"; } + bind "Alt l" { MoveFocusOrTab "right"; } + } + shared_except "locked" "scroll" "search" "tmux" { + bind "Ctrl b" { SwitchToMode "tmux"; } + } + shared_except "locked" "scroll" "search" { + bind "Ctrl s" { SwitchToMode "scroll"; } + } + shared_except "locked" "tab" { + bind "Ctrl t" { SwitchToMode "tab"; } + } + shared_except "locked" "pane" { + bind "Ctrl p" { SwitchToMode "pane"; } + } + shared_except "locked" "resize" { + bind "Ctrl n" { SwitchToMode "resize"; } + } + shared_except "normal" "locked" "entersearch" { + bind "enter" { SwitchToMode "normal"; } + } + shared_except "normal" "locked" "entersearch" "renametab" "renamepane" { + bind "esc" { SwitchToMode "normal"; } + } + shared_among "pane" "tmux" { + bind "x" { CloseFocus; SwitchToMode "normal"; } + } + shared_among "scroll" "search" { + bind "PageDown" { PageScrollDown; } + bind "PageUp" { PageScrollUp; } + bind "left" { PageScrollUp; } + bind "down" { ScrollDown; } + bind "up" { ScrollUp; } + bind "right" { PageScrollDown; } + bind "Ctrl b" { PageScrollUp; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "normal"; } + bind "d" { HalfPageScrollDown; } + bind "Ctrl f" { PageScrollDown; } + bind "h" { PageScrollUp; } + bind "j" { ScrollDown; } + bind "k" { ScrollUp; } + bind "l" { PageScrollDown; } + bind "Ctrl s" { SwitchToMode "normal"; } + bind "u" { HalfPageScrollUp; } + } + entersearch { + bind "Ctrl c" { SwitchToMode "scroll"; } + bind "esc" { SwitchToMode "scroll"; } + bind "enter" { SwitchToMode "search"; } + } + renametab { + bind "esc" { UndoRenameTab; SwitchToMode "tab"; } + } + shared_among "renametab" "renamepane" { + bind "Ctrl c" { SwitchToMode "normal"; } + } + renamepane { + bind "esc" { UndoRenamePane; SwitchToMode "pane"; } + } + shared_among "session" "tmux" { + bind "d" { Detach; } + } + tmux { + bind "left" { MoveFocus "left"; SwitchToMode "normal"; } + bind "down" { MoveFocus "down"; SwitchToMode "normal"; } + bind "up" { MoveFocus "up"; SwitchToMode "normal"; } + bind "right" { MoveFocus "right"; SwitchToMode "normal"; } + bind "space" { NextSwapLayout; } + bind "\"" { NewPane "down"; SwitchToMode "normal"; } + bind "%" { NewPane "right"; SwitchToMode "normal"; } + bind "," { SwitchToMode "renametab"; } + bind "[" { SwitchToMode "scroll"; } + bind "Ctrl b" { Write 2; SwitchToMode "normal"; } + bind "c" { NewTab; SwitchToMode "normal"; } + bind "h" { MoveFocus "left"; SwitchToMode "normal"; } + bind "j" { MoveFocus "down"; SwitchToMode "normal"; } + bind "k" { MoveFocus "up"; SwitchToMode "normal"; } + bind "l" { MoveFocus "right"; SwitchToMode "normal"; } + bind "n" { GoToNextTab; SwitchToMode "normal"; } + bind "o" { FocusNextPane; } + bind "p" { GoToPreviousTab; SwitchToMode "normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "normal"; } + } +} + +plugins { + compact-bar location="zellij:compact-bar" + configuration location="zellij:configuration" + filepicker location="zellij:strider" { + cwd "/" + } + plugin-manager location="zellij:plugin-manager" + session-manager location="zellij:session-manager" + status-bar location="zellij:status-bar" + strider location="zellij:strider" + tab-bar location="zellij:tab-bar" + welcome-screen location="zellij:session-manager" { + welcome_screen true + } +} + +simplified_ui true + +theme "catppuccin-mocha" + +default_mode "normal" + +default_layout "compact" + +mouse_mode true + +pane_frames true + +mirror_session true + +on_force_close "detach" + +scroll_buffer_size 10000 + +copy_command "wl-copy" + +copy_clipboard "system" + +copy_on_select true + +attach_to_session false + +auto_layout true + +session_serialization true + +serialize_pane_viewport true + +scrollback_lines_to_serialize 10000 + +styled_underlines true + +disable_session_metadata false + +support_kitty_keyboard_protocol true diff --git a/packages.txt b/packages.txt index 392ef26..a70138c 100644 --- a/packages.txt +++ b/packages.txt @@ -1,6 +1,12 @@ bash direnv +fd fish +git +gitui helix nix +ripgrep starship +wl-clipboard +zellij diff --git a/plow/default.nix b/plow/default.nix new file mode 100644 index 0000000..30a0c52 --- /dev/null +++ b/plow/default.nix @@ -0,0 +1,6 @@ +{writeShellApplication}: +writeShellApplication { + name = "plow"; + + text = builtins.readFile ./plow.bash; +} diff --git a/plow.sh b/plow/plow.bash old mode 100644 new mode 100755 similarity index 89% rename from plow.sh rename to plow/plow.bash index 58630f5..5ad0e12 --- a/plow.sh +++ b/plow/plow.bash @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -o errexit set -o nounset set -o pipefail @@ -8,8 +10,8 @@ opts=$(getopt --options f:t:Fivm: --longoptions=from:,to:,force,interactive,verb eval set -- "$opts" -from=$PWD -to=$HOME +from=${PLOW_FROM:-$PWD} +to=${PLOW_TO:-$HOME} lnflags=() mkdirflags=() while true; do @@ -46,6 +48,9 @@ while true; do esac done +from=$(realpath --strip -- "$from") +to=$(realpath --strip -- "$to") + if (( $# > 0 )); then choices=("$@") else