From 2cdab434ac074f10c8edeb13a162c001b0c23d59 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Mon, 11 Aug 2025 16:27:48 +0200 Subject: [PATCH 01/10] (git) introducting diff-so-fancy --- config/common/git/config | 8 +++++++- config/common/zsh/.zshrc | 3 ++- install.sh | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/common/git/config b/config/common/git/config index 3413630..9b25071 100644 --- a/config/common/git/config +++ b/config/common/git/config @@ -10,7 +10,7 @@ gpgsign = true [core] autocrlf = false - pager = less -FRX + pager = diff-so-fancy | less --tabs=2 -RF [gpg] format = ssh [http] @@ -26,3 +26,9 @@ [include] path = ~/.local/config/git +[interactive] + diffFilter = diff-so-fancy --patch +[diff-so-fancy] + markEmptyLines = true + changeHunkIndicators = true + rulerWidth = 40 diff --git a/config/common/zsh/.zshrc b/config/common/zsh/.zshrc index e25dede..833f29f 100644 --- a/config/common/zsh/.zshrc +++ b/config/common/zsh/.zshrc @@ -7,7 +7,7 @@ if [[ -f "${HOME}/.note" ]]; then echo fi -tabs 2 +tabs 2,4,6,8,10,12,14,16,18,20 # instant prompt should stay on the top if [[ -r "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then @@ -75,6 +75,7 @@ zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} # source modules source "${HOME}/.local/git/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" source "${HOME}/.local/git/zsh_modules/wd/wd.plugin.zsh" +source "${HOME}/.local/git/zsh_modules/diff-so-fancy/diff-so-fancy.plugin.zsh" export WD_CONFIG="${XDG_CONFIG_HOME}/wd_list" # cleaning diff --git a/install.sh b/install.sh index aec738d..e4f365f 100644 --- a/install.sh +++ b/install.sh @@ -37,7 +37,7 @@ else # zsh modules mkdir -p "${LOCAL_GIT_DIR}/zsh_modules" - for module in mfaerevaag/wd romkatv/powerlevel10k zdharma-continuum/fast-syntax-highlighting; do + for module in mfaerevaag/wd romkatv/powerlevel10k so-fancy/diff-so-fancy zdharma-continuum/fast-syntax-highlighting; do rm -rf "${LOCAL_GIT_DIR}/zsh_modules/${module#*/}" git clone https://github.com/${module} "${LOCAL_GIT_DIR}/zsh_modules/${module#*/}" done From 3167fff12e260869392b146616f34d1882200798 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Wed, 13 Aug 2025 15:01:12 +0200 Subject: [PATCH 02/10] (neovim) don't notify about plugin updates --- config/common/nvim/lua/core/lazy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/common/nvim/lua/core/lazy.lua b/config/common/nvim/lua/core/lazy.lua index c2b5aab..73d85ae 100644 --- a/config/common/nvim/lua/core/lazy.lua +++ b/config/common/nvim/lua/core/lazy.lua @@ -30,7 +30,7 @@ require("lazy").setup({ }, checker = { enabled = true, - notify = true, + notify = false, }, change_detection = { enabled = true, From 4a28e2acf47f6999b6a76c760a05da241907ff00 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Wed, 13 Aug 2025 15:44:36 +0200 Subject: [PATCH 03/10] (zsh) create common.zsh with global settings --- config/common/zsh/.zshrc | 83 +------------------------------- config/common/zsh/common.zsh | 93 ++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 82 deletions(-) create mode 100644 config/common/zsh/common.zsh diff --git a/config/common/zsh/.zshrc b/config/common/zsh/.zshrc index 833f29f..a375c35 100644 --- a/config/common/zsh/.zshrc +++ b/config/common/zsh/.zshrc @@ -1,85 +1,4 @@ -# shellcheck disable=SC1091,SC1094,SC2206,SC2148 - -# quick note functionality -if [[ -f "${HOME}/.note" ]]; then - echo - cat "${HOME}/.note" - echo -fi - -tabs 2,4,6,8,10,12,14,16,18,20 - -# instant prompt should stay on the top -if [[ -r "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" -fi - -# macOS specific -if [[ $(uname -s) = "Darwin" ]]; then - eval "$(/opt/homebrew/bin/brew shellenv)" -fi - -# prepare directories -mkdir -p "${XDG_CACHE_HOME}/zsh" -mkdir -p "${XDG_DATA_HOME}/zsh" - -# history settings -export HISTFILE="${XDG_DATA_HOME}/zsh/history" -export HISTSIZE=10000 -export SAVEHIST=$HISTSIZE -setopt EXTENDED_HISTORY -setopt HIST_EXPIRE_DUPS_FIRST -setopt HIST_FIND_NO_DUPS -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_IGNORE_DUPS -setopt HIST_IGNORE_SPACE -setopt HIST_REDUCE_BLANKS -setopt HIST_SAVE_NO_DUPS -setopt INC_APPEND_HISTORY -setopt SHARE_HISTORY -setopt RMSTARSILENT -rm -rf "${ZDOTDIR}/.zsh_history" && ln -sf "${XDG_DATA_HOME}/zsh/history" "${ZDOTDIR}/.zsh_history" - -# set path -path=(~/.local/bin "${path[@]}") - -# source configuration -source "${ZDOTDIR}/aliases.zsh" -source "${ZDOTDIR}/keys.zsh" -source "${ZDOTDIR}/fzf.zsh" - -# set fpath -fpath=(~/.local/git/zsh_modules/wd $fpath) - -# theme and colors -if [[ $(command -v vivid) ]]; then - LS_COLORS=$(vivid generate molokai) - export LS_COLORS -else - unset LS_COLORS -fi -source ~/.local/git/zsh_modules/powerlevel10k/powerlevel10k.zsh-theme -source "${ZDOTDIR}/p10k.zsh" - -# completion -autoload -Uz compinit -if [ ! -e "${XDG_DATA_HOME}/zsh/zcompdump.zwc" ]; then - autoload -Uz zrecompile - zrecompile -p -R "${XDG_DATA_HOME}/zsh/zcompdump" -fi -compinit -C -d "${XDG_DATA_HOME}/zsh/zcompdump" - -zstyle ':completion:*' menu select -zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} - -# source modules -source "${HOME}/.local/git/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" -source "${HOME}/.local/git/zsh_modules/wd/wd.plugin.zsh" -source "${HOME}/.local/git/zsh_modules/diff-so-fancy/diff-so-fancy.plugin.zsh" -export WD_CONFIG="${XDG_CONFIG_HOME}/wd_list" - -# cleaning -rm -rf "${HOME}/.warprc" +source "${ZDOTDIR}/common.zsh" # local settings if [[ -f "${HOME}/.local/config/zsh" ]]; then diff --git a/config/common/zsh/common.zsh b/config/common/zsh/common.zsh new file mode 100644 index 0000000..34399c6 --- /dev/null +++ b/config/common/zsh/common.zsh @@ -0,0 +1,93 @@ +# shellcheck disable=SC1091,SC1094,SC2206,SC2148 + +if [ $(uname -s) = "Darwin" ]; then + realhome=$(dscl . -read /Users/${USER} | grep Home | cut -d' ' -f2) +else + realhome=$(getent passwd ${USER} | cut -d: -f6) +fi + +# quick note functionality +if [[ -f "${realhome}/.note" ]]; then + echo + cat "${realhome}/.note" + echo +fi + +tabs 2,4,6,8,10,12,14,16,18,20 + +# instant prompt should stay on the top +if [[ -r "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +# macOS specific +if [[ $(uname -s) = "Darwin" ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" +fi + +# prepare directories +mkdir -p "${XDG_CACHE_HOME}/zsh" +mkdir -p "${XDG_DATA_HOME}/zsh" + +# history settings +export HISTFILE="${XDG_DATA_HOME}/zsh/history" +export HISTSIZE=10000 +export SAVEHIST=$HISTSIZE +setopt EXTENDED_HISTORY +setopt HIST_EXPIRE_DUPS_FIRST +setopt HIST_FIND_NO_DUPS +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_REDUCE_BLANKS +setopt HIST_SAVE_NO_DUPS +setopt INC_APPEND_HISTORY +setopt SHARE_HISTORY +setopt RMSTARSILENT +rm -rf "${realhome}/.config/zsh/.zsh_history" && ln -sf "${XDG_DATA_HOME}/zsh/history" "${realhome}/.config/zsh/.zsh_history" + +# set path +path=(~/.local/bin "${path[@]}") + +# source configuration +source "${realhome}/.config/zsh/aliases.zsh" +source "${realhome}/.config/zsh/keys.zsh" +source "${realhome}/.config/zsh/fzf.zsh" + +# set fpath +fpath=(~/.local/git/zsh_modules/wd $fpath) + +# theme and colors +if [[ $(command -v vivid) ]]; then + LS_COLORS=$(vivid generate molokai) + export LS_COLORS +else + unset LS_COLORS +fi +source "${realhome}/.local/git/zsh_modules/powerlevel10k/powerlevel10k.zsh-theme" +source "${realhome}/.config/zsh/p10k.zsh" + +# completion +autoload -Uz compinit +if [ ! -e "${XDG_DATA_HOME}/zsh/zcompdump.zwc" ]; then + autoload -Uz zrecompile + zrecompile -p -R "${XDG_DATA_HOME}/zsh/zcompdump" +fi +compinit -C -d "${XDG_DATA_HOME}/zsh/zcompdump" + +zstyle ':completion:*' menu select +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} + +# source modules +source "${realhome}/.local/git/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" +source "${realhome}/.local/git/zsh_modules/wd/wd.plugin.zsh" +source "${realhome}/.local/git/zsh_modules/diff-so-fancy/diff-so-fancy.plugin.zsh" +export WD_CONFIG="${XDG_CONFIG_HOME}/wd_list" + +# cleaning +rm -rf "${realhome}/.warprc" + +# local settings +if [[ -f "${realhome}/.local/config/zsh" ]]; then + source "${realhome}/.local/config/zsh" +fi From 5975732423d99680789761d8f00a62a98ebfcac9 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Wed, 13 Aug 2025 16:21:47 +0200 Subject: [PATCH 04/10] (tmux) show username in statusline --- config/common/tmux/tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/common/tmux/tmux.conf b/config/common/tmux/tmux.conf index b532da6..f034790 100644 --- a/config/common/tmux/tmux.conf +++ b/config/common/tmux/tmux.conf @@ -26,7 +26,7 @@ set -g status-style "bg=default" set -g message-style "fg=default,bg=default" set -g message-command-style "fg=default,bg=default" set -g status-left "" -set -g status-right "#{?client_prefix,#[reverse]#[fg=color2] prefix #[noreverse],}#[fg=color6] #h " +set -g status-right "#{?client_prefix,#[reverse]#[fg=color2] prefix #[noreverse],}#[fg=color6] #(whoami)@#h " setw -g window-status-separator "" setw -g window-status-format "#[fg=color242,bg=default] #W " setw -g window-status-current-format "#[fg=color0,bg=color6] #W " From 7162103c054ac386392742a97225c13e1454871e Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Wed, 13 Aug 2025 16:26:36 +0200 Subject: [PATCH 05/10] (zsh) local config should be run just once --- config/common/zsh/common.zsh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/common/zsh/common.zsh b/config/common/zsh/common.zsh index 34399c6..73542c8 100644 --- a/config/common/zsh/common.zsh +++ b/config/common/zsh/common.zsh @@ -86,8 +86,3 @@ export WD_CONFIG="${XDG_CONFIG_HOME}/wd_list" # cleaning rm -rf "${realhome}/.warprc" - -# local settings -if [[ -f "${realhome}/.local/config/zsh" ]]; then - source "${realhome}/.local/config/zsh" -fi From db62f2496ec3cdc04ff40e67a69232fc9566d47f Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Wed, 13 Aug 2025 16:54:43 +0200 Subject: [PATCH 06/10] (work) back to ZDOTDIR --- config/common/zsh/common.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/common/zsh/common.zsh b/config/common/zsh/common.zsh index 73542c8..852b8cb 100644 --- a/config/common/zsh/common.zsh +++ b/config/common/zsh/common.zsh @@ -44,15 +44,15 @@ setopt HIST_SAVE_NO_DUPS setopt INC_APPEND_HISTORY setopt SHARE_HISTORY setopt RMSTARSILENT -rm -rf "${realhome}/.config/zsh/.zsh_history" && ln -sf "${XDG_DATA_HOME}/zsh/history" "${realhome}/.config/zsh/.zsh_history" +rm -rf "${ZDOTDIR}/.zsh_history" && ln -sf "${XDG_DATA_HOME}/zsh/history" "${ZDOTDIR}/.zsh_history" # set path path=(~/.local/bin "${path[@]}") # source configuration -source "${realhome}/.config/zsh/aliases.zsh" -source "${realhome}/.config/zsh/keys.zsh" -source "${realhome}/.config/zsh/fzf.zsh" +source "${ZDOTDIR}/aliases.zsh" +source "${ZDOTDIR}/keys.zsh" +source "${ZDOTDIR}/fzf.zsh" # set fpath fpath=(~/.local/git/zsh_modules/wd $fpath) @@ -65,7 +65,7 @@ else unset LS_COLORS fi source "${realhome}/.local/git/zsh_modules/powerlevel10k/powerlevel10k.zsh-theme" -source "${realhome}/.config/zsh/p10k.zsh" +source "${ZDOTDIR}/p10k.zsh" # completion autoload -Uz compinit From 76320a63fdda8f0b7d0155882a501a74155c303a Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Sat, 16 Aug 2025 01:18:39 +0200 Subject: [PATCH 07/10] (zsh) remove tabs setting --- config/common/zsh/common.zsh | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/common/zsh/common.zsh b/config/common/zsh/common.zsh index 852b8cb..fbb5ac6 100644 --- a/config/common/zsh/common.zsh +++ b/config/common/zsh/common.zsh @@ -13,8 +13,6 @@ if [[ -f "${realhome}/.note" ]]; then echo fi -tabs 2,4,6,8,10,12,14,16,18,20 - # instant prompt should stay on the top if [[ -r "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME}/p10k-instant-prompt-${(%):-%n}.zsh" From 9a5db52e52b8b502062843c444bd84a56d00a5dd Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Tue, 19 Aug 2025 15:36:01 +0200 Subject: [PATCH 08/10] (neovim) linter fixes --- .../nvim/lua/config/global.markdownlint-cli2.yaml | 2 ++ config/common/nvim/lua/plugins/extra/linters.lua | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/common/nvim/lua/config/global.markdownlint-cli2.yaml b/config/common/nvim/lua/config/global.markdownlint-cli2.yaml index ca8c544..60cd049 100644 --- a/config/common/nvim/lua/config/global.markdownlint-cli2.yaml +++ b/config/common/nvim/lua/config/global.markdownlint-cli2.yaml @@ -1,3 +1,5 @@ config: MD004: false MD013: false + MD022: false + MD032: false diff --git a/config/common/nvim/lua/plugins/extra/linters.lua b/config/common/nvim/lua/plugins/extra/linters.lua index 2b72e89..c8ae8ed 100644 --- a/config/common/nvim/lua/plugins/extra/linters.lua +++ b/config/common/nvim/lua/plugins/extra/linters.lua @@ -89,12 +89,12 @@ return { terraform = { "terraform_fmt" }, tf = { "terraform_fmt" }, zsh = { "shfmt" }, - yaml = { "yamlfix" }, - }, - format_on_save = { - lsp_fallback = true, - async = false, + -- yaml = { "yamlfix" }, }, + -- format_on_save = { + -- lsp_fallback = true, + -- async = false, + -- }, }) end, }, From 695bb39c846fba66b234b9e5addff3bba93f21cd Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Tue, 19 Aug 2025 15:50:04 +0200 Subject: [PATCH 09/10] (zsh) setops in lowercase --- config/common/zsh/common.zsh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config/common/zsh/common.zsh b/config/common/zsh/common.zsh index fbb5ac6..253a78f 100644 --- a/config/common/zsh/common.zsh +++ b/config/common/zsh/common.zsh @@ -31,18 +31,18 @@ mkdir -p "${XDG_DATA_HOME}/zsh" export HISTFILE="${XDG_DATA_HOME}/zsh/history" export HISTSIZE=10000 export SAVEHIST=$HISTSIZE -setopt EXTENDED_HISTORY -setopt HIST_EXPIRE_DUPS_FIRST -setopt HIST_FIND_NO_DUPS -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_IGNORE_DUPS -setopt HIST_IGNORE_SPACE -setopt HIST_REDUCE_BLANKS -setopt HIST_SAVE_NO_DUPS -setopt INC_APPEND_HISTORY -setopt SHARE_HISTORY -setopt RMSTARSILENT -rm -rf "${ZDOTDIR}/.zsh_history" && ln -sf "${XDG_DATA_HOME}/zsh/history" "${ZDOTDIR}/.zsh_history" +setopt extended_history +setopt hist_expire_dups_first +setopt hist_find_no_dups +setopt hist_ignore_all_dups +setopt hist_ignore_dups +setopt hist_ignore_space +setopt hist_reduce_blanks +setopt hist_save_no_dups +setopt inc_append_history +setopt share_history +setopt rmstarsilent +#rm -rf "${ZDOTDIR}/.zsh_history" && ln -sf "${XDG_DATA_HOME}/zsh/history" "${ZDOTDIR}/.zsh_history" # set path path=(~/.local/bin "${path[@]}") From 9ff94af742d0fc02d56c6748d2da68e5341ccb2c Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Mon, 25 Aug 2025 18:12:54 +0200 Subject: [PATCH 10/10] (neovim) enable ignorecase --- config/common/nvim/lua/config/settings.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/common/nvim/lua/config/settings.lua b/config/common/nvim/lua/config/settings.lua index 805d8b6..5b28751 100644 --- a/config/common/nvim/lua/config/settings.lua +++ b/config/common/nvim/lua/config/settings.lua @@ -12,7 +12,7 @@ vim.o.cursorline = true vim.o.expandtab = true vim.o.gdefault = true vim.o.hlsearch = true -vim.o.inccommand = "split" +vim.o.ignorecase = true vim.o.number = true vim.o.relativenumber = false vim.o.shiftround = true @@ -31,6 +31,7 @@ vim.o.clipboard = "" vim.o.conceallevel = 0 vim.o.fileencoding = "utf-8" vim.o.foldcolumn = "0" +vim.o.inccommand = "split" vim.o.mouse = "" vim.o.shiftwidth = 2 vim.o.signcolumn = "yes"