Compare commits

..

19 Commits

Author SHA1 Message Date
73f620fe39 tweaks 2025-10-20 16:54:21 +03:00
e191034b63 theme 2025-10-20 16:52:01 +03:00
1c615589f2 tweaks 2025-10-20 16:52:01 +03:00
e3e22e5bf7 navigation-file: fix lint issues 2025-10-20 16:52:01 +03:00
44925ddd73 navigation-file: fix empty buffer 2025-10-20 16:52:01 +03:00
6ede4f1a7f navigation-file: use ripgrep 2025-10-20 16:52:01 +03:00
ca5c511a10 navigation-file: use fdfind 2025-10-20 16:52:01 +03:00
90c5d70a5a navigation-file 1 2025-10-20 16:52:01 +03:00
6c73a15f21 improve active cursor line 2025-10-20 16:52:01 +03:00
fabb214a0f format 2025-10-20 16:52:01 +03:00
9be8d154ca improve terminal buffers 2025-10-20 16:52:01 +03:00
ad7c791d23 add telescope 2025-10-20 16:52:01 +03:00
64a20b1292 clean nvim 2025-10-20 16:52:01 +03:00
9418d8ccc7 sync theme script 2025-10-20 15:42:37 +02:00
d7311cca46 nvim alias 2025-10-20 15:41:28 +02:00
eeafb5195c feat: ghostty 2025-10-20 15:39:11 +02:00
2762a4ff65 macos bin: con, vm 2025-10-12 06:48:26 +02:00
e48a477c02 simplify zsh config 2025-10-12 06:48:06 +02:00
d45a3971fd zsh delay 2025-10-10 04:25:52 +02:00
13 changed files with 234 additions and 261 deletions

View File

