From aa85f4ff439f422809b16468243f4edfdeac1ee1 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Fri, 18 Apr 2025 20:50:42 +0700 Subject: [PATCH] feat(zinit): integrate zinit for improved shell configuration (#1) --- aria2/.config/aria2/aria2.conf | 4 + codium/.config/VSCodium/User/keybindings.json | 1 - codium/.config/VSCodium/User/settings.json | 87 ----- codium/.config/VSCodium/product.json | 8 - containers/.config/containers/containers.conf | 2 + fastfetch/.config/fastfetch/config.conf | 323 ------------------ fastfetch/.config/fastfetch/config.jsonc | 42 +++ ghostty/.config/ghostty/config | 3 + git/.gitconfig | 7 + zsh/.config/zsh/.zshrc | 79 ++--- zsh/.config/zsh/aliases.zsh | 5 - zsh/.config/zsh/eval.zsh | 5 - zsh/.config/zsh/exports.zsh | 18 - zsh/.config/zsh/snippets/aliases | 20 ++ zsh/.config/zsh/snippets/bin | 37 ++ zsh/.config/zsh/snippets/exports | 11 + zsh/.config/zsh/snippets/options | 30 ++ zsh/.config/zsh/zinit | 12 + 18 files changed, 202 insertions(+), 492 deletions(-) create mode 100644 aria2/.config/aria2/aria2.conf delete mode 100644 codium/.config/VSCodium/User/keybindings.json delete mode 100644 codium/.config/VSCodium/User/settings.json delete mode 100644 codium/.config/VSCodium/product.json create mode 100644 containers/.config/containers/containers.conf delete mode 100644 fastfetch/.config/fastfetch/config.conf create mode 100644 fastfetch/.config/fastfetch/config.jsonc create mode 100644 ghostty/.config/ghostty/config delete mode 100644 zsh/.config/zsh/aliases.zsh delete mode 100644 zsh/.config/zsh/eval.zsh delete mode 100644 zsh/.config/zsh/exports.zsh create mode 100644 zsh/.config/zsh/snippets/aliases create mode 100644 zsh/.config/zsh/snippets/bin create mode 100644 zsh/.config/zsh/snippets/exports create mode 100644 zsh/.config/zsh/snippets/options create mode 100644 zsh/.config/zsh/zinit diff --git a/aria2/.config/aria2/aria2.conf b/aria2/.config/aria2/aria2.conf new file mode 100644 index 0000000..68497b4 --- /dev/null +++ b/aria2/.config/aria2/aria2.conf @@ -0,0 +1,4 @@ +enable-rpc = true +rpc-listen-all = true +dir = ~/Downloads +# rpc-secret = your_password diff --git a/codium/.config/VSCodium/User/keybindings.json b/codium/.config/VSCodium/User/keybindings.json deleted file mode 100644 index 0637a08..0000000 --- a/codium/.config/VSCodium/User/keybindings.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/codium/.config/VSCodium/User/settings.json b/codium/.config/VSCodium/User/settings.json deleted file mode 100644 index 054cf02..0000000 --- a/codium/.config/VSCodium/User/settings.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "editor.acceptSuggestionOnEnter": "on", - "editor.accessibilitySupport": "off", - "editor.bracketPairColorization.enabled": true, - "editor.colorDecorators": true, - "editor.cursorBlinking": "smooth", - "editor.cursorSmoothCaretAnimation": "on", - "editor.fontFamily": "JetBrainsMono Nerd Font", - "editor.fontLigatures": true, - "editor.formatOnPaste": false, - "editor.formatOnSave": false, - "editor.formatOnType": false, - "editor.largeFileOptimizations": false, - "editor.linkedEditing": true, - "editor.quickSuggestions": { - "strings": true - }, - "editor.rulers": [ - 80 - ], - "editor.semanticHighlighting.enabled": "configuredByTheme", - "editor.smoothScrolling": true, - "editor.suggestSelection": "first", - "editor.tabSize": 2, - "emmet.includeLanguages": { - "postcss": "css" - }, - "eslint.format.enable": true, - "explorer.fileNesting.enabled": false, - "files.eol": "\n", - "files.exclude": {}, - "files.simpleDialog.enable": true, - "files.trimTrailingWhitespace": true, - "json.maxItemsComputed": 100000, - "search.searchOnType": false, - "security.workspace.trust.untrustedFiles": "open", - "telemetry.telemetryLevel": "off", - "terminal.integrated.cursorStyle": "line", - "terminal.integrated.defaultProfile.linux": "zsh", - "terminal.integrated.defaultProfile.windows": "PowerShell Core", - "terminal.integrated.fontFamily": "JetBrainsMono Nerd Font", - "terminal.integrated.gpuAcceleration": "on", - "terminal.integrated.persistentSessionReviveProcess": "never", - "typescript.tsdk": "node_modules/typescript/lib", - "typescript.updateImportsOnFileMove.enabled": "always", - "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", - "window.autoDetectColorScheme": false, - "workbench.editor.preferHistoryBasedLanguageDetection": true, - "workbench.list.smoothScrolling": true, - "workbench.startupEditor": "none", - "git.autofetch": true, - "css.validate": false, - "diffEditor.ignoreTrimWhitespace": false, - "files.watcherExclude": { - // "**/public/**": true - }, - "search.exclude": { - // "**/public": true - }, - "editor.inlineSuggest.enabled": false, - "git.ignoreRebaseWarning": true, - "[vue]": { - "editor.defaultFormatter": "dbaeumer.vscode-eslint" - }, - "vue.complete.casing.props": "kebab", - "vue.complete.casing.tags": "kebab", - "vsicons.dontShowNewVersionMessage": true, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "vscode.json-language-features" - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "git.enableSmartCommit": true, - "syncSettings.resources": [ - "extensions", - "keybindings", - "settings", - "snippets", - "uiState" - ], - "workbench.iconTheme": "vscode-icons", - "editor.fontSize": 14 -} \ No newline at end of file diff --git a/codium/.config/VSCodium/product.json b/codium/.config/VSCodium/product.json deleted file mode 100644 index ba7257d..0000000 --- a/codium/.config/VSCodium/product.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extensionsGallery": { - "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", - "itemUrl": "https://marketplace.visualstudio.com/items", - "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", - "controlUrl": "" - } -} diff --git a/containers/.config/containers/containers.conf b/containers/.config/containers/containers.conf new file mode 100644 index 0000000..ea1803c --- /dev/null +++ b/containers/.config/containers/containers.conf @@ -0,0 +1,2 @@ +[engine] +compose_warning_logs = false diff --git a/fastfetch/.config/fastfetch/config.conf b/fastfetch/.config/fastfetch/config.conf deleted file mode 100644 index 726664b..0000000 --- a/fastfetch/.config/fastfetch/config.conf +++ /dev/null @@ -1,323 +0,0 @@ -# Fastfetch configuration -# Write every argument in different lines. -# Direct arguments will overwrite the corresponding ones in this file. -# Argument keys are not case sensitive. -# Whitespaces are trimmed at the beginning and the end. -# Empty lines or lines starting with # are ignored. - -# This file was shipped with 1.7.2. -# Use fastfetch --print-config-user > ~/.config/fastfetch/config.conf to overwrite this file with the current defaults - -# Below some often usefull options are listed. Uncomment and modify them so they take affect. -# Note that there are a lot more options than the ones listed here, take a look at "fastfetch --help". -# Of course all of them can be made persistent here too. - -# Config option: -# Load additional config files. -# Some are shipped with fastfetch, list them with "fastfetch --list-presets". -# Must be a path to a config file or the name of a shipped preset. -# The config file is completly loaded before continuing in the current file, so the placement of this option matters, as later options overwrite already set ones. -# Can be used multiple times to load multiple config files / presets. -#--load-config /path/to/config.txt - -# Structure option: -# Sets the modules to use and their order. -# Must be a list of module names, separated by colons. -# List available modules with "fastfetch --list-modules". -# Get the default structure with "fastfetch --print-structure". -#--structure Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:Locale:Break:Colors - -# Multithreading option: -# Sets if fastfetch should use multiple threads to detect the values. -# Must be true or false. -# Default is true. -#--multithreading true - -# Slow operations option: -# Sets if fastfetch is allowed to use known slow operations to detect more / better values. -# Must be true or false. -# Default is false. -#--allow-slow-operations false - -# Linewrap option: -# Sets if fastfetch should disable linewrap during the run. -# Must be true or false. -# Default is true. -#--disable-linewrap true - -# Cursor option: -# Sets if fastfetch should hide the console cursor during the run. -# Must be true or false. -# Default is true. -#--hide-cursor true - -# Logo option: -# Sets the logo to use. -# List available logos with "fastfetch --list-logos". -# Print available logos with "fastfetch --print-logos". -# Must be the name of an available logo or a path to a text file containing a custom logo. -# Default is the current distribution. -#--logo arch - -# Logo type option: -# Sets the logo type to use. -# Must be auto, builtin, file, raw, sixel, kitty or chafa. -# Default is auto. -#--logo-type auto - -# Logo width option: -# Sets the width of the logo (in characters) if the logo is an image. -# Must be a positive integer. -# Default is 65. -#--logo-width 65 - -# Logo height option: -# Sets the height of the logo (in characters) if the logo is an image. -# Must be a positive integer. -# Default is 0 (keeps aspect ration). -#--logo-height 0 - -# Logo color options: -# Overwrite a color in the logo. Also works for user provided logos. -# In the user logo, they replace $[1-9]. Use $$ to print a single $ sign. -# Must be linux console color codes or the name of a color. -# Default is the one specified by the logo. -# Use "fastfetch --help color" to learn more and see examples. -# Valid index range is [1-9]. -#--logo-color-1 red -#--logo-color-2 32 -# [...] -#--logo-color-9 yellow - -# Logo padding option: -# Adds a padding to the left and the right side of the logo. -# Must be a positive integer. -# Default is 0. -#--logo-padding 0 - -# Logo padding left option: -# Adds a padding to the left side of the logo. -# Must be a positive integer. -# Default is 0. -#--logo-padding-left 0 - -# Logo padding right option: -# Adds a padding to the right side of the logo. -# Must be a positive integer. -# Default is 0. -#--logo-padding-right 0 - -# Logo print remaining option: -# Sets if the remaining logo should be printed, it is has more lines than modules to show. -# Must be true or false. -# Default is true. -#--logo-print-remaining true - -# Color keys option: -# Sets the color of the keys. -# Must be linux console color codes or the name of a color. -# Default is the key color of the logo. -# Use "fastfetch --help color" to learn more and see examples. -#--color-keys magenta - -# Color title option: -# Sets the color of the title. -# Must be linux console color codes or the name of a color. -# Default is the title color of the logo. -# Use "fastfetch --help color" to learn more and see examples. -#--color-title magenta - -# Binary prefix option: -# Sets the binary prefix to use. -# Must be a IEC, SI or JEDEC. -# Default is IEC. -#--binary-prefix IEC - -# Title FQDN option: -# Sets if the title should use the fully qualified domain name. -# Must be true or false. -# Default is false. -#--title-fqdn false - -# Separator option: -# Sets the string placed between a key and its value. -# Can be any string. -# Default is ": ". -#--separator ": " - -# Separator string option: -# Sets the string printed by the "separator" module (usually between title and rest of output) -# Must be any string. It is repated / cut to fit perfectly. -# Default is "-" -#--separator-string - - -# Public IP timeout option: -# Sets the time to wait for the public ip server to respond. -# Must be a positive integer. -# Default is 0 (disabled). -#--public-ip-timeout 0 - -# OS file option -# Sets the path to the file containing the operating system information. -# Should be a valid path to an existing file. -# Note that you might need to run fastfetch with --recache once for it to take affect. -# Default is /etc/os-release. -#--os-file /etc/os-release - -# Player name option -# Sets the name of the player. This is also used in song detection -# Must be the exact name of the player or a dbus address (e.g. org.mpris.MediaPlayer2.spotify) -# Default is the first match starting with org.mpris.MediaPlayer2. -#--player-name spotify - -# Escape bedrock option -# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one -# Must be true or false. -# Default is true. -#--escape-bedrock true - -# GL option -# Sets with opengl context creation library to use -# Must be either auto, egl, glx or osmesa -# Default is auto. -#--gl auto - -# Key options: -# Sets the displayed key of a module -# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help. -#--os-key OS -#--host-key Host -#--kernel-key Kernel -#--uptime-key Uptime -#--processes-key Processes -#--packages-key Packages -#--shell-key Shell -#--resolution-key Resolution {1} -#--de-key DE -#--wm-key WM -#--wm-theme-key WM Theme -#--theme-key Theme -#--icons-key Icons -#--font-key Font -#--cursor-key Cursor -#--terminal-key Terminal -#--terminal-font-key Terminal Font -#--cpu-key CPU -#--cpu-usage-key CPU Usage -#--gpu-key GPU {1} -#--memory-key Memory -#--swap-key Swap -#--disk-key Disk ({1}) -#--battery-key Battery {1} -#--locale-key Locale -#--local-ip-key Local IP ({1}) -#--public-ip-key Public IP -#--player-key Media Player -#--song-key Song -#--datetime-key Date Time -#--vulkan-key Vulkan -#--opengl-key OpenGL -#--opencl-key OpenCL - -# Format options: -# Sets the format string for module values. -# For information on format strings, see "fastfetch --help format". -# To see the parameter they take and their default value, see "fastfetch --help *-format", e.g. "fastfetch --help os-format". -# An empty format string (As they are currently below) will behave as if it was not set. -#--os-format -#--host-format -#--kernel-format -#--uptime-format -#--processes-format -#--packages-format -#--shell-format -#--resolution-format -#--de-format -#--wm-format -#--wm-theme-format -#--theme-format -#--icons-format -#--font-format -#--cursor-format -#--terminal-format -#--terminal-font-format -#--cpu-format -#--cpu-usage-format -#--gpu-format -#--memory-format -#--swap-format -#--disk-format -#--battery-format -#--locale-format -#--local-ip-format -#--public-ip-format -#--player-format -#--song-format -#--datetime-format -#--vulkan-format -#--opengl-format -#--opencl-format - -# Error options: -# Sets the format string to use if an error occured -# For information on format strings, see "fastfetch --help format". -# Each of them take the error as first and only argument. -# If one of them is set, the module will appear, even if --show-errors is not given. -#--os-error -#--host-error -#--kernel-error -#--uptime-error -#--processes-error -#--packages-error -#--shell-error -#--resolution-error -#--de-error -#--wm-error -#--wm-theme-error -#--theme-error -#--icons-error -#--font-error -#--cursor-error -#--terminal-error -#--terminal-font-error -#--cpu-error -#--cpu-usage-error -#--gpu-error -#--memory-error -#--swap-error -#--disk-error -#--battery-error -#--locale-error -#--local-ip-error -#--public-ip-error -#--player-error -#--song-error -#--datetime-error -#--vulkan-error -#--opengl-error -#--opencl-error - -# Library options: -# Sets an user specific path to a library to load. -# Must be a valid path to a library. -#--lib-PCI /usr/lib/libpci.so -#--lib-vulkan /usr/lib/libvulkan.so -#--lib-wayland /usr/lib/libwayland-client.so -#--lib-xcb-randr /usr/lib/libxcb-randr.so -#--lib-xcb /usr/lib/libxcb.so -#--lib-Xrandr /usr/lib/libXrandr.so -#--lib-X11 /usr/lib/libX11.so -#--lib-gio /usr/lib/libgio-2.0.so -#--lib-DConf /usr/lib/libdconf.so -#--lib-DBus /usr/lib/libdbus-1.so -#--lib-XFConf /usr/lib/libxfconf-0.so -#--lib-sqlite3 /usr/lib/libsqlite3.so -#--lib-rpm /usr/lib/librpm.so -#--lib-imagemagick /usr/lib/libMagickCore-7.Q16HDRI.so -#--lib-z /usr/lib/libz.so -#--lib-chafa /usr/lib/libchafa.so -#--lib-egl /usr/lib/libEGL.so -#--lib-glx /usr/lib/libGLX.so -#--lib-osmesa /usr/lib/libOSMesa.so -#--lib-opencl /usr/lib/libOpenCL.so - \ No newline at end of file diff --git a/fastfetch/.config/fastfetch/config.jsonc b/fastfetch/.config/fastfetch/config.jsonc new file mode 100644 index 0000000..0108ba1 --- /dev/null +++ b/fastfetch/.config/fastfetch/config.jsonc @@ -0,0 +1,42 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "builtin", + "source": "arch" + }, + "modules": [ + "title", + "separator", + { + "type": "os", + "format": "Arch Linux ({12})" + }, + "host", + "kernel", + "uptime", + { + "type": "packages", + "format": "{} (pacman)" + }, + "shell", + "display", + "de", + "wm", + "wmtheme", + "theme", + "icons", + "font", + "cursor", + "terminal", + "terminalfont", + "cpu", + "gpu", + "memory", + "disk", + "battery", + "poweradapter", + "locale", + "break", + "colors" + ] +} \ No newline at end of file diff --git a/ghostty/.config/ghostty/config b/ghostty/.config/ghostty/config new file mode 100644 index 0000000..fcbbeb4 --- /dev/null +++ b/ghostty/.config/ghostty/config @@ -0,0 +1,3 @@ +font-family = "JetBrainsMono Nerd Font" +theme = "SpaceGray Eighties" +cursor-style = bar diff --git a/git/.gitconfig b/git/.gitconfig index 04bc2c7..81b8495 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -3,3 +3,10 @@ [user] name = Tri Vo Khac email = 33442340+vokhactri@users.noreply.github.com +[filter "lfs"] + required = true + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process +[push] + autoSetupRemote = true diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 6d02363..50fdf08 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -1,49 +1,38 @@ -ZAP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/zap" -ZAP_SCRIPT="$ZAP_DIR/zap.zsh" -ZAP_BRANCH=release-v1 +# install zinit +source $ZDOTDIR/zinit -if [ ! -f $ZAP_SCRIPT ]; then - git clone -b "$ZAP_BRANCH" https://github.com/zap-zsh/zap.git "$ZAP_DIR" -fi +# load remote plugins +zinit wait lucid light-mode id-as depth"1" for \ + wintermi/zsh-brew \ + hlissner/zsh-autopair \ + Aloxaf/fzf-tab \ + atinit"zicompinit; zicdreplay -q" \ + zdharma-continuum/fast-syntax-highlighting \ + atload"_zsh_autosuggest_start" \ + zsh-users/zsh-autosuggestions -source "$ZAP_SCRIPT" +# load prompt theme +zinit ice as"command" from"gh-r" id-as \ + atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ + atpull"%atclone" src"init.zsh" +zinit light starship/starship -remote_plugins=( - zap-zsh/supercharge - zap-zsh/fzf - wintermi/zsh-lsd - wintermi/zsh-fnm - zsh-users/zsh-autosuggestions - zsh-users/zsh-completions - zdharma-continuum/fast-syntax-highlighting - hlissner/zsh-autopair -) -plugins=("${remote_plugins[@]}" "$ZDOTDIR/*") -mac_plugins=(wintermi/zsh-brew) +# load binaries +zinit as"command" wait lucid light-mode from"gh-r" id-as for \ + extract"!" lsd-rs/lsd \ + extract"!" zyedidia/micro \ + extract"!" cp"autocomplete/bat.zsh -> _bat" @sharkdp/bat \ + extract"!" pick"usr/bin/fastfetch" \ + fastfetch-cli/fastfetch \ + atclone"./zoxide init zsh > init.zsh" atpull"%atclone" src"init.zsh" \ + ajeetdsouza/zoxide \ + atclone"./fzf --zsh > init.zsh" atpull="%atclone" src"init.zsh" \ + junegunn/fzf \ + atclone"./fnm env --use-on-cd --shell zsh > init.zsh; ./fnm completions --shell zsh > _fnm" atpull"%atclone" src"init.zsh" Schniz/fnm -case "$(uname -s)" in -Darwin) - # echo 'Mac OS X' - plugins=("${mac_plugins[@]}" "${plugins[@]}") - ;; -Linux) - # echo 'Linux' - ;; -CYGWIN* | MINGW32* | MSYS* | MINGW*) - # echo 'MS Windows' - ;; -*) - # echo 'Other OS' - ;; -esac - -for plugin in $plugins; do plug $plugin; done - -# Clean startup prompt -[ ! -f ~/.hushlogin ] && touch ~/.hushlogin - -unsetopt PROMPT_SP - -# Load and initialise completion system -autoload -Uz compinit -compinit +# load local scripts +zinit is-snippet id-as for \ + $ZDOTDIR/snippets/exports \ + $ZDOTDIR/snippets/aliases \ + $ZDOTDIR/snippets/options \ + $ZDOTDIR/snippets/bin diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh deleted file mode 100644 index f438a9c..0000000 --- a/zsh/.config/zsh/aliases.zsh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env zsh - -[ -x "$(command -v bat)" ] && alias cat="bat" -[ -x "$(command -v codium)" ] && alias code="codium" -[ -x "$(command -v nvim)" ] && alias v="nvim" diff --git a/zsh/.config/zsh/eval.zsh b/zsh/.config/zsh/eval.zsh deleted file mode 100644 index a94565f..0000000 --- a/zsh/.config/zsh/eval.zsh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env zsh - -command -v zoxide > /dev/null 2>&1 && eval "$(zoxide init zsh)" -command -v starship > /dev/null 2>&1 && eval "$(starship init zsh)" -command -v opam > /dev/null 2>&1 && eval $(opam env) diff --git a/zsh/.config/zsh/exports.zsh b/zsh/.config/zsh/exports.zsh deleted file mode 100644 index c7c0169..0000000 --- a/zsh/.config/zsh/exports.zsh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env zsh - -HISTFILE="$ZDOTDIR"/.zsh_history -HISTSIZE=1000000 -SAVEHIST=1000000 - -export MANWIDTH=999 - -export EDITOR="micro" -export PAGE="bat" -export VISUAL="micro" -export SUDO_EDITOR="micro" - -export STARSHIP_CONFIG="$XDG_CONFIG_HOME"/starship/starship.toml - -export NODE_OPTIONS="--dns-result-order=ipv4first" - -export PATH="/home/trivk/.local/share/fnm:$PATH" diff --git a/zsh/.config/zsh/snippets/aliases b/zsh/.config/zsh/snippets/aliases new file mode 100644 index 0000000..76d3a99 --- /dev/null +++ b/zsh/.config/zsh/snippets/aliases @@ -0,0 +1,20 @@ +#!/usr/bin/env zsh + +# Modern alternatives to traditional commands +alias cat='bat' +alias ls='lsd -A' +alias la='lsd -lA' +alias tree='lsd --tree' +alias nano='micro' +alias fetch='fastfetch' + +# Git shortcuts +alias g='git' +alias gs='git status -sb' +alias ga='git add' +alias gc='git commit' +alias gp='git push' +alias gl='git pull' + +# Docker shortcuts +alias docker='podman' diff --git a/zsh/.config/zsh/snippets/bin b/zsh/.config/zsh/snippets/bin new file mode 100644 index 0000000..068af8c --- /dev/null +++ b/zsh/.config/zsh/snippets/bin @@ -0,0 +1,37 @@ +#!/usr/bin/env zsh + +# Add GNU tools to PATH without 'g' prefix +local gnu_tools=( + "coreutils" + "findutils" + "gnu-tar" + "gnu-sed" + "gawk" + "gnu-indent" + "grep" +) + +for tool in $gnu_tools; do + local gnubin="/opt/homebrew/opt/$tool/libexec/gnubin" + if [ -d "$gnubin" ]; then + case ":$PATH:" in + *":$gnubin:"*) ;; + *) export PATH="$gnubin:$PATH" ;; + esac + fi +done + +# Add other bins separately since they have a different path structure +local bin_paths=( + "$HOME/.local/bin" + "/opt/homebrew/opt/gnu-getopt/bin" +) +for bin_path in $bin_paths; do + if [ -d "$bin_path" ]; then + case ":$PATH:" in + *":$bin_path:"*) ;; + *) export PATH="$bin_path:$PATH" ;; + esac + fi +done + diff --git a/zsh/.config/zsh/snippets/exports b/zsh/.config/zsh/snippets/exports new file mode 100644 index 0000000..3d1cc39 --- /dev/null +++ b/zsh/.config/zsh/snippets/exports @@ -0,0 +1,11 @@ +#!/usr/bin/env zsh + +export MANWIDTH=999 + +export EDITOR="micro" +export PAGER="bat" +export VISUAL="micro" +export SUDO_EDITOR="micro" +export COMPANY_DIR="$HOME/Documents/work/company/" + +export STARSHIP_CONFIG="$XDG_CONFIG_HOME"/starship/starship.toml diff --git a/zsh/.config/zsh/snippets/options b/zsh/.config/zsh/snippets/options new file mode 100644 index 0000000..fba4995 --- /dev/null +++ b/zsh/.config/zsh/snippets/options @@ -0,0 +1,30 @@ +#!/usr/bin/env zsh + +unsetopt BEEP +setopt AUTO_CD +setopt GLOB_DOTS +setopt NOMATCH +setopt MENU_COMPLETE +setopt EXTENDED_GLOB +setopt INTERACTIVE_COMMENTS +setopt APPEND_HISTORY +setopt PUSHD_IGNORE_DUPS + +setopt BANG_HIST # Treat the '!' character specially during expansion. +setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format. +setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits. +setopt SHARE_HISTORY # Share history between all sessions. +setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history. +setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again. +setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate. +setopt HIST_FIND_NO_DUPS # Do not display a line previously found. +setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space. +setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file. +setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. +setopt HIST_VERIFY # Don't execute immediately upon history expansion. + +HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history" +HISTSIZE=5000000 +SAVEHIST=5000000 + +zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath' diff --git a/zsh/.config/zsh/zinit b/zsh/.config/zsh/zinit new file mode 100644 index 0000000..5e653b1 --- /dev/null +++ b/zsh/.config/zsh/zinit @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh + +ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" +[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)" +[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" + +# not to use aliases: zi or zini +declare -A ZINIT +ZINIT[NO_ALIASES]=1 +ZINIT[LIST_COMMAND]='lsd --tree' + +source "${ZINIT_HOME}/zinit.zsh"