Skip to content

Commit

Permalink
fix: git, pip, zinit, zsh, and tmux configs
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
  • Loading branch information
vladdoster committed Feb 5, 2024
1 parent c8142f2 commit 6c88b81
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 72 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
**/bin/*stow
.DS_Store
.zcompdump
bin/.local/[si]*
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ BUILD_DATE := $(shell date -u +%FT%TZ) # https://github.com/opencontainers/image

PY_PATH ?= $$HOME/.local/share/python
PIP_OPTS := --trusted-host=files.pythonhosted.org --trusted-host=pypi.org --upgrade --no-cache-dir --target=$(PY_PATH)
PY_PKGS ?= beautysh black bpytop isort linkify mdformat mdformat-config mdformat-gfm mdformat-shfmt mdformat-tables mdformat-toc pip pylint pynvim reorder-python-imports pytest
PY_VER ?= $(shell python3 --version | awk '{print $$2}' | cut -d "." -f 1-2)
PY_PIP := python3 -m pip
PY_PKGS := mdformat beautysh pynvim typer
PY_VER ?= $(shell python3 --version | awk '{print $$2}' | cut -d "." -f 1-2)
# PY_PIP := python$(PY_VER) -m pip

DOCKER_OPTS := --hostname docker-$(shell basename $(CONTAINER_NAME)) --interactive --mount=source=dotfiles-$(CONTAINER_ARCH)-volume,destination=/home --security-opt seccomp=unconfined
Expand Down Expand Up @@ -126,7 +126,7 @@ py-pkgs: py-version ## Install python pkgs
py-update: py-pkgs ## Update python packages
$(info ==> updating py pkgs)
$(PY_PIP) install $(PIP_OPTS) --upgrade pip
$(PY_PIP) list | cut -d" " -f 1 | tail -n +3 | xargs $(PY_PIP) install $(PIP_OPTS)
# $(PY_PIP) list | cut -d" " -f 1 | tail -n +3 | xargs $(PY_PIP) install $(PIP_OPTS)
$(info ==> updated py packages)

rust-install: ## Install rust & cargo
Expand Down
3 changes: 2 additions & 1 deletion git/.config/git/config
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# vim: set et ft=gitconfig sts=2 sw=2 ts=2:
[user]
email = mvdoster@gmail.com
name = Vladislav Doster
Expand Down Expand Up @@ -113,3 +112,5 @@
sub-pull = !git submodule foreach git pull --tags origin master
sub-rm = !sh -c 'git submodule deinit -f -- $1 && rm -rf .git/modules/$1 && git rm -f $1' -
sub-up = submodule update --init --recursive

; vim: set expandtab filetype=gitconfig shiftwidth=2 tabstop=2 :
8 changes: 0 additions & 8 deletions pip/.config/pip/pip.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
download_cache = ~/.cache/pip
no-warn-script-location = true
timeout = 15
trusted-host =
pypi.org
files.pythonhosted.org

[install]
trusted-host =
pypi.org
files.pythonhosted.org

[list]
format = columns
11 changes: 6 additions & 5 deletions tmux/.config/tmux/tmux.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
bind R source-file "~/.config/tmux/tmux.conf" \; display-message "Config reloaded..."
# vim:set filetype=tmux:
#### SETTINGS ---------------------------------------------------------------
set -g default-command "$(which zsh) || $SHELL"
set -g default-terminal "screen-256color"
set -g default-command "$(which zsh) || ${SHELL}"
# set -g default-terminal "screen-256color"
set -g default-terminal "xterm-256color"

set -g focus-events on
set -g mouse on
Expand All @@ -15,7 +16,7 @@ setw -g mode-keys vi
### Key Bindings ------------------------------------------------------------
unbind C-b
set -g prefix C-a
bind R source-file $XDG_CONFIG_HOME/tmux/tmux.conf
bind R source-file "${XDG_CONFIG_HOME}/tmux/tmux.conf" \; display-message "Config reloaded..."
bind C-a last-window
bind a send-prefix
bind-key c new-window
Expand All @@ -40,7 +41,7 @@ bind-key S set-window-option synchronize-panes
bind-key T choose-tree -Z
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe "xclip -selection clipboard -in"
bind-key p run-shell "tmux popup -d '#{pane_current_path}' -E $SHELL"
bind-key p run-shell "tmux popup -d '#{pane_current_path}' -E ${SHELL}"
### Appearance ------------------------------------------------------------
set -g status on
set -g status-interval 1
Expand Down
20 changes: 11 additions & 9 deletions zsh/.config/zsh/.zshenv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setopt typeset_silent extended_glob prompt_subst
setopt local_options typeset_silent extended_glob prompt_subst

zmodload zsh/{datetime,langinfo,parameter,system,terminfo,zutil} || return
zmodload -F zsh/files b:{zf_mkdir,zf_mv,zf_rm,zf_rmdir,zf_ln} || return
Expand All @@ -13,7 +13,7 @@ zmodload -F zsh/stat b:zstat || return

export -T MANPATH=${MANPATH:-:} manpath
export -T INFOPATH=${INFOPATH:-:} infopath
typeset -gaU cdpath fpath mailpath path manpath infopath
typeset -gaU cdpath fpath=() mailpath path manpath infopath

function -init-homebrew() {
(( ARGC )) || return 0
Expand All @@ -28,18 +28,20 @@ function -init-homebrew() {
}

if [[ $OSTYPE == darwin* ]]; then
[[ -z $HOMEBREW_PREFIX ]] && -init-homebrew {/opt/homebrew,/usr/local}/bin/brew(N)
[[ -z $HOMEBREW_PREFIX ]] && -init-homebrew /opt/homebrew/bin/brew(.N)
elif [[ $OSTYPE == linux* && -z $HOMEBREW_PREFIX ]]; then
-init-homebrew {/home/linuxbrew/.linuxbrew,~/.linuxbrew}/bin/brew(N)
fi

fpath=(
dirpath=(/opt/homebrew/share/zsh(N-/));
# fpath+=($^dirpath/*f*(/NoL[1,2]))
fpath+=(
${ZDOTDIR}/{'completions','functions'}(-/N)
${^${(M)fpath:#*/$ZSH_VERSION/functions}/%$ZSH_VERSION\/functions/site-functions}(-/N)
${HOMEBREW_PREFIX:+$HOMEBREW_PREFIX/share/zsh/site-functions}(-/N)
/{opt/homebrew,usr{/local,}}/share/zsh/{site-functions,vendor-completions}(-/N)
/opt/homebrew/share/zsh/{'','site-'}functions(-/N)
$fpath
$^dirpath/*f*(/NoL[1,2])
# ${^${(M)fpath:#*/$ZSH_VERSION/functions}/%$ZSH_VERSION\/functions/site-functions}(-/N)
# ${HOMEBREW_PREFIX:+$HOMEBREW_PREFIX/share/zsh/site-functions}(-/N)
# /{opt/homebrew,usr{/local,}}/share/zsh/{site-functions,vendor-completions}(-/N)
# /opt/homebrew/share/zsh/{'','site-'}functions(-/N)
)

