Prompt work...mostly, notes
Hack together a prompt that does most of what we did before but is a bit simpler. Throw it all into precmd because why not....
This commit is contained in:
parent
db3bfa4036
commit
f2676dabcf
7 changed files with 53 additions and 41 deletions
9
Makefile
9
Makefile
|
@ -5,13 +5,12 @@ symlinks = $(shell ls $(excludes) `pwd`)
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
install: repos submodules $(symlinks)
|
install: repos $(symlinks)
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/vundle
|
if test ! -d ~/.vim/bundle/vundle ; then \
|
||||||
|
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/vundle ; \
|
||||||
submodules:
|
fi
|
||||||
git submodule update --init --recursive
|
|
||||||
|
|
||||||
$(symlinks):
|
$(symlinks):
|
||||||
test -e `pwd`/$@ \
|
test -e `pwd`/$@ \
|
||||||
|
|
1
aliases
1
aliases
|
@ -70,6 +70,7 @@ alias jbt="./gradlew test"
|
||||||
alias l="ls"
|
alias l="ls"
|
||||||
alias ll="ls -lv --human-readable --color=auto"
|
alias ll="ls -lv --human-readable --color=auto"
|
||||||
alias lp="librarian-puppet"
|
alias lp="librarian-puppet"
|
||||||
|
alias ls="ls --color=auto"
|
||||||
alias m="more"
|
alias m="more"
|
||||||
alias md="cd ~/dotfiles > /dev/null 2>&1; make; cd -1 > /dev/null 2>&1"
|
alias md="cd ~/dotfiles > /dev/null 2>&1; make; cd -1 > /dev/null 2>&1"
|
||||||
alias mf="mkdir"
|
alias mf="mkdir"
|
||||||
|
|
|
@ -65,4 +65,4 @@ set-option -g status-right '%d %b %Y @ %k:%M'
|
||||||
|
|
||||||
# because the new tmux is inadequate
|
# because the new tmux is inadequate
|
||||||
source-file ~/.tmux.1-8.conf # always source the 1.8 file
|
source-file ~/.tmux.1-8.conf # always source the 1.8 file
|
||||||
if-shell 'tmux -V | grep -q "1.9\|2.0"' "source-file ~/.tmux.1-9.conf"
|
if-shell 'tmux -V | grep -q "1.9\|2.0\|2.1"' "source-file ~/.tmux.1-9.conf"
|
||||||
|
|
20
zpreztorc
20
zpreztorc
|
@ -1,20 +0,0 @@
|
||||||
fpath=(
|
|
||||||
${HOME}/.zsh/modules/prompt/functions
|
|
||||||
${fpath}
|
|
||||||
)
|
|
||||||
|
|
||||||
zstyle ':prezto:*:*' color 'yes'
|
|
||||||
|
|
||||||
zstyle ':prezto:load' pmodule \
|
|
||||||
'environment' \
|
|
||||||
'terminal' \
|
|
||||||
'editor' \
|
|
||||||
'history' \
|
|
||||||
'directory' \
|
|
||||||
'spectrum' \
|
|
||||||
'utility' \
|
|
||||||
'completion' \
|
|
||||||
'ruby' \
|
|
||||||
'prompt'
|
|
||||||
|
|
||||||
zstyle ':prezto:module:prompt' theme 'atomaka'
|
|
35
zsh/new-prompt
Normal file
35
zsh/new-prompt
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
local current_time="[%B%D{%I:%M:%S}%b]"
|
||||||
|
local current_dir='%B%F{blue}%~%f%b'
|
||||||
|
|
||||||
|
# user
|
||||||
|
local user="%F{green}%n%f"
|
||||||
|
|
||||||
|
# host
|
||||||
|
local host=""
|
||||||
|
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then
|
||||||
|
host='%F{yellow}%M%f' #SSH
|
||||||
|
else
|
||||||
|
host='%F{green}%M%f' # no SSH
|
||||||
|
fi
|
||||||
|
|
||||||
|
# vcs
|
||||||
|
precmd() {
|
||||||
|
setopt promptsubst
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
|
||||||
|
zstyle ':vcs_info:*' enable git hg svn
|
||||||
|
zstyle ':vcs_info:*:prompt:*' nvcsformats ""
|
||||||
|
zstyle ':vcs_info:*:prompt:*' check-for-changes true
|
||||||
|
zstyle ':vcs_info:*:prompt:*' unstagedstr "*"
|
||||||
|
zstyle ':vcs_info:*:prompt:*' stagedstr "*"
|
||||||
|
zstyle ':vcs_info:*:prompt:*' formats "[%F{yellow}%b%f%u%c]"
|
||||||
|
vcs_info 'prompt'
|
||||||
|
}
|
||||||
|
local vcs='${vcs_info_msg_0_}'
|
||||||
|
|
||||||
|
# prompt
|
||||||
|
local return_code="%(?..%?)"
|
||||||
|
local prompt="%(?.%F{green}->.%F{red}-%B${return_code}%b%F{red}->%{%})%f"
|
||||||
|
|
||||||
|
PROMPT="${current_time} ${user}@${host} ${current_dir} ${vcs}
|
||||||
|
|$prompt "
|
9
zshenv
Normal file
9
zshenv
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
PERSONAL_BIN_PATH="$HOME/bin"
|
||||||
|
RBENV_PATH="$HOME/.rbenv/bin"
|
||||||
|
GNU_TOOLS_PATH="/usr/local/opt/coreutils/libexec/gnubin"
|
||||||
|
GNU_TOOLS_MAN_PATH="/usr/local/opt/coreutils/libexec/gnuman"
|
||||||
|
|
||||||
|
[[ -d "$PERSONAL_BIN_PATH" ]] && PATH="$PERSONAL_BIN_PATH:$PATH"
|
||||||
|
[[ -d "$RBENV_PATH" ]] && PATH="$RBENV_PATH:$PATH"
|
||||||
|
[[ -d "$GNU_TOOLS_PATH" ]] && PATH="$GNU_TOOLS_PATH:$PATH"
|
||||||
|
[[ -d "$GNU_TOOLS_MAN_PATH" ]] && MANPATH="$GNU_TOOLS_MAN_PATH:$MANPATH"
|
18
zshrc
18
zshrc
|
@ -1,27 +1,15 @@
|
||||||
PATH="$HOME/bin:$PATH"
|
|
||||||
|
|
||||||
if [[ "$OSTYPE" == darwin* ]]; then
|
if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
|
|
||||||
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
|
|
||||||
NVM_DIR="/usr/local/opt/nvm"
|
NVM_DIR="/usr/local/opt/nvm"
|
||||||
else
|
else
|
||||||
NVM_DIR="/home/atomaka/.nvm"
|
NVM_DIR="/home/atomaka/.nvm"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add path to newer bins on cse servers (github/rmblair)
|
[[ -d "$GNU_TOOLS_PATH" ]] && PATH="$GNU_TOOLS_PATH:$PATH"
|
||||||
if test -d /soft/linux/pkg/bin ; then
|
[[ -d "$GNU_TOOLS_MAN_PATH" ]] && MANPATH="$GNU_TOOLS_MAN_PATH:$MANPATH"
|
||||||
export PATH=/soft/linux/pkg/bin:${PATH};
|
|
||||||
export PATH=/soft/lus/linux/vim/7.4-$(uname -m)/bin:$PATH;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# clean up duplicate paths
|
# clean up duplicate paths
|
||||||
typeset -U PATH
|
typeset -U PATH
|
||||||
|
|
||||||
# List directory when changing (github/r00k)
|
|
||||||
chpwd() {
|
|
||||||
ls -lvh --color=auto
|
|
||||||
}
|
|
||||||
|
|
||||||
# Larger history
|
# Larger history
|
||||||
HISTSIZE=20000
|
HISTSIZE=20000
|
||||||
HISTFILE=~/.zsh_history
|
HISTFILE=~/.zsh_history
|
||||||
|
@ -38,7 +26,7 @@ stty stop undef
|
||||||
# Aliases/Functions files
|
# Aliases/Functions files
|
||||||
source $HOME/.aliases
|
source $HOME/.aliases
|
||||||
source $HOME/.functions
|
source $HOME/.functions
|
||||||
source $HOME/.zsh/prompt
|
source $HOME/.zsh/new-prompt
|
||||||
|
|
||||||
if [[ "$OSTYPE" == darwin* ]]; then
|
if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
source $HOME/.aliases-mac
|
source $HOME/.aliases-mac
|
||||||
|
|
Loading…
Reference in a new issue