From c73f89ee02aadabc1933b5bc6c1ddccf7b8813f8 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Mon, 23 Dec 2019 17:13:59 +0100 Subject: [PATCH] adding autosuggestions --- .config/zsh/.zshrc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index dbad601..792125c 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -3,6 +3,10 @@ stty -ixon setopt autocd autopushd \ +# Enable autosuggestions +source ~/gitrepos/pc/zsh-autosuggestions/zsh-autosuggestions.zsh +bindkey '^ ' autosuggest-accept + # Enable colors and change prompt autoload -U colors && colors autoload -Uz vcs_info @@ -11,7 +15,7 @@ precmd_functions+=( precmd_vcs_info ) zstyle ':vcs_info:*' enable git zstyle ':vcs_info:git*:*' get-revision true zstyle ':vcs_info:git*:*' check-for-changes true -zstyle ':vcs_info:git*' formats "(%s) %12.12i %c%u %b%m" +zstyle ':vcs_info:git*' formats "(%s) %c%u %b%m" zstyle ':vcs_info:git*' actionformats "(%s|%a) %12.12i %c%u %b%m" setopt prompt_subst # Show remote ref name and number of commits ahead-of or behind @@ -25,12 +29,12 @@ function +vi-git-st() { # for git prior to 1.7 # ahead=$(git rev-list origin/${hook_com[branch]}..HEAD | wc -l) ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) - (( $ahead )) && gitstatus+=( "${c3}+${ahead}${c2}" ) + (( $ahead )) && gitstatus+=( " ${c3}+${ahead}${c2}" ) # for git prior to 1.7 # behind=$(git rev-list HEAD..origin/${hook_com[branch]} | wc -l) behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) (( $behind )) && gitstatus+=( "${c4}-${behind}${c2}" ) - hook_com[branch]="${hook_com[branch]} [${remote} ${(j:/:)gitstatus}]" + hook_com[branch]="${hook_com[branch]} [${remote}${(j:/:)gitstatus}]" fi } # Show count of stashed changes @@ -42,8 +46,8 @@ function +vi-git-stash() { fi } zstyle ':vcs_info:git*+set-message:*' hooks git-st git-stash -PROMPT="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " -RPROMPT='%B%{$fg[magenta]%}$vcs_info_msg_0_%{$reset_color%}' +PROMPT='%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b ' +RPROMPT='%B%{$fg[magenta]%}$vcs_info_msg_0_%{$reset_color%}%b' # History in cache directory HISTSIZE=10000