# autoload +X -U bashcompinit; print 'loading bashcompinit'; bashcompinit
Expand Down
8 changes: 2 additions & 6 deletions zsh/.config/zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env zsh

setopt auto_cd extended_glob glob_dots interactive_comments prompt_subst

SAVEHIST=200000
HISTSIZE=$SAVEHIST
: ${HISTFILE=$ZDOTDIR/zsh_history}
Expand All @@ -15,16 +13,14 @@ setopt hist_{'verify','expire_dups_first','ignore_dups'}
done
}

[ -z "$ZPROF" ] || zmodload zsh/zprof

if (( ! $#NO_RC )); then
for f in ${ZDOTDIR}/rc.d/<->-*zsh(N); do
source "$f"
done
fi

export PATH="/opt/homebrew/bin:$PATH"
setopt auto_cd extended_glob glob_dots interactive_comments prompt_subst

[ -z "$ZPROF" ] || zprof
export PATH="/opt/homebrew/bin:$PATH"

# vim: set expandtab filetype=zsh shiftwidth=2 softtabstop=2 tabstop=2:
Empty file modified zsh/.config/zsh/functions/zdd
100755 → 100644
Empty file.
7 changes: 7 additions & 0 deletions zsh/.config/zsh/rc.d/00-env.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@ export \
HOMEBREW_NO_{ENV_HINTS,INSTALL_CLEANUP}=1 \
SHELL_SESSIONS_DISABLE=1

export PIP_TRUSTED_HOST='files.pythonhosted.org pypi.org'
export PIP_UPGRADE='true'
export PIP_NO_CACHE_DIR='true'
export PIP_TARGET="$HOME/.local/share/python"

#------------------------------
# Prompt
#------------------------------
autoload -U colors zsh/terminfo
colors

# vim: set expandtab filetype=zsh shiftwidth=4 tabstop=4 :
94 changes: 55 additions & 39 deletions zsh/.config/zsh/rc.d/06-zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CONFIG+=(
FORK 'vdoster' BRANCH 'fork/tmp'
COMPLETIONS_DIR "${zi_dir}/completions"
)
CONFIG+=( DEBUG 'true' )
# CONFIG+=( DEBUG 'true' )
typeset -A ZINIT=(${(kv)CONFIG})
local ZI_REPO="${ZINIT[FORK]:-${ZINIT[SRC]}}/${ZINIT[REPO]:-zinit}"
if [[ ! -e $ZINIT[BIN_DIR]/zinit.zsh ]]; then
Expand All @@ -38,57 +38,80 @@ else
return 1
fi

hash -d 'zpfx'="${ZINIT[ZPFX]}"
# zinit for \
# atinit"
# zstyle ':prompt:pure:git:action' color 'yellow';
# zstyle ':prompt:pure:git:branch' color 'blue';
# zstyle ':prompt:pure:git:dirty' color 'red';
# zstyle ':prompt:pure:path' color 'cyan'
# zstyle ':prompt:pure:prompt:success' color 'green'
# PURE_GIT_DOWN_ARROW='%1{↓%}'; PURE_GIT_UP_ARROW='%1{↑%}' PURE_PROMPT_SYMBOL='${HOST}%2{ ᐳ%}'; PURE_PROMPT_VICMD_SYMBOL='${HOST}%2{ ᐸ%}'" \
# compile'(async|pure).zsh' \
# multisrc'(async|pure).zsh' \
# @sindresorhus/pure
# hash -d 'zpfx'="${ZINIT[ZPFX]}"

zinit for \
atinit"
zstyle ':prompt:pure:git:action' color 'yellow';
zstyle ':prompt:pure:git:branch' color 'blue';
zstyle ':prompt:pure:git:dirty' color 'red';
zstyle ':prompt:pure:path' color 'cyan'
zstyle ':prompt:pure:prompt:success' color 'green'
PURE_GIT_DOWN_ARROW='%1{↓%}'; PURE_GIT_UP_ARROW='%1{↑%}' PURE_PROMPT_SYMBOL='${HOST}%2{ ᐳ%}'; PURE_PROMPT_VICMD_SYMBOL='${HOST}%2{ ᐸ%}'" \
compile'(async|pure).zsh' \
multisrc'(async|pure).zsh' \
@sindresorhus/pure

eval "MODE_CURSOR_"{'SEARCH="#ff00ff blinking underline"','VICMD="green block"','VIINS="#ffff00 bar"'}";"

zinit for @zdharma-continuum/zinit-annex-{'bin-gem-node','linkman'}
zinit for ver'fix/binary-selection-glob' @zdharma-continuum/zinit-annex-binary-symlink
# zinit for @zdharma-continuum/zinit-annex-{'as-monitor','patch-dl','rust','unscope'}
zinit for @zdharma-continuum/zinit-annex-{'bin-gem-node','linkman'}

zinit aliases for @vladdoster/z{'sh','init'}-aliases.plugin.zsh

zinit from'gh-r' lbin'!' for \
@dandavison/delta \
atload"!(){setopt no_aliases;alias l='exa -blF';alias la='exa -abghilmu';alias ll='exa -al';alias ls='exa --git --group-directories-first';}" if'[[ $VENDOR = apple ]]' \
atload"!(){ setopt no_aliases; alias l='exa -blF';alias la='exa -abghilmu';alias ll='exa -al';alias ls='exa --git --group-directories-first';}" if'[[ $VENDOR = apple ]]' \
@ogham/exa \
atload"!(){setopt no_aliases;alias l='eza -blF';alias la='eza -abghilmu';alias ll='eza -al';alias ls='eza --git --group-directories-first';}" if'[[ $VENDOR != apple ]]' \
atload"!(){ setopt no_aliases; alias l='eza -blF';alias la='eza -abghilmu';alias ll='eza -al';alias ls='eza --git --group-directories-first';}" if'[[ $VENDOR != apple ]]' \
@eza-community/eza \
atload'!(){local i;for i (v vi vim);do alias $i="nvim";done; export EDITOR="nvim"; }' \
ver'nightly' \
atload'!(){ setopt no_aliases; local i;for i (v vi vim);do alias $i="nvim";done; export EDITOR="nvim"; }' \
lbin'!nvim' \
no'completions' \
@neovim/neovim
# as'program' \
# zinit id-as for \
# compile'revolver' \
# pick'revolver' \
# @molovo/revolver \
# ver'fix/zsh-completion' \
# @vladdoster/zshfmt
zinit id-as for \
as'program' \
compile'revolver' \
pick'revolver' \
@molovo/revolver \
ver'fix/zsh-completion' \
@vladdoster/zshfmt
@vladdoster/zshfmt \
null \
@zdharma-continuum/zinit-vim-syntax
# zinit from'gh-r' lbin'!' for \
# lbin'!gh' @cli/cli \
# lbin'!hugo' @gohugoio/hugo \
# lbin'!*->fx' @antonmedv/fx \
# @sharkdp/bat @sharkdp/fd @sharkdp/hyperfine \
# @topgrade-rs/topgrade \
# @chanzuckerberg/fogg
zinit from'gh-r' lbin'!' lman for \
lbin'!gh' @cli/cli \
lbin'!hugo' @gohugoio/hugo \
lbin'!*->fx' @antonmedv/fx \
@JohnnyMorganz/StyLua \
@junegunn/fzf \
@sharkdp/bat @sharkdp/fd @sharkdp/hyperfine \
@topgrade-rs/topgrade \
@chanzuckerberg/fogg
# zinit snippet OMZ::plugins/git
# zinit snippet OMZ::lib/git.zsh
zinit snippet OMZ::plugins/git
zinit snippet OMZ::lib/git.zsh
# zinit is-snippet for @OMZ{'::lib/git.zsh',P::{'colored-man-pages','extract'}}
# zinit make pick'etc/git-extras-completion.zsh' for @tj/git-extras
zinit build depth=1 id-as for \
configure'--disable-utf8proc' \
@tmux/tmux \
@bminor/bash \
@cmatsuoka/figlet \
@jqlang/jq \
@vim/vim
zinit cmake for \
@Koihik/LuaFormatter \
@thewtex/tmux-mem-cpu-load
zinit lucid wait for \
null make"prefix=$ZPFX all install" \
Expand All @@ -107,16 +130,9 @@ zinit lucid wait for \
blockf atpull'zinit creinstall -q .' \
@zsh-users/zsh-completions
# compile'h*~*zwc' \
# id-as'hsmw-compile-ice' \
# compile'h*~*zwc' \
# @zdharma-continuum/history-search-multi-word \
# id-as'hsmw-no-compile-ice' \
# @zdharma-continuum/history-search-multi-word \
zinit configure depth=1 id-as make for \
@bminor/bash \
@cmatsuoka/figlet \
@jqlang/jq \
@vim/vim \
configure'--disable-utf8proc' \
@tmux/tmux

0 comments on commit 6c88b81

Please sign in to comment.