diff --git a/.config/gitmux/gitmux.yaml b/.config/gitmux/gitmux.yaml new file mode 100644 index 0000000..373f2d5 --- /dev/null +++ b/.config/gitmux/gitmux.yaml @@ -0,0 +1,26 @@ +tmux: + symbols: + branch: '⎇ ' + hashprefix: ':' + ahead: ↑· + behind: ↓· + staged: '● ' + conflict: '✖ ' + modified: ' !' + untracked: '?' + stashed: '⚑ ' + clean: ' ✔ ' + styles: + clear: '#[fg=default]' + state: '#[bg=red,fg=white]' + branch: '#[fg=#e0f2f1,bg=#00796b] ' + remote: '#[fg=cyan]' + staged: '#[fg=green]' + conflict: '#[fg=red]' + modified: '#[fg=#827717,bg=#ffc107]' + untracked: '#[fg=magenta,bg=#ffc107]' + stashed: '#[fg=cyan]' + clean: '#[fg=#e8f5e9,bg=#33691e]' + layout: [branch, divergence, ' ', flags, ' '] + options: + branch_max_len: 0 diff --git a/.config/starship.toml b/.config/starship.toml index d4b64d8..4499dec 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,47 +1,11 @@ -add_newline = true +add_newline = false prompt_order = [ - "username", + "username", "hostname", - "kubernetes", "directory", - "git_branch", - "git_commit", - "git_state", "git_status", - "hg_branch", - "docker_context", - "package", - "dotnet", - "elixir", - "elm", - "erlang", - "golang", - "java", - "julia", - "kubernetes", - "nim", - "nodejs", - "ocaml", - "php", - "purescript", - "python", - "ruby", - "rust", - "terraform", - "zig", - "nix_shell", - "conda", - "memory_usage", - "aws", - "env_var", - "crystal", - "cmd_duration", - "custom", - "line_break", - "jobs", - "battery", - "time", + "git_state", "character", ] @@ -49,10 +13,26 @@ prompt_order = [ symbol = "%%" [line_break] -disabled = false +disabled = true [directory] -fish_style_pwd_dir_length = 2 +fish_style_pwd_dir_length = 1 truncation_length = 1 truncate_to_repo = false style = "bold" + +[git_branch] +style = "" + +[git_commit] +style = "" + +[git_state] +style = "" + +[git_status] +style = "" + +[kubernetes] +disabled = false +style = "" diff --git a/.tmux.conf b/.tmux.conf index 34384e6..d542ed6 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -53,13 +53,14 @@ bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 1 scroll-up bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 1 scroll-down setw -g window-status-format "" +setw -g window-status-current-format "" setw -g window-status-separator "" -set -g status-justify left -set -g status-left "" -set -g status-format "#I:#T" -set -g status-right "" +set -g status-style "bg=#455a64,fg=#f5f5f5" +set -g status-left-length 0 +set -g status-left "#[bg=#263238,fg=#78909C] #I #[bg=#455a64,fg=#cfd8dc] #{=|60|…:pane_current_path} " +set -g status-right '#[bg=#0d47a1,fg=#e1f5fe] ☸ #(kubectl config current-context) #(gitmux -cfg ~/.config/gitmux/gitmux.yaml "#{pane_current_path}")' + set -g set-titles on set -g set-titles-string "#H:#T" -set -g status-style "fg=#EFEBE9,bg=#404040" # vim:set ft=tmux: diff --git a/.zshrc b/.zshrc index c7ea360..16e63c1 100644 --- a/.zshrc +++ b/.zshrc @@ -4,8 +4,8 @@ zplug "plugins/git", from:oh-my-zsh zplug "zsh-users/zsh-completions" zplug 'zsh-users/zsh-syntax-highlighting', defer:2 zplug 'zsh-users/zsh-history-substring-search', defer:3 -zplug 'zsh-users/zsh-autosuggestions' -zplug 'Aloxaf/fzf-tab' +# zplug 'zsh-users/zsh-autosuggestions' +# zplug 'Aloxaf/fzf-tab' if ! zplug check --verbose; then printf "Install? [y/N]: " @@ -48,17 +48,60 @@ autoload -Uz compinit compinit ## Autosuggest -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#D7CCC8,italic" -ZSH_AUTOSUGGEST_USE_ASYNC=1 -ZSH_AUTOSUGGEST_STRATEGY=(history completion) -bindkey '^ ' autosuggest-accept +# ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#D7CCC8,italic" +# ZSH_AUTOSUGGEST_USE_ASYNC=1 +# ZSH_AUTOSUGGEST_STRATEGY=(history completion) + +## fasd +alias a='fasd -a' # any +alias s='fasd -si' # show / search / select +alias d='fasd -d' # directory +alias f='fasd -f' # file +alias sd='fasd -sid' # interactive directory selection +alias sf='fasd -sif' # interactive file selection +alias z='fasd_cd -d' # cd, same functionality as j in autojump +alias zz='fasd_cd -d -i' # cd with interactive selection + +eval "$(fasd --init posix-alias zsh-hook)" + +cd_func () { + local dir + if [[ $1 == "--" ]]; then + _jump || return 1 + return 0 + elif [[ -z "$1" ]]; then + dir="$HOME" + else + dir="$@" + fi + "cd" "${dir}" + fasd -A $PWD +} +alias cd=cd_func + +redraw-prompt() { + local precmd + for precmd in $precmd_functions; do + $precmd + done + zle reset-prompt +} +zle -N redraw-prompt + +_jump() { + dir="$(fasd -Rdlt | fzf --tiebreak=end -1 -0 --no-sort +m --height 10)" && cd_func "${dir}" + zle && zle redraw-prompt +} + +zle -N _jump ## Keybindings bindkey -e bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down -bindkey '^P' history-substring-search-up -bindkey '^N' history-substring-search-down +bindkey '^P' history-beginning-search-backward +bindkey '^N' history-beginning-search-forward +bindkey '^g' _jump ## Gnupg / gpg / ssh / yubikey @@ -116,13 +159,13 @@ GOPROXY=https://proxy.golang.org/ export ANSIBLE_NOCOWS=1 ## Prompt -function set_win_title(){ - echo -ne "\033]0;${PWD}\007" +function _pre(){ + # echo -ne "\033]0;${PWD}\007" + tmux refresh-client -S } -starship_precmd_user_func="set_win_title" -precmd_functions+=(set_win_title) +starship_precmd_user_func="_pre" +precmd_functions+=(_pre) eval "$(starship init zsh)" - export PATH=$HOME/bin:$PATH