Current working changes to configuration
This commit is contained in:
commit
0a24ffcef1
66 changed files with 5312 additions and 0 deletions
80
home/shell/.tmux.conf
Normal file
80
home/shell/.tmux.conf
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
#Make nicer tmux motion keys that work with vim as well
|
||||
set -g xterm-keys on
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
|
||||
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
||||
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
||||
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
||||
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
||||
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
||||
|
||||
unbind C-b
|
||||
set -g prefix C-p
|
||||
bind C-p send-prefix
|
||||
|
||||
#Sane split commands
|
||||
bind v split-window -h -c "#{pane_current_path}"
|
||||
bind s split-window -v -c "#{pane_current_path}"
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
# New windows open in current directory
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
|
||||
# reload config file (change file location to your the tmux.conf you want to use)
|
||||
bind r source-file ~/.tmux.conf
|
||||
|
||||
# Vim key bindings
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection primary"
|
||||
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -in -selection primary"
|
||||
|
||||
# don't do anything when a 'bell' rings
|
||||
set -g visual-activity off
|
||||
set -g visual-bell off
|
||||
set -g visual-silence off
|
||||
setw -g monitor-activity off
|
||||
set -g bell-action none
|
||||
|
||||
# clock mode
|
||||
setw -g clock-mode-colour "#BBBBBB"
|
||||
|
||||
# copy mode
|
||||
setw -g mode-style 'fg=black bg=red bold'
|
||||
|
||||
# panes
|
||||
set -g pane-border-style 'fg=red'
|
||||
set -g pane-active-border-style 'fg=yellow'
|
||||
|
||||
# statusbar
|
||||
set -g status-position bottom
|
||||
set -g status-justify left
|
||||
set -g status-style 'fg=black bold'
|
||||
|
||||
set -g status-left '#( [ -n "$SSH_CONNECTION" ] && printf " #[fg=red,bold][SSH]" ) '
|
||||
set -g status-left-length 10
|
||||
|
||||
set -g status-right-style 'fg=white bold bg=black'
|
||||
set -g status-right '%Y-%m-%d %H:%M '
|
||||
set -g status-right-length 50
|
||||
|
||||
setw -g window-status-current-style 'fg=red bold bg=black'
|
||||
setw -g window-status-current-format ' #I #W #F '
|
||||
|
||||
setw -g window-status-style 'fg=white bg=black'
|
||||
setw -g window-status-format ' #I #[fg=white]#W #F '
|
||||
|
||||
setw -g window-status-bell-style 'fg=yellow bg=red bold'
|
||||
|
||||
# messages
|
||||
set -g message-style 'fg=white bg=black'
|
||||
|
||||
# Pass through shift+enter
|
||||
set -g extended-keys on
|
||||
set -g extended-keys-format csi-u
|
||||
|
||||
# Dim inactive panes
|
||||
source-file ~/.config/tmux/theme.conf
|
||||
225
home/shell/.zshrc
Normal file
225
home/shell/.zshrc
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
#==============================================================================
|
||||
# Zsh Configuration
|
||||
#==============================================================================
|
||||
# History settings
|
||||
HISTFILE=~/.histfile
|
||||
HISTSIZE=100000
|
||||
SAVEHIST=100000
|
||||
setopt extendedglob notify
|
||||
unsetopt autocd beep
|
||||
setopt INC_APPEND_HISTORY # Write to history file immediately, not when shell exits
|
||||
setopt APPEND_HISTORY # Append instead of overwriting the file
|
||||
setopt HIST_IGNORE_DUPS # Don't save duplicate commands
|
||||
setopt HIST_IGNORE_SPACE # Don't save commands starting with space
|
||||
|
||||
#==============================================================================
|
||||
# Environment Variables
|
||||
#==============================================================================
|
||||
|
||||
export OMPI_MCA_rmaps_base_oversubscribe=1
|
||||
export CLICOLOR=1
|
||||
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
|
||||
export LS_COLORS='di=1;37:ln=35:so=32:pi=33:ex=1;32:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43'
|
||||
export XKB_DEFAULT_OPTIONS="caps:escape"
|
||||
export PASSWORD_STORE_CHARACTER_SET='a-zA-Z0-9+\-$!*_='
|
||||
export XDEB_PKGROOT=${HOME}/.config/xdeb
|
||||
export EDITOR=nvim
|
||||
export TERMINAL=ghostty
|
||||
export GOOGLE_CLOUD_PROJECT=slurm-slinky-k8s
|
||||
export SU2_RUN="~/.local/bin/"
|
||||
export SU2_HOME="~/builds/SU2/"
|
||||
export PYTHONPATH=$SU2_RUN:$PYTHONPATH
|
||||
|
||||
if [[ -f /etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh ]]; then
|
||||
source /etc/profiles/per-user/$USER/etc/profile.d/hm-session-vars.sh
|
||||
fi
|
||||
|
||||
# Custom path additions
|
||||
if [ -f "$HOME/.profile" ]; then
|
||||
source ~/.profile
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.local/share/os/habits.sh" ]; then
|
||||
source "$HOME/.local/share/os/habits.sh"
|
||||
fi
|
||||
|
||||
#==============================================================================
|
||||
# Aliases
|
||||
#==============================================================================
|
||||
|
||||
alias clip2png="xclip -selection clipboard -target image/png -out"
|
||||
if which kubectl > /dev/null; then
|
||||
alias k="kubectl"
|
||||
source <(k completion zsh)
|
||||
fi
|
||||
cc() {
|
||||
CLAUDE_SESSION="${1:-unnamed}" claude "${@:2}"
|
||||
}
|
||||
|
||||
ssh_no_tmux() {
|
||||
NO_TMUX=1 nohup ghostty --command="ssh $*" >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
alias jjn="jj new -B @ --no-edit"
|
||||
alias jjs="jj squash --interactive --from @ --into @-"
|
||||
alias jjp="jj bookmark move master --to @-; jj git push"
|
||||
alias pkg_search="nix search nixpkgs --extra-experimental-features 'nix-command flakes'"
|
||||
|
||||
sandbox() {
|
||||
local host_repos="$HOME/repos"
|
||||
local sandbox_cwd="/workspace"
|
||||
|
||||
if [[ "$PWD" == "$host_repos" ]]; then
|
||||
sandbox_cwd="/workspace"
|
||||
elif [[ "$PWD" == "$host_repos"/* ]]; then
|
||||
sandbox_cwd="/workspace/${PWD#$host_repos/}"
|
||||
fi
|
||||
|
||||
if ! docker ps -a --format '{{.Names}}' | grep -q '^dev-sandbox$'; then
|
||||
docker run -dit --name dev-sandbox \
|
||||
--env-file "$host_repos/dev_sandbox/.env" \
|
||||
-v "$host_repos:/workspace" \
|
||||
-v pi-state:/root/.pi \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
dev-sandbox:latest
|
||||
else
|
||||
docker start dev-sandbox 2>/dev/null
|
||||
fi
|
||||
|
||||
if (( $# > 0 )); then
|
||||
docker exec -it -w "$sandbox_cwd" dev-sandbox /bin/zsh -l -c 'exec "$@"' sandbox "$@"
|
||||
else
|
||||
docker exec -it -w "$sandbox_cwd" dev-sandbox /bin/zsh -l
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#==============================================================================
|
||||
# Functions
|
||||
#==============================================================================
|
||||
|
||||
load_env() {
|
||||
set -a
|
||||
. "./$1"
|
||||
set +a
|
||||
}
|
||||
|
||||
#==============================================================================
|
||||
# os functions
|
||||
#==============================================================================
|
||||
alias t="nvim ~/.local/share/os/tasks.md"
|
||||
alias h="habits open"
|
||||
alias books="nvim ~/.local/share/os/books.md"
|
||||
alias mindset="nvim ~/.local/share/os/mindset.md"
|
||||
|
||||
#==============================================================================
|
||||
# Completions
|
||||
#==============================================================================
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
zstyle ':compinstall' filename '/home/aselimov/.zshrc'
|
||||
zstyle -e ':completion:*:hosts' hosts 'reply=(
|
||||
${=${${(f)"$(cat {/etc/ssh_,~/ar.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//,/ }
|
||||
${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
|
||||
)'
|
||||
|
||||
#==============================================================================
|
||||
# Plugins & Tools
|
||||
#==============================================================================
|
||||
|
||||
# nvm
|
||||
# Lazy-load nvm - only initialize when first used
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
|
||||
# Function to load nvm (called only once)
|
||||
load_nvm() {
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
||||
}
|
||||
|
||||
# Create placeholder functions that load nvm once, then call the real command
|
||||
nvm() {
|
||||
unset -f nvm node npm
|
||||
load_nvm
|
||||
nvm "$@"
|
||||
}
|
||||
|
||||
node() {
|
||||
unset -f nvm node npm
|
||||
load_nvm
|
||||
node "$@"
|
||||
}
|
||||
|
||||
npm() {
|
||||
unset -f nvm node npm
|
||||
load_nvm
|
||||
npm "$@"
|
||||
}
|
||||
|
||||
# ghcup
|
||||
[ -f "/home/aselimov/.ghcup/env" ] && . "/home/aselimov/.ghcup/env" # ghcup-env
|
||||
|
||||
# pyenv
|
||||
if command -v pyenv >/dev/null 2>&1; then
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init - zsh)"
|
||||
fi
|
||||
|
||||
# jenv
|
||||
if command -v jenv >/dev/null 2>&1; then
|
||||
export PATH="$HOME/.jenv/bin:$PATH"
|
||||
eval "$(jenv init -)"
|
||||
fi
|
||||
|
||||
# Simple notify function
|
||||
notify() {
|
||||
local cmd="$*"
|
||||
eval "$cmd"
|
||||
local rc=$?
|
||||
osascript -e "display notification \"Done (exit=$rc)\" with title \"${cmd//\"/\\\"}\""
|
||||
return $rc
|
||||
}
|
||||
|
||||
|
||||
# zsh-autosuggestions
|
||||
source "$HOME/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||
|
||||
# zsh-syntax-highlighting
|
||||
source "$HOME/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
|
||||
# zsh-history-substring-search
|
||||
source "$HOME/.config/zsh/zsh-history-substring-search/zsh-history-substring-search.zsh"
|
||||
|
||||
#==============================================================================
|
||||
# Keybindings
|
||||
#==============================================================================
|
||||
|
||||
bindkey -v
|
||||
bindkey '^[[A' history-substring-search-up
|
||||
bindkey '^[[B' history-substring-search-down
|
||||
|
||||
#==============================================================================
|
||||
# OS-Specific Configuration
|
||||
#==============================================================================
|
||||
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
alias ls="gls --classify --group-directories-first --color"
|
||||
export NVIM_JDTLS_JAVA_HOME="/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/"
|
||||
else
|
||||
alias ls="ls --classify --group-directories-first --color"
|
||||
fi
|
||||
|
||||
# starship
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
if [[ -z "$TMUX" ]] && [[ -n "$PS1" ]] && [[ -z "$NO_TMUX" ]]; then
|
||||
tmux attach -t dev || tmux new -s dev
|
||||
fi
|
||||
|
||||
# Get remaining habits
|
||||
if [ -n "$HABITS" ]; then
|
||||
echo "Habits remaining are:"
|
||||
habits left
|
||||
fi
|
||||
51
home/shell/shell.nix
Normal file
51
home/shell/shell.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{config, pkgs, ...}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
starship
|
||||
];
|
||||
xdg.configFile."starship.toml".source = ./starship.toml;
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
initContent=''
|
||||
source ${./.zshrc}
|
||||
'';
|
||||
shellAliases = {
|
||||
sudo = "doas";
|
||||
};
|
||||
};
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
|
||||
config = {
|
||||
global = {
|
||||
hide_env_diff = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."zsh/zsh-syntax-highlighting".source = builtins.fetchGit {
|
||||
url = "https://forge.alexselimov.com/aselimov/zsh-syntax-highlighting.git";
|
||||
rev = "2fc57d63067c18b1100ecdbf684fa5baf49459d1";
|
||||
};
|
||||
|
||||
xdg.configFile."zsh/zsh-history-substring-search".source = builtins.fetchGit {
|
||||
url = "https://forge.alexselimov.com/aselimov/zsh-history-substring-search.git";
|
||||
rev = "14c8d2e0ffaee98f2df9850b19944f32546fdea5";
|
||||
};
|
||||
|
||||
xdg.configFile."zsh/zsh-autosuggestions".source = builtins.fetchGit {
|
||||
url = "https://forge.alexselimov.com/aselimov/zsh-autosuggestions.git";
|
||||
rev = "85919cd1ffa7d2d5412f6d3fe437ebdbeeec4fc5";
|
||||
};
|
||||
|
||||
programs.tmux.enable = true;
|
||||
xdg.configFile."tmux/tmux.conf".source = ./.tmux.conf;
|
||||
xdg.configFile."tmux/themes/zenwritten-light.conf".text = ''
|
||||
set -g window-style 'bg=gray'
|
||||
'';
|
||||
xdg.configFile."tmux/themes/zenwritten-dark.conf".text = ''
|
||||
set -g window-style 'bg=brightblack'
|
||||
'';
|
||||
}
|
||||
166
home/shell/starship.toml
Normal file
166
home/shell/starship.toml
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
#8e8e8e normal
|
||||
#BBBBBB bold
|
||||
#66a5ad accent
|
||||
|
||||
format = """
|
||||
$username\
|
||||
$hostname\
|
||||
$shlvl\
|
||||
$kubernetes\
|
||||
$directory\
|
||||
$hg_branch\
|
||||
$docker_context\
|
||||
$package\
|
||||
$cmake\
|
||||
$dart\
|
||||
$dotnet\
|
||||
$elixir\
|
||||
$elm\
|
||||
$erlang\
|
||||
$golang\
|
||||
$helm\
|
||||
$java\
|
||||
$julia\
|
||||
$kotlin\
|
||||
$nim\
|
||||
$nodejs\
|
||||
$ocaml\
|
||||
$perl\
|
||||
$php\
|
||||
$purescript\
|
||||
$python\
|
||||
$ruby\
|
||||
$rust\
|
||||
$swift\
|
||||
$terraform\
|
||||
$zig\
|
||||
$nix_shell\
|
||||
$conda\
|
||||
$memory_usage\
|
||||
$aws\
|
||||
$gcloud\
|
||||
$openstack\
|
||||
$env_var\
|
||||
$crystal\
|
||||
$custom\
|
||||
$cmd_duration\
|
||||
$line_break\
|
||||
$lua\
|
||||
$jobs\
|
||||
$battery\
|
||||
$time\
|
||||
$status\
|
||||
$character"""
|
||||
|
||||
[username]
|
||||
style_user = 'bold #66a5ad'
|
||||
|
||||
[hostname]
|
||||
style = 'bold #BBBBBB'
|
||||
ssh_symbol = ""
|
||||
|
||||
[singularity]
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
[kubernetes]
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
[vcsh]
|
||||
style = 'bold white'
|
||||
|
||||
[git_branch]
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
[git_commit]
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
[docker_context]
|
||||
style = 'bold #BBBBBB'
|
||||
[package]
|
||||
style = 'bold #BBBBBB'
|
||||
symbol = " "
|
||||
[cmake]
|
||||
style = 'bold #BBBBBB'
|
||||
[dart]
|
||||
style = 'bold #BBBBBB'
|
||||
[dotnet]
|
||||
style = 'bold #BBBBBB'
|
||||
[elixir]
|
||||
style = 'bold #BBBBBB'
|
||||
[elm]
|
||||
style = 'bold #BBBBBB'
|
||||
[erlang]
|
||||
style = 'bold #BBBBBB'
|
||||
[golang]
|
||||
style = 'bold #BBBBBB'
|
||||
[helm]
|
||||
style = 'bold #BBBBBB'
|
||||
[java]
|
||||
style = 'bold #BBBBBB'
|
||||
[julia]
|
||||
style = 'bold #BBBBBB'
|
||||
[kotlin]
|
||||
style = 'bold #BBBBBB'
|
||||
[nim]
|
||||
style = 'bold #BBBBBB'
|
||||
[nodejs]
|
||||
style = 'bold #BBBBBB'
|
||||
[ocaml]
|
||||
style = 'bold #BBBBBB'
|
||||
[perl]
|
||||
style = 'bold #BBBBBB'
|
||||
[php]
|
||||
style = 'bold #BBBBBB'
|
||||
[purescript]
|
||||
style = 'bold #BBBBBB'
|
||||
[ruby]
|
||||
style = 'bold #BBBBBB'
|
||||
[swift]
|
||||
style = 'bold #BBBBBB'
|
||||
[terraform]
|
||||
style = 'bold #BBBBBB'
|
||||
[zig]
|
||||
style = 'bold #BBBBBB'
|
||||
[nix_shell]
|
||||
style = 'bold #BBBBBB'
|
||||
[conda]
|
||||
style = 'bold #BBBBBB'
|
||||
[memory_usage]
|
||||
style = 'bold #BBBBBB'
|
||||
[aws]
|
||||
style = 'bold #BBBBBB'
|
||||
[gcloud]
|
||||
style = 'bold #BBBBBB'
|
||||
disabled=true
|
||||
[openstack]
|
||||
style = 'bold #BBBBBB'
|
||||
[crystal]
|
||||
style = 'bold #BBBBBB'
|
||||
[cmd_duration]
|
||||
style = 'bold #BBBBBB'
|
||||
[lua]
|
||||
style = 'bold #BBBBBB'
|
||||
symbol = " "
|
||||
[jobs]
|
||||
style = 'bold #BBBBBB'
|
||||
[time]
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
|
||||
[python]
|
||||
symbol = " "
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
[rust]
|
||||
symbol = " "
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
[directory]
|
||||
truncate_to_repo = false
|
||||
style = 'bold #BBBBBB'
|
||||
|
||||
[character]
|
||||
success_symbol = "[](bold green)"
|
||||
error_symbol = "[](bold red)"
|
||||
vicmd_symbol = "[N](bold green)"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue