Skip to content

Commit

Permalink
Initial modifications for personal use
Browse files Browse the repository at this point in the history
  • Loading branch information
mezuzza authored and Prasanth Somasundar committed Dec 21, 2017
1 parent 82d3265 commit 7cd7266
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 6 deletions.
56 changes: 56 additions & 0 deletions modules/prompt/functions/prompt_psomasundar_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
function prompt_wikimatze_precmd {
git-info
}

function prompt_wikimatze_setup {
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS
prompt_opts=(cr percent subst)

# Load required functions.
autoload -Uz add-zsh-hook

# Add hook for calling git-info before each command.
add-zsh-hook precmd prompt_wikimatze_precmd

# Use extended color pallete if available.
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
_prompt_mseri_colors=(
"%F{81}" # Turquoise
"%F{75}" # Pastel Cyan
"%F{215}" # Light Orange
"%F{166}" # Orange - not used
"%F{119}" # Pastel Limegreen
)
else
_prompt_mseri_colors=(
"%F{cyan}"
"%F{magenta}"
"%F{yellow}"
"%F{red}"
"%F{green}"
)
fi

# Set git-info parameters.
zstyle ':prezto:module:git:info' verbose 'yes'
zstyle ':prezto:module:git:info:ahead' format ' %%B%F{yellow}⬆%f%%b'
zstyle ':prezto:module:git:info:behind' format ' %%B%F{yellow}⬇%f%%b'
zstyle ':prezto:module:git:info:branch' format '%F{green}%b%f'
zstyle ':prezto:module:git:info:stashed' format ' %%B%F{cyan}✭%f%%b'

zstyle ':prezto:module:git:info:clean' format ' %F{green}✔%f'
zstyle ':prezto:module:git:info:dirty' format ' %F{red}✗%f'
zstyle ':prezto:module:git:info:untracked' format ' %%B%F{white}◼%f%%b'

zstyle ':prezto:module:git:info:keys' format \
'prompt' ' %F{green}(%f$(coalesce "%b" "%p" "%c")${git_info[rprompt]}%s%F{green})%f' \
'rprompt' '%A%B%S%C%D%U%u'

# Define prompts.
PROMPT="${_prompt_mseri_colors[3]}%n%f@${_prompt_mseri_colors[2]}%m%f ${_prompt_mseri_colors[5]}%~%f"'${(e)git_info[prompt]}'" » "
RPROMPT=''

}

prompt_wikimatze_setup "$@"
13 changes: 9 additions & 4 deletions runcoms/zpreztorc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#

# Set case-sensitivity for completion, history lookup, etc.
# zstyle ':prezto:*:*' case-sensitive 'yes'
zstyle ':prezto:*:*' case-sensitive 'yes'

# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
Expand All @@ -33,8 +33,10 @@ zstyle ':prezto:load' pmodule \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'git' \
'syntax-highlighting' \
'history-substring-search' \
'prompt'

#
Expand All @@ -57,7 +59,10 @@ zstyle ':prezto:load' pmodule \
#

# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' key-bindings 'emacs'
zstyle ':prezto:module:editor' key-bindings 'vi'
# Get history searches back
bindkey "^r" history-incremental-search-backward
bindkey "^s" history-incremental-search-forward

# Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes'
Expand Down Expand Up @@ -113,7 +118,7 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'sorin'
zstyle ':prezto:module:prompt' theme 'psomasundar'

# Set the working directory prompt display length.
# By default, it is set to 'short'. Set it to 'long' (without '~' expansion)
Expand Down
7 changes: 5 additions & 2 deletions runcoms/zprofile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ fi
# Editors
#

export EDITOR='nano'
export VISUAL='nano'
export EDITOR='vim'
export VISUAL='vim'
export PAGER='less'

#
Expand All @@ -44,6 +44,9 @@ typeset -gU cdpath fpath mailpath path
# Set the list of directories that Zsh searches for programs.
path=(
/usr/local/{bin,sbin}
/usr/local/heroku/bin
$HOME/.rvm/bin
$HOME/.cabal/bin
$path
)

Expand Down
5 changes: 5 additions & 0 deletions runcoms/zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@
if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
source "${ZDOTDIR:-$HOME}/.zprofile"
fi

if [[ $TERM == xterm-termite ]]; then
. /etc/profile.d/vte.sh
__vte_osc7
fi
10 changes: 10 additions & 0 deletions runcoms/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
fi

# Customize to your needs...
alias ls='ls --color=auto -h --group-directories-first'
alias sml='rlwrap sml'
alias ocaml='rlwrap ocaml'
alias ocamldebug='ocamldebug \`ocamlfind query -recursive -i-format batteries\` -I _build'
alias term='urxvt -cd `pwd` &'
alias grep='egrep --color=auto'

bindkey "^r" history-incremental-search-backward
bindkey "^s" history-incremental-search-forward
. /home/prasanth/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true

0 comments on commit 7cd7266

Please sign in to comment.