More zsh config and setting default shell in tmux

This commit is contained in:
Jesper Fussing Mørk 2019-11-05 14:42:39 +01:00
parent a8d69f6699
commit de326045cb
2 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,4 @@
set-option -g default-shell /bin/zsh
set -g default-terminal 'screen-256color' set -g default-terminal 'screen-256color'
set-option -sa terminal-overrides ',xterm-termite:RGB:smcup@:rmcup@' set-option -sa terminal-overrides ',xterm-termite:RGB:smcup@:rmcup@'
set-option -sg escape-time 10 set-option -sg escape-time 10

View File

@ -83,7 +83,37 @@ source $ZSH/oh-my-zsh.sh
# export LANG=en_US.UTF-8 # export LANG=en_US.UTF-8
# PROMPT # PROMPT
RPS1='$(vi_mode_prompt_info) '$RPS1 autoload -U colors && colors
# Remove mode switching delay.
KEYTIMEOUT=5
# Change cursor shape for different vi modes.
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
PS1="%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%d%{$reset_color%}"$'\n'"%{$bg[cyan]$fg_bold[black]%} NORMAL %{$reset_color%}  "
echo -ne '\e[1 q'
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
[[ $1 = 'beam' ]]; then
PS1="%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%d%{$reset_color%}"$'\n'"%{$bg[green]$fg_bold[black]%} INSERT %{$reset_color%}  "
echo -ne '\e[5 q'
fi
zle reset-prompt
}
zle -N zle-keymap-select
# Use beam shape cursor on startup.
PS1="%{$fg_bold[green]%}%n@%m%{$reset_color%} %{$fg_bold[blue]%}%d%{$reset_color%}"$'\n'"%{$bg[green]$fg_bold[black]%} INSERT %{$reset_color%}  "
echo -ne '\e[5 q'
# Use beam shape cursor for each new prompt.
preexec() {
echo -ne '\e[5 q'
}
# Preferred editor for local and remote sessions # Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then if [[ -n $SSH_CONNECTION ]]; then