dotfiles

config files and scripts
git clone git://git.hanetzok.net/dotfiles
Log | Files | Refs | README

.zshrc (2201B)


      1 export PATH="$PATH:$HOME/.dotnet/tools"
      2 # Enable colors and change prompt:
      3 autoload -U colors && colors	# Load colors
      4 PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
      5 stty stop undef		# Disable ctrl-s to freeze terminal.
      6 setopt interactive_comments
      7 
      8 # History in cache directory:
      9 HISTSIZE=10000000
     10 SAVEHIST=10000000
     11 HISTFILE="$HOME/.cache/zsh/history"
     12 setopt inc_append_history
     13 
     14 # Basic auto/tab complete:
     15 autoload -U compinit
     16 zstyle ':completion:*' menu select
     17 zmodload zsh/complist
     18 compinit
     19 _comp_options+=(globdots)		# Include hidden files.
     20 
     21 # vi mode
     22 bindkey -v
     23 export KEYTIMEOUT=1
     24 
     25 # Use vim keys in tab complete menu:
     26 bindkey -M menuselect 'h' vi-backward-char
     27 bindkey -M menuselect 'k' vi-up-line-or-history
     28 bindkey -M menuselect 'l' vi-forward-char
     29 bindkey -M menuselect 'j' vi-down-line-or-history
     30 bindkey -v '^?' backward-delete-char
     31 
     32 # Change cursor shape for different vi modes.
     33 function zle-keymap-select () {
     34     case $KEYMAP in
     35         vicmd) echo -ne '\e[1 q';;      # block
     36         viins|main) echo -ne '\e[5 q';; # beam
     37     esac
     38 }
     39 zle -N zle-keymap-select
     40 zle-line-init() {
     41     zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
     42     echo -ne "\e[5 q"
     43 }
     44 zle -N zle-line-init
     45 echo -ne '\e[5 q' # Use beam shape cursor on startup.
     46 preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
     47 
     48 # Edit line in vim with ctrl-e:
     49 autoload edit-command-line; zle -N edit-command-line
     50 bindkey '^e' edit-command-line
     51 bindkey -M vicmd '^[[P' vi-delete-char
     52 bindkey -M vicmd '^e' edit-command-line
     53 bindkey -M visual '^[[P' vi-delete
     54 
     55 # Load syntax highlighting; should be last.
     56 source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null
     57 
     58 # Aliases
     59 alias \
     60 	p='sudo pacman' \
     61 	dcd='sudo docker compose down' \
     62 	dcud='sudo docker compose up -d' \
     63 	dcp='sudo docker compose pull' \
     64 	dcl='sudo docker compose logs -n 100 -f' \
     65 	v='nvim'
     66 
     67 alias \
     68 	ls="ls -hN --color=auto --group-directories-first" \
     69 	grep="grep --color=auto" \
     70 	diff="diff --color=auto" \
     71 	ccat="highlight --out-format=ansi" \
     72 	ip="ip -color=auto"
     73