From 885a795aa5f441ee7a51d78e55153a2ad37a4f19 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac Date: Thu, 4 Jul 2024 17:49:07 +0700 Subject: [PATCH 01/17] refactor: use zinit --- zsh/.config/zsh/.zshrc | 75 ++++++++++++++++----------------------- zsh/.config/zsh/zinit.zsh | 6 ++++ 2 files changed, 36 insertions(+), 45 deletions(-) create mode 100644 zsh/.config/zsh/zinit.zsh diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 6d02363..647ae29 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -1,49 +1,34 @@ -ZAP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/zap" -ZAP_SCRIPT="$ZAP_DIR/zap.zsh" -ZAP_BRANCH=release-v1 +# install zinit +source $ZDOTDIR/zinit.zsh -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 for \ + wintermi/zsh-brew \ + zap-zsh/supercharge \ + wintermi/zsh-fnm \ + hlissner/zsh-autopair \ + atinit"zicompinit; zicdreplay -q" \ + zdharma-continuum/fast-syntax-highlighting \ + atload"_zsh_autosuggest_start" \ + zsh-users/zsh-autosuggestions \ + blockf atpull'zinit creinstall -q .' \ + zsh-users/zsh-completions -source "$ZAP_SCRIPT" +# load local snippets +zinit snippet $ZDOTDIR/exports.zsh +zinit snippet $ZDOTDIR/aliases.zsh -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 prompt theme +zinit ice as"command" from"gh-r" \ + atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ + atpull"%atclone" src"init.zsh" +zinit light starship/starship -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 binaries +zinit as"command" wait lucid light-mode from"gh-r" for \ + pick"bat-*/bat" atclone'cd $(ls -d */|head -n 1); cp autocomplete/bat.zsh _bat' atpull"%atclone" @sharkdp/bat \ + pick"lsd-*/lsd" lsd-rs/lsd \ + 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 diff --git a/zsh/.config/zsh/zinit.zsh b/zsh/.config/zsh/zinit.zsh new file mode 100644 index 0000000..53081ce --- /dev/null +++ b/zsh/.config/zsh/zinit.zsh @@ -0,0 +1,6 @@ +#!/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" +source "${ZINIT_HOME}/zinit.zsh" -- 2.54.0 From 398aa1e8649e4f87b30aab95bf27479521743795 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Thu, 4 Jul 2024 22:06:54 +0700 Subject: [PATCH 02/17] update: - remove codium - remove unnecessary exports - add micro and fnm binanry - fix cd + tab issue --- codium/.config/VSCodium/User/keybindings.json | 1 - codium/.config/VSCodium/User/settings.json | 87 ------------------- codium/.config/VSCodium/product.json | 8 -- zsh/.config/zsh/.zshrc | 8 +- zsh/.config/zsh/aliases.zsh | 2 - zsh/.config/zsh/eval.zsh | 5 -- zsh/.config/zsh/exports.zsh | 5 -- 7 files changed, 4 insertions(+), 112 deletions(-) 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 delete mode 100644 zsh/.config/zsh/eval.zsh 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/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 647ae29..277222c 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -4,11 +4,9 @@ source $ZDOTDIR/zinit.zsh # load remote plugins zinit wait lucid light-mode for \ wintermi/zsh-brew \ - zap-zsh/supercharge \ - wintermi/zsh-fnm \ hlissner/zsh-autopair \ atinit"zicompinit; zicdreplay -q" \ - zdharma-continuum/fast-syntax-highlighting \ + zdharma-continuum/fast-syntax-highlighting zap-zsh/supercharge \ atload"_zsh_autosuggest_start" \ zsh-users/zsh-autosuggestions \ blockf atpull'zinit creinstall -q .' \ @@ -28,7 +26,9 @@ zinit light starship/starship zinit as"command" wait lucid light-mode from"gh-r" for \ pick"bat-*/bat" atclone'cd $(ls -d */|head -n 1); cp autocomplete/bat.zsh _bat' atpull"%atclone" @sharkdp/bat \ pick"lsd-*/lsd" lsd-rs/lsd \ + pick"micro-*/micro" zyedidia/micro \ 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 + junegunn/fzf \ + atclone"./fnm env --use-on-cd > init.zsh" atpull"%atclone" src"init.zsh" Schniz/fnm \ No newline at end of file diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index f438a9c..e4c1d72 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -1,5 +1,3 @@ #!/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 index c7c0169..1a3994f 100644 --- a/zsh/.config/zsh/exports.zsh +++ b/zsh/.config/zsh/exports.zsh @@ -1,6 +1,5 @@ #!/usr/bin/env zsh -HISTFILE="$ZDOTDIR"/.zsh_history HISTSIZE=1000000 SAVEHIST=1000000 @@ -12,7 +11,3 @@ 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" -- 2.54.0 From 31b2255fbe7d3f200f815270d105ac5ad3c8233b Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:03:26 +0700 Subject: [PATCH 03/17] update(aliases): add lsd --- zsh/.config/zsh/aliases.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index e4c1d72..ff1b6b6 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -1,3 +1,4 @@ #!/usr/bin/env zsh -[ -x "$(command -v bat)" ] && alias cat="bat" +(($+commands[bat])) && alias cat="bat" +(($+commands[lsd])) && alias ls="lsd" -- 2.54.0 From 406c0a5d6a27d3492ebef33222ef5b4f138a04e1 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:03:54 +0700 Subject: [PATCH 04/17] feat: add fzf tab plugin --- zsh/.config/zsh/.zshrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 277222c..e55e9dd 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -5,6 +5,7 @@ source $ZDOTDIR/zinit.zsh zinit wait lucid light-mode for \ wintermi/zsh-brew \ hlissner/zsh-autopair \ + Aloxaf/fzf-tab \ atinit"zicompinit; zicdreplay -q" \ zdharma-continuum/fast-syntax-highlighting zap-zsh/supercharge \ atload"_zsh_autosuggest_start" \ @@ -31,4 +32,7 @@ zinit as"command" wait lucid light-mode from"gh-r" for \ ajeetdsouza/zoxide \ atclone"./fzf --zsh > init.zsh" atpull="%atclone" src"init.zsh" \ junegunn/fzf \ - atclone"./fnm env --use-on-cd > init.zsh" atpull"%atclone" src"init.zsh" Schniz/fnm \ No newline at end of file + atclone"./fnm env --use-on-cd > init.zsh" atpull"%atclone" src"init.zsh" Schniz/fnm + + +zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath' -- 2.54.0 From 5263d1f693763a1e42c2f713f15b396a7bdeb35f Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:46:20 +0700 Subject: [PATCH 05/17] update: optimize binary loading --- zsh/.config/zsh/.zshrc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index e55e9dd..bf29a86 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -25,9 +25,11 @@ zinit light starship/starship # load binaries zinit as"command" wait lucid light-mode from"gh-r" for \ - pick"bat-*/bat" atclone'cd $(ls -d */|head -n 1); cp autocomplete/bat.zsh _bat' atpull"%atclone" @sharkdp/bat \ - pick"lsd-*/lsd" lsd-rs/lsd \ - pick"micro-*/micro" zyedidia/micro \ + extract"!" lsd-rs/lsd \ + extract"!" zyedidia/micro \ + extract"!" cp"autocomplete/bat.zsh -> _bat" @sharkdp/bat \ + extract"!" atclone="cp usr/bin/fastfetch .; rm -rf usr" \ + 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" \ -- 2.54.0 From 5ed0cba195682d99920249cb11e769b837e76f37 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Sat, 20 Jul 2024 20:39:25 +0700 Subject: [PATCH 06/17] update: fastfetch config --- fastfetch/.config/fastfetch/config.conf | 323 ----------------------- fastfetch/.config/fastfetch/config.jsonc | 42 +++ 2 files changed, 42 insertions(+), 323 deletions(-) delete mode 100644 fastfetch/.config/fastfetch/config.conf create mode 100644 fastfetch/.config/fastfetch/config.jsonc 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 -- 2.54.0 From da6f073bdc454c7986e208fafd7e25e110e6b876 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac Date: Thu, 25 Jul 2024 13:16:56 +0700 Subject: [PATCH 07/17] fix(zshrc): set up aliases during binaries loading --- zsh/.config/zsh/.zshrc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index bf29a86..923e77c 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -13,10 +13,6 @@ zinit wait lucid light-mode for \ blockf atpull'zinit creinstall -q .' \ zsh-users/zsh-completions -# load local snippets -zinit snippet $ZDOTDIR/exports.zsh -zinit snippet $ZDOTDIR/aliases.zsh - # load prompt theme zinit ice as"command" from"gh-r" \ atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \ @@ -25,9 +21,9 @@ zinit light starship/starship # load binaries zinit as"command" wait lucid light-mode from"gh-r" for \ - extract"!" lsd-rs/lsd \ - extract"!" zyedidia/micro \ - extract"!" cp"autocomplete/bat.zsh -> _bat" @sharkdp/bat \ + extract"!" atload="alias cat=bat" lsd-rs/lsd \ + extract"!" atload="alias nano=micro" zyedidia/micro \ + extract"!" cp"autocomplete/bat.zsh -> _bat" atload"alias cat=bat" @sharkdp/bat \ extract"!" atclone="cp usr/bin/fastfetch .; rm -rf usr" \ fastfetch-cli/fastfetch \ atclone"./zoxide init zsh > init.zsh" atpull"%atclone" src"init.zsh" \ @@ -36,5 +32,7 @@ zinit as"command" wait lucid light-mode from"gh-r" for \ junegunn/fzf \ atclone"./fnm env --use-on-cd > init.zsh" atpull"%atclone" src"init.zsh" Schniz/fnm +# load local snippets +source $ZDOTDIR/exports.zsh zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath' -- 2.54.0 From 70a2f649be6e725b9887433616b2170b952817c9 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:04:43 +0700 Subject: [PATCH 08/17] fix: - missing zsh history when using fzf - not found aliases --- git/.gitconfig | 5 +++++ zsh/.config/zsh/.zshrc | 14 +++++++------- zsh/.config/zsh/aliases.zsh | 4 ++-- zsh/.config/zsh/exports.zsh | 2 +- zsh/.config/zsh/options.zsh | 27 +++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 zsh/.config/zsh/options.zsh diff --git a/git/.gitconfig b/git/.gitconfig index 04bc2c7..ee76f28 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -3,3 +3,8 @@ [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 diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 923e77c..13b6ccf 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -7,7 +7,7 @@ zinit wait lucid light-mode for \ hlissner/zsh-autopair \ Aloxaf/fzf-tab \ atinit"zicompinit; zicdreplay -q" \ - zdharma-continuum/fast-syntax-highlighting zap-zsh/supercharge \ + zdharma-continuum/fast-syntax-highlighting \ atload"_zsh_autosuggest_start" \ zsh-users/zsh-autosuggestions \ blockf atpull'zinit creinstall -q .' \ @@ -21,9 +21,9 @@ zinit light starship/starship # load binaries zinit as"command" wait lucid light-mode from"gh-r" for \ - extract"!" atload="alias cat=bat" lsd-rs/lsd \ - extract"!" atload="alias nano=micro" zyedidia/micro \ - extract"!" cp"autocomplete/bat.zsh -> _bat" atload"alias cat=bat" @sharkdp/bat \ + extract"!" lsd-rs/lsd \ + extract"!" zyedidia/micro \ + extract"!" cp"autocomplete/bat.zsh -> _bat" @sharkdp/bat \ extract"!" atclone="cp usr/bin/fastfetch .; rm -rf usr" \ fastfetch-cli/fastfetch \ atclone"./zoxide init zsh > init.zsh" atpull"%atclone" src"init.zsh" \ @@ -32,7 +32,7 @@ zinit as"command" wait lucid light-mode from"gh-r" for \ junegunn/fzf \ atclone"./fnm env --use-on-cd > init.zsh" atpull"%atclone" src"init.zsh" Schniz/fnm -# load local snippets +# load local scripts source $ZDOTDIR/exports.zsh - -zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath' +source $ZDOTDIR/aliases.zsh +source $ZDOTDIR/options.zsh diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index ff1b6b6..e149715 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -1,4 +1,4 @@ #!/usr/bin/env zsh -(($+commands[bat])) && alias cat="bat" -(($+commands[lsd])) && alias ls="lsd" +alias cat="bat" +alias ls="lsd" diff --git a/zsh/.config/zsh/exports.zsh b/zsh/.config/zsh/exports.zsh index 1a3994f..347c61e 100644 --- a/zsh/.config/zsh/exports.zsh +++ b/zsh/.config/zsh/exports.zsh @@ -6,7 +6,7 @@ SAVEHIST=1000000 export MANWIDTH=999 export EDITOR="micro" -export PAGE="bat" +export PAGER="bat" export VISUAL="micro" export SUDO_EDITOR="micro" diff --git a/zsh/.config/zsh/options.zsh b/zsh/.config/zsh/options.zsh new file mode 100644 index 0000000..3bb969f --- /dev/null +++ b/zsh/.config/zsh/options.zsh @@ -0,0 +1,27 @@ +unsetopt BEEP +setopt AUTO_CD +setopt GLOB_DOTS +setopt NOMATCH +setopt MENU_COMPLETE +setopt EXTENDED_GLOB +setopt INTERACTIVE_COMMENTS +setopt APPEND_HISTORY + +HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history" +HISTSIZE=5000000 +SAVEHIST=5000000 +HIST_STAMPS="dd.mm.yyyy" +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. + +zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath' -- 2.54.0 From 833ef8f70ed746c5b3e88dcc0831f712d78ec7d4 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Fri, 6 Dec 2024 15:50:33 +0700 Subject: [PATCH 09/17] feat: enhance configuration with new aliases and local bin setup --- zsh/.config/zsh/.zshrc | 3 ++- zsh/.config/zsh/aliases.zsh | 6 ++++-- zsh/.config/zsh/bin.zsh | 10 ++++++++++ zsh/.config/zsh/zinit.zsh | 5 +++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 zsh/.config/zsh/bin.zsh diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 13b6ccf..8e193fd 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -24,7 +24,7 @@ zinit as"command" wait lucid light-mode from"gh-r" for \ extract"!" lsd-rs/lsd \ extract"!" zyedidia/micro \ extract"!" cp"autocomplete/bat.zsh -> _bat" @sharkdp/bat \ - extract"!" atclone="cp usr/bin/fastfetch .; rm -rf usr" \ + extract"!" atclone="cp usr/bin/fastfetch .; rm -rf usr" atpull"%atclone" \ fastfetch-cli/fastfetch \ atclone"./zoxide init zsh > init.zsh" atpull"%atclone" src"init.zsh" \ ajeetdsouza/zoxide \ @@ -36,3 +36,4 @@ zinit as"command" wait lucid light-mode from"gh-r" for \ source $ZDOTDIR/exports.zsh source $ZDOTDIR/aliases.zsh source $ZDOTDIR/options.zsh +source $ZDOTDIR/bin.zsh diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index e149715..05c37ee 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -1,4 +1,6 @@ #!/usr/bin/env zsh -alias cat="bat" -alias ls="lsd" +alias cat=bat +alias ls=lsd +alias nano=micro +alias fetch=fastfetch diff --git a/zsh/.config/zsh/bin.zsh b/zsh/.config/zsh/bin.zsh new file mode 100644 index 0000000..dabfec5 --- /dev/null +++ b/zsh/.config/zsh/bin.zsh @@ -0,0 +1,10 @@ +#!/usr/bin/env zsh + +export LOCAL_BIN="$HOME/.local/bin" +if ! [ -d "$LOCAL_BIN" ]; then + mkdir -p "$LOCAL_BIN" +fi +case ":$PATH:" in + *":$LOCAL_BIN:"*) ;; + *) export PATH="$LOCAL_BIN:$PATH" ;; +esac diff --git a/zsh/.config/zsh/zinit.zsh b/zsh/.config/zsh/zinit.zsh index 53081ce..6098fc5 100644 --- a/zsh/.config/zsh/zinit.zsh +++ b/zsh/.config/zsh/zinit.zsh @@ -3,4 +3,9 @@ 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 +export ZINIT[NO_ALIASES]=1 + source "${ZINIT_HOME}/zinit.zsh" -- 2.54.0 From 801449db297a5735d4968dcfe44115159013a433 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Fri, 6 Dec 2024 20:17:39 +0700 Subject: [PATCH 10/17] refactor: restructure zsh configuration and move snippets to dedicated directory --- zsh/.config/zsh/.zshrc | 22 ++++++++++--------- .../zsh/{aliases.zsh => snippets/aliases} | 0 zsh/.config/zsh/{bin.zsh => snippets/bin} | 0 .../zsh/{exports.zsh => snippets/exports} | 4 +--- .../zsh/{options.zsh => snippets/options} | 4 +++- zsh/.config/zsh/{zinit.zsh => zinit} | 0 6 files changed, 16 insertions(+), 14 deletions(-) rename zsh/.config/zsh/{aliases.zsh => snippets/aliases} (100%) rename zsh/.config/zsh/{bin.zsh => snippets/bin} (100%) rename zsh/.config/zsh/{exports.zsh => snippets/exports} (79%) rename zsh/.config/zsh/{options.zsh => snippets/options} (92%) rename zsh/.config/zsh/{zinit.zsh => zinit} (100%) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index 8e193fd..884e97b 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -1,8 +1,8 @@ # install zinit -source $ZDOTDIR/zinit.zsh +source $ZDOTDIR/zinit # load remote plugins -zinit wait lucid light-mode for \ +zinit wait lucid light-mode id-as depth"1" for \ wintermi/zsh-brew \ hlissner/zsh-autopair \ Aloxaf/fzf-tab \ @@ -14,26 +14,28 @@ zinit wait lucid light-mode for \ zsh-users/zsh-completions # load prompt theme -zinit ice as"command" from"gh-r" \ +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 # load binaries -zinit as"command" wait lucid light-mode from"gh-r" for \ +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"!" atclone="cp usr/bin/fastfetch .; rm -rf usr" atpull"%atclone" \ + 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 > init.zsh" atpull"%atclone" src"init.zsh" Schniz/fnm + atclone"./fnm env --use-on-cd --shell zsh > init.zsh; ./fnm completions --shell zsh > _fnm" atpull"%atclone" src"init.zsh" Schniz/fnm # load local scripts -source $ZDOTDIR/exports.zsh -source $ZDOTDIR/aliases.zsh -source $ZDOTDIR/options.zsh -source $ZDOTDIR/bin.zsh +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/snippets/aliases similarity index 100% rename from zsh/.config/zsh/aliases.zsh rename to zsh/.config/zsh/snippets/aliases diff --git a/zsh/.config/zsh/bin.zsh b/zsh/.config/zsh/snippets/bin similarity index 100% rename from zsh/.config/zsh/bin.zsh rename to zsh/.config/zsh/snippets/bin diff --git a/zsh/.config/zsh/exports.zsh b/zsh/.config/zsh/snippets/exports similarity index 79% rename from zsh/.config/zsh/exports.zsh rename to zsh/.config/zsh/snippets/exports index 347c61e..3d1cc39 100644 --- a/zsh/.config/zsh/exports.zsh +++ b/zsh/.config/zsh/snippets/exports @@ -1,13 +1,11 @@ #!/usr/bin/env zsh -HISTSIZE=1000000 -SAVEHIST=1000000 - 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/options.zsh b/zsh/.config/zsh/snippets/options similarity index 92% rename from zsh/.config/zsh/options.zsh rename to zsh/.config/zsh/snippets/options index 3bb969f..fba70e7 100644 --- a/zsh/.config/zsh/options.zsh +++ b/zsh/.config/zsh/snippets/options @@ -1,3 +1,5 @@ +#!/usr/bin/env zsh + unsetopt BEEP setopt AUTO_CD setopt GLOB_DOTS @@ -24,4 +26,4 @@ setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. setopt HIST_VERIFY # Don't execute immediately upon history expansion. -zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath' +zstyle ':fzf-tab:complete:cd:*' fzf-preview "lsd -1 --color=always --icon=always $realpath" diff --git a/zsh/.config/zsh/zinit.zsh b/zsh/.config/zsh/zinit similarity index 100% rename from zsh/.config/zsh/zinit.zsh rename to zsh/.config/zsh/zinit -- 2.54.0 From fe7b00ac51cc73ecdbc8db02d2e5fb60f2023190 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:31:05 +0700 Subject: [PATCH 11/17] fix: use single quote for `fzf-preview` --- zsh/.config/zsh/snippets/options | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/.config/zsh/snippets/options b/zsh/.config/zsh/snippets/options index fba70e7..5ac36a2 100644 --- a/zsh/.config/zsh/snippets/options +++ b/zsh/.config/zsh/snippets/options @@ -26,4 +26,4 @@ setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. setopt HIST_VERIFY # Don't execute immediately upon history expansion. -zstyle ':fzf-tab:complete:cd:*' fzf-preview "lsd -1 --color=always --icon=always $realpath" +zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 --color=always --icon=always $realpath' -- 2.54.0 From c5bb6055bf8818960eccaabcaf0036e2580d0f26 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Fri, 27 Dec 2024 10:38:02 +0700 Subject: [PATCH 12/17] feat: add initial Ghostty configuration with font and theme settings --- ghostty/.config/ghostty/config | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ghostty/.config/ghostty/config diff --git a/ghostty/.config/ghostty/config b/ghostty/.config/ghostty/config new file mode 100644 index 0000000..0d20617 --- /dev/null +++ b/ghostty/.config/ghostty/config @@ -0,0 +1,2 @@ +font-family = "JetBrainsMono Nerd Font" +theme = "SpaceGray Eighties" -- 2.54.0 From 9ed04e7eaedf703b9412fec2cf2abafcc74f12eb Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:38:06 +0700 Subject: [PATCH 13/17] feat: enhance terminal and git configurations - Add bar cursor style to Ghostty config - Enable automatic remote setup for Git push - Simplify zsh plugin configuration - Expand and improve shell aliases --- ghostty/.config/ghostty/config | 1 + git/.gitconfig | 2 ++ zsh/.config/zsh/.zshrc | 4 +--- zsh/.config/zsh/snippets/aliases | 19 +++++++++++++++---- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ghostty/.config/ghostty/config b/ghostty/.config/ghostty/config index 0d20617..fcbbeb4 100644 --- a/ghostty/.config/ghostty/config +++ b/ghostty/.config/ghostty/config @@ -1,2 +1,3 @@ font-family = "JetBrainsMono Nerd Font" theme = "SpaceGray Eighties" +cursor-style = bar diff --git a/git/.gitconfig b/git/.gitconfig index ee76f28..81b8495 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -8,3 +8,5 @@ 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 884e97b..df26069 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -9,9 +9,7 @@ zinit wait lucid light-mode id-as depth"1" for \ atinit"zicompinit; zicdreplay -q" \ zdharma-continuum/fast-syntax-highlighting \ atload"_zsh_autosuggest_start" \ - zsh-users/zsh-autosuggestions \ - blockf atpull'zinit creinstall -q .' \ - zsh-users/zsh-completions + zsh-users/zsh-autosuggestions # load prompt theme zinit ice as"command" from"gh-r" id-as \ diff --git a/zsh/.config/zsh/snippets/aliases b/zsh/.config/zsh/snippets/aliases index 05c37ee..f69a65b 100644 --- a/zsh/.config/zsh/snippets/aliases +++ b/zsh/.config/zsh/snippets/aliases @@ -1,6 +1,17 @@ #!/usr/bin/env zsh -alias cat=bat -alias ls=lsd -alias nano=micro -alias fetch=fastfetch +# Modern alternatives to traditional commands +alias cat='bat' +alias ls='lsd' +alias ll='lsd -l' +alias la='lsd -la' +alias tree='lsd --tree' +alias nano='micro' +alias fetch='fastfetch' + +# Git shortcuts +alias g='git' +alias ga='git add' +alias gc='git commit' +alias gp='git push' +alias gl='git pull' -- 2.54.0 From 3d97d39bdc49e5f56c73a1b045adf3721010f615 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:17:00 +0700 Subject: [PATCH 14/17] feat: enhance zsh bin setup to include GNU tools - Add support for GNU tools in PATH without 'g' prefix - Include additional bin paths for local binaries - Improve structure for adding directories to PATH --- zsh/.config/zsh/snippets/bin | 43 +++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/zsh/.config/zsh/snippets/bin b/zsh/.config/zsh/snippets/bin index dabfec5..068af8c 100644 --- a/zsh/.config/zsh/snippets/bin +++ b/zsh/.config/zsh/snippets/bin @@ -1,10 +1,37 @@ #!/usr/bin/env zsh -export LOCAL_BIN="$HOME/.local/bin" -if ! [ -d "$LOCAL_BIN" ]; then - mkdir -p "$LOCAL_BIN" -fi -case ":$PATH:" in - *":$LOCAL_BIN:"*) ;; - *) export PATH="$LOCAL_BIN:$PATH" ;; -esac +# 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 + -- 2.54.0 From 2ec3c0b116b9c6f512ee8879a09869979d2d60fd Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Sun, 13 Apr 2025 16:02:02 +0700 Subject: [PATCH 15/17] feat: add configuration files for aria2 and containers, and update zsh aliases - Introduce aria2 configuration for RPC and default download directory - Add containers configuration to suppress compose warning logs - Update zsh aliases to include a shortcut for Docker using podman --- aria2/.config/aria2/aria2.conf | 4 ++++ containers/.config/containers/containers.conf | 2 ++ zsh/.config/zsh/snippets/aliases | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 aria2/.config/aria2/aria2.conf create mode 100644 containers/.config/containers/containers.conf 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/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/zsh/.config/zsh/snippets/aliases b/zsh/.config/zsh/snippets/aliases index f69a65b..81129f2 100644 --- a/zsh/.config/zsh/snippets/aliases +++ b/zsh/.config/zsh/snippets/aliases @@ -14,4 +14,7 @@ alias g='git' alias ga='git add' alias gc='git commit' alias gp='git push' -alias gl='git pull' +alias gl='git pull' + +# Docker shortcuts +alias docker='podman' -- 2.54.0 From b238f54ca359beffc542904b6d3af470ef730dab Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Tue, 15 Apr 2025 15:22:57 +0700 Subject: [PATCH 16/17] feat: update zsh aliases and options for improved functionality - Modify `ls` and `la` aliases for better compatibility with `lsd` - Add `gs` alias for a concise git status command - Reinstate history settings in zsh options for consistent behavior - Ensure history management options are clearly defined --- zsh/.config/zsh/.zshrc | 1 - zsh/.config/zsh/snippets/aliases | 6 +++--- zsh/.config/zsh/snippets/options | 9 +++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index df26069..50fdf08 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -36,4 +36,3 @@ zinit is-snippet id-as for \ $ZDOTDIR/snippets/aliases \ $ZDOTDIR/snippets/options \ $ZDOTDIR/snippets/bin - diff --git a/zsh/.config/zsh/snippets/aliases b/zsh/.config/zsh/snippets/aliases index 81129f2..76d3a99 100644 --- a/zsh/.config/zsh/snippets/aliases +++ b/zsh/.config/zsh/snippets/aliases @@ -2,15 +2,15 @@ # Modern alternatives to traditional commands alias cat='bat' -alias ls='lsd' -alias ll='lsd -l' -alias la='lsd -la' +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' diff --git a/zsh/.config/zsh/snippets/options b/zsh/.config/zsh/snippets/options index 5ac36a2..fba4995 100644 --- a/zsh/.config/zsh/snippets/options +++ b/zsh/.config/zsh/snippets/options @@ -8,11 +8,8 @@ setopt MENU_COMPLETE setopt EXTENDED_GLOB setopt INTERACTIVE_COMMENTS setopt APPEND_HISTORY +setopt PUSHD_IGNORE_DUPS -HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history" -HISTSIZE=5000000 -SAVEHIST=5000000 -HIST_STAMPS="dd.mm.yyyy" 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. @@ -26,4 +23,8 @@ setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history 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' -- 2.54.0 From 92372953de5a91596ecc2d4fecb242b33ad63071 Mon Sep 17 00:00:00 2001 From: Tri Vo Khac <33442340+vokhactri@users.noreply.github.com> Date: Thu, 17 Apr 2025 15:59:57 +0700 Subject: [PATCH 17/17] feat: update zinit configuration for enhanced command listing - Set `ZINIT[LIST_COMMAND]` to use `lsd --tree` for improved directory visualization - Ensure `ZINIT[NO_ALIASES]` is properly declared without export --- zsh/.config/zsh/zinit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh/.config/zsh/zinit b/zsh/.config/zsh/zinit index 6098fc5..5e653b1 100644 --- a/zsh/.config/zsh/zinit +++ b/zsh/.config/zsh/zinit @@ -6,6 +6,7 @@ ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" # not to use aliases: zi or zini declare -A ZINIT -export ZINIT[NO_ALIASES]=1 +ZINIT[NO_ALIASES]=1 +ZINIT[LIST_COMMAND]='lsd --tree' source "${ZINIT_HOME}/zinit.zsh" -- 2.54.0