@ -28,16 +28,10 @@
},
"zsh": {
"link": {
"from": "shared/zsh_root",
"from": "shared/zsh",
"to": "~/.zshrc"
}
},
"zsh_config": {
"link": {
"from": "shared/zsh_config",
"to": "~/.config/zsh"
}
},
"tmux": {
"link": {
"from": "shared/tmux",
@ -72,7 +66,6 @@
"environments": {
"macos": [
"zsh",
"zsh_config",
{
"package": "bin",
"link": {
@ -105,7 +98,6 @@
}
],
"linux-vm": [
"zsh_config",
{
"package": "zsh",
"install": "sudo apt install -y zsh",
@ -134,7 +126,6 @@
"bin"
],
"linux-dev": [
"zsh_config",
{
"package": "zsh",
"install": "sudo apt install -y zsh",

135
config/macos/bin/con Executable file
View File

@ -0,0 +1,135 @@
#!/usr/bin/env bash
set -euo pipefail
ATTACH_TMUX=1
DRY_RUN=0
TMUX_SESSION_DEFAULT="default"
df_platform=""
df_namespace=""
df_user=""
ssh_identity=""
ssh_host=""
ssh_args=()
usage() {
local prog
prog=$(basename "$0")
echo "Usage: $prog <platform> [user@]namespace [--no-tmux|-t] [--dry-run|-n] [-- <ssh args...>]" >&2
echo
echo "Examples:"
echo " $prog orb namespace"
echo " $prog utm user@namespace --no-tmux"
echo " $prog core user@namespace --dry-run -- -v -p 2222"
exit 1
}
parse_args() {
if [[ $# -lt 2 ]]; then
usage
fi
df_platform="$1"
local user_namespace_arg="$2"
shift 2
# Extract df_user and df_namespace
if [[ "$user_namespace_arg" == *@* ]]; then
df_user="${user_namespace_arg%@*}"
df_namespace="${user_namespace_arg#*@}"
else
df_user="$USER"
df_namespace="$user_namespace_arg"
fi
# Parse remaining flags and ssh args
while [[ $# -gt 0 ]]; do
case "$1" in
-t|--no-tmux)
ATTACH_TMUX=0
shift
;;
-n|--dry-run)
DRY_RUN=1
shift
;;
--)
shift
ssh_args+=("$@")
break
;;
*)
echo "Unknown option: $1" >&2
usage
;;
esac
done
}
resolve_host() {
case "$df_platform" in
orb)
# orb-stack handles user@namespace internally
ssh_host="${df_namespace}@orb"
;;
utm)
ssh_host="${df_namespace}.utm.local"
ssh_identity="$HOME/.ssh/id_ed25519_internal"
;;
core)
ssh_host="${df_namespace}.core.lan"
ssh_identity="$HOME/.ssh/id_ed25519_internal"
;;
ec2)
ssh_host="${df_namespace}.ec2.internal"
;;
hetzner)
ssh_host="${df_namespace}.hetzner.test"
;;
*)
echo "Error: unknown platform '$df_platform'" >&2
exit 1
;;
esac
}
build_ssh_cmd() {
local cmd=(ssh -tt)
if [[ -n "$ssh_identity" ]]; then
cmd+=(-i "$ssh_identity" -o IdentitiesOnly=yes)
fi
if [[ ${#ssh_args[@]} -gt 0 ]]; then
cmd+=("${ssh_args[@]}")
fi
cmd+=("${df_user}@${ssh_host}")
if [[ $ATTACH_TMUX -eq 1 ]]; then
cmd+=("tmux" "new-session" "-As" "$TMUX_SESSION_DEFAULT"
"-e" "DF_NAMESPACE=$df_namespace"
"-e" "DF_PLATFORM=$df_platform")
fi
echo "${cmd[@]}"
}
main() {
parse_args "$@"
resolve_host
ssh_cmd=($(build_ssh_cmd))
if [[ $DRY_RUN -eq 1 ]]; then
echo "Dry run command:"
printf '%q ' "${ssh_cmd[@]}"
echo
exit 0
fi
exec "${ssh_cmd[@]}"
}
main "$@"

23
config/macos/bin/sync_theme Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
# URL="https://raw.githubusercontent.com/triimdev/invero.nvim/refs/heads/main/extras/ghostty/invero_day"
# THEME_DIR="$HOME/.config/ghostty/themes"
# THEME_NAME="Invero Day"
URL="https://raw.githubusercontent.com/triimdev/invero.nvim/refs/heads/main/extras/wezterm/invero_day.toml"
THEME_DIR="$HOME/.config/wezterm/colors"
THEME_NAME="Invero Day.toml"
THEME_PATH="${THEME_DIR}/${THEME_NAME}"
mkdir -p "$THEME_DIR"
if curl -fsSL -o "$THEME_PATH" "$URL"; then
echo "Theme downloaded to $THEME_PATH"
else
echo "Failed to download theme."
exit 1
fi

View File

@ -1,81 +0,0 @@
#!/usr/bin/env bash
# ~/bin/vm
#
# SSH helper script for connecting to VMs or workstations.
# Usage:
# vm [--no-tmux] <host>
#
# Host patterns:
# personal-orb -> ssh $USER@personal@orb
# personal-utm -> ssh $USER@personal.utm.local
# personal-workstation -> ssh $USER@personal.workstation.lan
#
# Optional:
# --no-tmux -> skips attaching to tmux session
# TMP: Tmux will be disabled (switch to 0 to enable it again)
skip_tmux=0
# Check for --no-tmux flag
if [[ "$1" == "--no-tmux" ]]; then
skip_tmux=1
shift
fi
full="$1"
shift # remove host from args
user="$USER"
host="$full"
# Split user@host if explicitly specified
if [[ "$full" == *@* ]]; then
user="${full%@*}"
host="${full#*@}"
fi
# Map host patterns to SSH target and machine type
case "$host" in
*-orb)
ssh_host="${host%-orb}@orb"
TARGET_MACHINE="orb"
;;
*-utm)
ssh_host="${host%-utm}.utm.local"
TARGET_MACHINE="utm"
ssh_identity="$HOME/.ssh/id_ed25519_internal"
;;
*-workstation)
ssh_host="${host%-workstation}.workstation.lan"
TARGET_MACHINE="workstation"
ssh_identity="$HOME/.ssh/id_ed25519_internal"
;;
*)
echo "Error: unknown host pattern '$host'" >&2
exit 1
;;
esac
# Always use "default" tmux session
tmux_session="default"
# Build SSH command safely using an array
ssh_cmd=(ssh -tt)
# Include identity file if needed
[[ -n "$ssh_identity" ]] && ssh_cmd+=(-i "$ssh_identity" -o IdentitiesOnly=yes)
# Add target user and host
ssh_cmd+=("$user@$ssh_host")
# Add tmux session unless skipped
if [[ $skip_tmux -eq 0 ]]; then
ssh_cmd+=("tmux" "new-session" "-As" "$tmux_session" "-e" "TARGET_MACHINE=$TARGET_MACHINE")
else
# Pass through any extra args user supplied
ssh_cmd+=("$@")
fi
# echo "Executing: ${ssh_cmd[*]}" >&2
exec "${ssh_cmd[@]}"

Binary file not shown.

View File

@ -1,24 +1,12 @@
# Terminal
term = xterm-256color
theme = Invero Day
# Fonts
# Font
font-family = "Maple Mono NF"
#font-size = 14
font-thicken = true
#font-thicken-strength = 2
adjust-box-thickness = 2
# Window
window-padding-x = 0
window-padding-y = 0
window-height = 50
window-width = 120
window-step-resize = true
window-padding-balance = false
# window-padding-color = extend
# Icon
macos-icon = custom
font-size = 13
#font-thicken = true
adjust-cell-width = -7%
adjust-cell-height = -2
# Cursor
cursor-style = block
@ -26,17 +14,9 @@ cursor-style-blink = false
mouse-hide-while-typing = true
shell-integration-features = no-cursor
# Font/Cell quality
window-colorspace = srgb
alpha-blending = linear-corrected
# Window
window-padding-x = 4
window-padding-y = 0
window-padding-color = extend
macos-titlebar-style = native
adjust-cell-width = -1
#adjust-cell-height = -2
# Theme
background = #eeeeee
foreground = #434343
window-theme = auto
background-opacity = 1
background-blur = false
macos-icon = custom

View File

