Skip to content

Commit

Permalink
Fix zsh RPROMPT
Browse files Browse the repository at this point in the history
  • Loading branch information
seiji committed Apr 19, 2015
1 parent 973fd40 commit 8013b1d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 81 deletions.
5 changes: 4 additions & 1 deletion git/.gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

[alias]

br = branch
st = status
# Reset
rsh = reset --soft HEAD
rhh = reset --hard HEAD
Expand All @@ -44,6 +46,7 @@

log4 = log --graph --pretty='format:%C(yellow)%h%Cblue%d%Creset %s %C(black bold)%an, %ar%Creset'

sb = show-branch --all --color
sgraph = !"git log --oneline --graph"

graph = !"git log1"
Expand All @@ -55,7 +58,7 @@

[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
Expand Down
49 changes: 0 additions & 49 deletions usr/local/bin/git-cwd-info.rb

This file was deleted.

36 changes: 16 additions & 20 deletions vim/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ endif
set rtp+=~/.vim/plugged/vim-plug
call plug#begin('~/.vim/plugged')
" Other plugins
Plug 'Shougo/vimproc', {
\ 'build' : {
\ 'windows' : 'make -f make_mingw32.mak',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'unix' : 'make -f make_unix.mak',
\ },
\ }

Plug 'Shougo/vimproc'
Plug 'justinmk/vim-dirvish'
Plug 'majutsushi/tagbar'
Plug 'kien/ctrlp.vim'
Expand All @@ -32,13 +24,13 @@ Plug 'tomtom/tcomment_vim'
Plug 'vim-scripts/surround.vim'
Plug 'thinca/vim-quickrun'
" " language
" Plug 'fatih/vim-go'
Plug 'fatih/vim-go'
" Plug 'jcfaria/Vim-R-plugin'
"
"
" """"""""
Plug 'tpope/vim-fugitive'
" " Plugin 'git://git.wincent.com/command-t.git'
" Plugin 'git://git.wincent.com/command-t.git'

call plug#end()

Expand Down Expand Up @@ -106,12 +98,6 @@ set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P

syntax enable

augroup my_dirvish_events
au!
" always show hidden files
au User DirvishEnter let b:dirvish.showhidden = 1
augroup END

" imap <expr> <CR> pumvisible() ? "\<c-y>" : "<Plug>delimitMateCR"
let mapleader = ","
let g:mapleader = ","
Expand Down Expand Up @@ -183,6 +169,7 @@ augroup filetypedetect
au BufNewFile,BufRead .nginx.conf*,nginx.conf* setf nginx
augroup END

autocmd FileType yaml setl expandtab tabstop=4 shiftwidth=4 softtabstop=0
" Golang
au BufNewFile,BufRead *.go setlocal noet ts=4 sw=4 sts=4
autocmd BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
Expand Down Expand Up @@ -224,6 +211,12 @@ set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
com! JSONFormat %!python -m json.tool

"===== Plugin
" dirvish
augroup my_dirvish_events
au!
" always show hidden files
au User DirvishEnter let b:dirvish.showhidden = 1
augroup END

" ctrlp
let g:ctrlp_cmd = 'CtrlPMRU'
Expand All @@ -249,6 +242,8 @@ let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|vagrant)$',
\ 'file': '\v\.(exe|so|dll)$'
\}
let g:ctrlp_reuse_window = 1
" let g:ctrlp_reuse_window = 'startify'

" YouCompleteMe
let g:ycm_autoclose_preview_window_after_completion = 1
Expand Down Expand Up @@ -351,7 +346,7 @@ inoremap <tab> <c-r>=InsertTabWrapper()<cr>
""let g:quickrun_config={'*': {'split': 'vertical'}}
autocmd BufWinEnter,BufNewFile *_spec.rb set filetype=ruby.rspec
autocmd BufWinEnter,BufNewFile *_test.go set filetype=go.testing
let g:quickrun_config={
let g:quickrun_config = {
\ "_" : {
\ "outputter/buffer/split" : ":botright 8sp",
\ "outputter/buffer/close_on_empty" : 1,
Expand All @@ -361,9 +356,9 @@ let g:quickrun_config={
\}
let g:quickrun_config['ruby.rspec'] = {
\ 'type': 'ruby.rspec',
\ 'cmdopt': '-cfd',
\ 'command': 'rspec',
\ 'exec': 'bundle exec %c',
\ 'cmdopt': '-cfd'
\ 'exec': 'bundle exec %c %o',
\ }
let g:quickrun_config.rspecl = {
\ 'type': 'ruby.rspec',
Expand All @@ -380,6 +375,7 @@ let g:quickrun_config['go.testing'] = {
\ 'command': 'go',
\ 'exec': '%c test -v',
\ }

let g:quickrun_config.swift = {
\ 'type': 'swift',
\ 'cmdopt': "-sdk `xcrun --show-sdk-path --sdk macosx`",
Expand Down
23 changes: 12 additions & 11 deletions zsh/.zsh/prompt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
# that the point?
#

function current_rbenv {
[ -f .rbenv-version ] && echo " $(rbenv version | awk '{print $1}')"
}

function current_venv {
[ $VIRTUAL_ENV ] && echo ' '`basename $VIRTUAL_ENV`
}

local emoticon="%(?,%{$fg[green]%}%{$reset_color%},%{$fg[red]%}❨╯°□°❩╯︵ ┻━┻ %{$reset_color%}:: )"

PROMPT='%{$fg_bold[yellow]%}%c %{$fg_bold[blue]%}$%{$reset_color%} '
PROMPT2='\'
RPROMPT='${emoticon}%{$fg_bold[yellow]%}%~%{$reset_color%}%{$fg_bold[green]%}$(current_venv)%{$fg_bold[red]%}$(current_rbenv)%{$reset_color%}$(git-cwd-info.rb)'

RPROMPT="%{${fg_bold[yellow]}%}[%~]%{${reset_color}%}"

autoload -Uz vcs_info
setopt prompt_subst
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "%F{yellow}!"
zstyle ':vcs_info:git:*' unstagedstr "%F{red}+"
zstyle ':vcs_info:*' formats "%F{green}%c%u[%b]%f"
zstyle ':vcs_info:*' actionformats '[%b|%a]'
precmd () { vcs_info }
RPROMPT=$RPROMPT'${vcs_info_msg_0_}'

0 comments on commit 8013b1d

Please sign in to comment.