setopt correct setopt histignoredups setopt sharehistory setopt incappendhistory setopt interactivecomments HISTFILE=~/.zsh_history HISTSIZE=10000 SAVEHIST=10000 bindkey -v export KEYTIMEOUT=1 autoload -Uz compinit && compinit autoload -Uz bashcompinit && bashcompinit zstyle ':completion:*' menu select zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' autoload -Uz vcs_info precmd() { vcs_info } setopt prompt_subst zstyle ':vcs_info:*' enable git zstyle ':vcs_info:git:*' formats ' (%b%u%c)' zstyle ':vcs_info:git:*' stagedstr '+' zstyle ':vcs_info:git:*' unstagedstr '*' PROMPT='%F{#C9DE95}%n@%m%f %F{#F6D99D}%3~%f${vcs_info_msg_0_} ' export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced alias grep='grep --color=auto' alias ll='lsd -all' alias ls='lsd -all' alias l='lsd -l' alias v='nvim' alias vi='nvim' alias vim='nvim' alias c='clear' alias y='yazi' alias pdf='sioyek' alias wiki='wikiman' alias lg='lazygit' alias blue='bluetui' alias op='xdg-open' alias open='xdg-open' bindkey -M vicmd 'jj' vi-cmd-mode bindkey -M viins 'jj' vi-cmd-mode function zle-keymap-select { if [[ $KEYMAP == vicmd ]]; then echo -ne "\e[1 q" else echo -ne "\e[5 q" fi } zle -N zle-keymap-select function zle-line-init { echo -ne "\e[5 q" } zle -N zle-line-init # plugins ========================================== AUTOSUGGEST_DIR="${HOME}/.config/zsh/.zsh-autosuggestions" if [ ! -d "$AUTOSUGGEST_DIR" ]; then git clone https://github.com/zsh-users/zsh-autosuggestions "$AUTOSUGGEST_DIR" fi source "$AUTOSUGGEST_DIR/zsh-autosuggestions.zsh" ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' SYNTAX_HIGHLIGHTING="${HOME}/.config/zsh/.zsh-syntax-highlighting" if [ ! -d "$SYNTAX_HIGHLIGHTING" ]; then git clone https://github.com/zsh-users/zsh-syntax-highlighting "$SYNTAX_HIGHLIGHTING" fi source "$SYNTAX_HIGHLIGHTING/zsh-syntax-highlighting.zsh" # tmux shit if command -v tmux >/dev/null 2>&1; then if [ -z "$TMUX" ] && [ -n "$PS1" ] && [[ "$TERM" != "linux" ]]; then tmux attach -t default || tmux new -s default fi fi [[ -r "/usr/share/z/z.sh" ]] && source /usr/share/z/z.sh export QT_QPA_PLATFORM=wayland export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/cli/sf/bin:$HOME/.platformio/penv/bin:$HOME/scripts" . "$HOME/.local/bin/env" # _fzf_search() { # local base_dir=$1 # local type=$2 # local mode=$3 # # if [[ "$mode" == "ripgrep" ]]; then # local res=$(rg --column --line-number --no-heading --color=always --smart-case "" "$base_dir" | \ # fzf --ansi --delimiter : --preview 'bat --style=numbers --color=always --highlight-line {2} {1}') # [[ -n "$res" ]] && nvim $(echo $res | cut -d: -f1) +$(echo $res | cut -d: -f2) # else # local res=$(fd --type "$type" . "$base_dir" | fzf --preview '[[ -d {} ]] && eza -T {} || bat --color=always {}') # if [[ -n "$res" ]]; then # if [[ "$type" == "d" ]]; then # cd "$res" # else # nvim "$res" # fi # fi # fi # zle reset-prompt # } # # fzf_here_f() { _fzf_search . f } # fzf_here_d() { _fzf_search . d } # fzf_here_rg() { _fzf_search . "" ripgrep } # fzf_home_f() { _fzf_search ~ f } # fzf_home_d() { _fzf_search ~ d } # fzf_home_rg() { _fzf_search ~ "" ripgrep } # fzf_root_f() { _fzf_search / f } # fzf_root_g() { _fzf_search / d } # # zle -N fzf_here_f # zle -N fzf_here_d # zle -N fzf_here_rg # zle -N fzf_home_f # zle -N fzf_home_d # zle -N fzf_home_rg # zle -N fzf_root_f # zle -N fzf_root_g # # bindkey '^j' fzf_here_f # bindkey '^g' fzf_here_d # bindkey '^k' fzf_here_rg # # bindkey '^@j' fzf_home_f # bindkey '^@g' fzf_home_d # bindkey '^@k' fzf_home_rg # # bindkey '^[^@j' fzf_root_f # bindkey '^[^@g' fzf_root_g