This commit is contained in:
Piotr Domański 2026-03-20 15:52:55 +01:00
parent 85571584eb
commit ea74014351
4 changed files with 16 additions and 8 deletions

View file

@ -50,3 +50,6 @@ cpy() { py -c "import sys, pyperclip; pyperclip.copy(sys.stdin.read().strip())";
hlst() { history | tail --lines=1 | cut -d " " -f 4-; } hlst() { history | tail --lines=1 | cut -d " " -f 4-; }
lstc() { lst | cpy; } lstc() { lst | cpy; }
hlstc() { hlst | cpy; } hlstc() { hlst | cpy; }
# tmux
tmuxssn() {tmux display-message -p "#{session_name}:#{window_index}.#{pane_index}"}

View file

@ -9,7 +9,11 @@ ENDING_DIRS = [".git", ".svn", ".hg", ".venv"]
def subdirs(path): def subdirs(path):
return [d for d in os.listdir(path) if not d.startswith(".") and os.path.isdir(os.path.join(path, d))] return [
d
for d in os.listdir(path)
if not d.startswith(".") and os.path.isdir(os.path.join(path, d))
]
def gen_aliases(dirs, prefix="", subpath=""): def gen_aliases(dirs, prefix="", subpath=""):
@ -30,7 +34,9 @@ def gen_aliases(dirs, prefix="", subpath=""):
aliases[prefix + d.lower()] = os.path.join(subpath, d) aliases[prefix + d.lower()] = os.path.join(subpath, d)
break break
if all([dd == d or not dd.lower().startswith(k) for dd in dirs]) and not which(prefix + k): if all(
[dd == d or not dd.lower().startswith(k) for dd in dirs]
) and not which(prefix + k):
aliases[prefix + k] = os.path.join(subpath, d) aliases[prefix + k] = os.path.join(subpath, d)
break break
@ -59,11 +65,10 @@ def process_dir(path, prefix="", depth=0):
def gen_alias(alias_name, path): def gen_alias(alias_name, path):
cmd = f"cd {path}" cmd = f'cd {path} && [ -n "$TMUX" ] && tmux rename-session {alias_name}'
return "alias {}='{}'".format(alias_name, cmd) return "alias {}='{}'".format(alias_name, cmd)
print("Generating aliases...") print("Generating aliases...")
ALIASES = [] ALIASES = []

View file

@ -71,6 +71,9 @@ set -g @plugin 'tinted-theming/base16-tmux'
set -g @colors-base16 'ocean' set -g @colors-base16 'ocean'
set -g status-left "[#{session_name}] "
set -g window-status-current-format "#I:#W [#{pane_index}/#{window_panes}]"
set -g window-status-format "#I:#W [#{pane_index}/#{window_panes}]"
run '~/.tmux/plugins/tpm/tpm' run '~/.tmux/plugins/tpm/tpm'
# set vi-mode # set vi-mode

5
.zshrc
View file

@ -25,7 +25,7 @@ NEWLINE=$'\n'
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[magenta]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%(6~|...%3~|%~)%{$fg[red]%}]%{$fg[magenta]%}%-50(l:$ :$NEWLINE -> )%{$reset_color%}%b" PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[magenta]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%(6~|...%3~|%~)%{$fg[red]%}]%{$fg[magenta]%}%-50(l:$ :$NEWLINE -> )%{$reset_color%}%b"
# exports - local bin, python, brew # exports - local bin, python, brew
export PATH="$HOME/.local/bin:$HOME/.bin:$HOME/.cargo/bin:${HOME}/go/bin/:/opt/homebrew/bin:$PATH:$PATH" export PATH="$HOME/.local/bin:$HOME/.bin:$HOME/.cargo/bin:${HOME}/go/bin/:/opt/homebrew/bin:$PATH:$HOME/.local/share/nvim/mason/bin:$HOME/.opencode/bin:$PATH"
zstyle ':vcs_info:*' enable git hg svn zstyle ':vcs_info:*' enable git hg svn
zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' check-for-changes true
@ -232,6 +232,3 @@ if [ -f "$HOME/.config/.env" ]; then
fi fi
export STM32_PRG_PATH=/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin export STM32_PRG_PATH=/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin
# opencode
export PATH=/Users/doman/.opencode/bin:$PATH