@ -0,0 +1,22 @@
palette = 0=#444444
palette = 1=#ff0000
palette = 2=#00af5f
palette = 3=#d75f00
palette = 4=#005fff
palette = 5=#5f5f87
palette = 6=#afd7ff
palette = 7=#eeeeee
palette = 8=#444444
palette = 9=#ff0000
palette = 10=#00af5f
palette = 11=#d75f00
palette = 12=#005fff
palette = 13=#5f5f87
palette = 14=#afd7ff
palette = 15=#eeeeee
background = #eeeeee
foreground = #444444
cursor-color = #005fff
selection-background = #dadada
selection-foreground = #444444

42
config/shared/zsh Normal file
View File

@ -0,0 +1,42 @@
export PATH="$PATH:$HOME/bin"
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LC_COLLATE=C
KEYTIMEOUT=1
HISTFILE=$HOME/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt auto_cd interactive_comments prompt_subst
setopt append_history hist_ignore_dups hist_ignore_all_dups hist_reduce_blanks
autoload -Uz compinit
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case-insensitive
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
compinit
git_prompt_info() {
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local branch=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)
echo " %F{green}($branch)%f"
fi
}
PROMPT='%n@%m%f %F{blue}%~%f$(git_prompt_info) $ '
autoload -U up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '^[[A' up-line-or-beginning-search
bindkey '^[OA' up-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search
bindkey '^[OB' down-line-or-beginning-search
bindkey '^U' backward-kill-line
# alias ls='ls --color=auto --group-directories-first'
alias ls='ls --color=auto'
alias ll='ls -lF'
alias lla='ll -a'
alias ld='ls -ld */'
alias vim=nvim

View File

@ -1,47 +0,0 @@
# -----------------------------
# OS-specific aliases for ls
# -----------------------------
OS_TYPE=$(uname)
if [[ "$OS_TYPE" == "Linux" ]]; then
alias ls='ls --color=auto --group-directories-first'
elif [[ "$OS_TYPE" == "Darwin" ]]; then
alias ls='ls --color=auto'
fi
alias ll='ls -lF'
alias lla='ll -a'
alias ld='ls -ld */'
# -----------------------------
# Vim / Neovim
# -----------------------------
if command -v nvim >/dev/null 2>&1; then
alias vim='nvim'
fi
# -----------------------------
# Git aliases
# -----------------------------
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gb='git branch'
alias gcm='git commit -m'
alias gam='git commit -am'
alias gco='git checkout'
alias gd='git diff'
alias gf='git fetch'
alias gl='git pull'
alias gp='git push'
alias gst='git status'
alias glg='git log --graph --oneline --decorate --all'
alias gm='git merge'
alias grb='git rebase'
alias grs='git reset'
alias grv='git remote -v'
alias tree='tree -I node_modules'
# -----------------------------
# Other
# -----------------------------
alias k='kubectl'

View File

@ -1,15 +0,0 @@
# -----------------------------
# ZLE functions
# -----------------------------
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '^[[A' up-line-or-beginning-search
bindkey '^[OA' up-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search
bindkey '^[OB' down-line-or-beginning-search
bindkey '^U' backward-kill-line

View File

@ -1,15 +0,0 @@
# -----------------------------
# Git prompt function
# -----------------------------
git_prompt_info() {
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local branch=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)
echo " %F{green}($branch)%f"
fi
}
# -----------------------------
# Set prompt
# -----------------------------
PROMPT='%n@%m%f %F{blue}%~%f$(git_prompt_info) $ '

View File

@ -1,48 +0,0 @@
# -----------------------------
# PATH
# -----------------------------
export PATH="$PATH:$HOME/bin"
# -----------------------------
# Locales
# -----------------------------
export LANGUAGE="en_US:en"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# -----------------------------
# Autocomplete
# -----------------------------
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive
# -----------------------------
# Shell options
# -----------------------------
setopt autocd
setopt share_history
setopt interactivecomments
setopt PROMPT_SUBST # Enable dynamic prompt expansion
# -----------------------------
# Disable conflicting builtins
# -----------------------------
disable log
# -----------------------------
# History
# -----------------------------
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
setopt HIST_IGNORE_ALL_DUPS
# -----------------------------
# Source modular components
# -----------------------------
CONFIG_DIR="$HOME/.config/zsh"
[ -f "$CONFIG_DIR/aliases" ] && source "$CONFIG_DIR/aliases"
[ -f "$CONFIG_DIR/prompt" ] && source "$CONFIG_DIR/prompt"
[ -f "$CONFIG_DIR/keybindings" ] && source "$CONFIG_DIR/keybindings"

View File

@ -1,14 +0,0 @@
export EDITOR="nvim"
export VISUAL="nvim"
export PATH="$PATH:/home/tomas/.local/bin"
eval "$(dircolors)"
export LS_COLORS="${LS_COLORS}:ln=1;33:"
if [ -f "$HOME/.config/zsh/zshrc" ]; then
source "$HOME/.config/zsh/zshrc"
else
echo "Warning: ~/.config/zsh/zshrc not found, skipping custom Zsh configuration."
fi