From 8c3757f789466c06cd6ab816a10e8f5b040acf12 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Tue, 1 May 2012 16:28:44 -0500 Subject: [PATCH] Added new vim colorscheme, updated prompt Added smyck colorscheme, which I foud on reddit today. Also, copied the prompt from zholman's dotfiles --- vim/vim.symlink/colors/smyck.vim | 94 ++++++++++++++++++++++++++++++++ vim/vimrc.symlink | 5 +- zsh/config.zsh | 3 +- zsh/prompt.zsh | 83 ++++++++++++++++++++++++++++ zsh/window.zsh | 19 +++++++ 5 files changed, 202 insertions(+), 2 deletions(-) create mode 100755 vim/vim.symlink/colors/smyck.vim create mode 100644 zsh/prompt.zsh create mode 100644 zsh/window.zsh diff --git a/vim/vim.symlink/colors/smyck.vim b/vim/vim.symlink/colors/smyck.vim new file mode 100755 index 0000000..2a23734 --- /dev/null +++ b/vim/vim.symlink/colors/smyck.vim @@ -0,0 +1,94 @@ +" ---------------------------------------------------------------------------- +" Vim color file +" Maintainer: John-Paul Bader +" Last Change: 2012 April +" License: Beer Ware +" ---------------------------------------------------------------------------- + +let g:colors_name = "smyck" + +highlight clear Normal +set background=dark +set linespace=2 + +" Syntaxeinstellungen zuruecksetzen, wenn Syntax Highlighting aktiviert ist +if exists("syntax_on") + syntax reset +endif + +hi Normal cterm=none ctermbg=none ctermfg=15 gui=none guibg=#242424 guifg=#F7F7F7 +hi LineNr cterm=none ctermbg=none ctermfg=8 gui=none guibg=#242424 guifg=#8F8F8F +hi StatusLine cterm=none ctermbg=8 ctermfg=15 gui=none guibg=#5D5D5D guifg=#FBFBFB +hi StatusLineNC cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#5D5D5D guifg=#FBFBFB +hi Search cterm=none ctermbg=6 ctermfg=15 gui=none guibg=#2EB5C1 guifg=#F7F7F7 +hi IncSearch cterm=none ctermbg=3 ctermfg=8 gui=none guibg=#F6DC69 guifg=#8F8F8F +hi ColumnMargin cterm=none ctermbg=0 gui=none guibg=#000000 +hi Error cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi ErrorMsg cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi Folded cterm=none ctermbg=8 ctermfg=2 gui=none guibg=#8F8F8F guifg=#C4E858 +hi FoldColumn cterm=none ctermbg=8 ctermfg=2 gui=none guibg=#8F8F8F guifg=#C4E858 +hi NonText cterm=bold ctermbg=none ctermfg=8 gui=bold guifg=#8F8F8F +hi ModeMsg cterm=bold ctermbg=none ctermfg=10 gui=none +hi Pmenu cterm=none ctermbg=8 ctermfg=15 gui=none guibg=#8F8F8F guifg=#F7F7F7 +hi PmenuSel cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi PmenuSbar cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi SpellBad cterm=none ctermbg=1 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellCap cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellRare cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi SpellLocal cterm=none ctermbg=4 ctermfg=15 gui=none guifg=#F7F7F7 +hi Visual cterm=none ctermbg=15 ctermfg=8 gui=none guibg=#F7F7F7 guifg=#8F8F8F +hi Directory cterm=none ctermbg=none ctermfg=4 gui=none guibg=#242424 guifg=#88CCE7 +hi SpecialKey cterm=none ctermbg=none ctermfg=8 gui=none guifg=#8F8F8F +hi DiffAdd cterm=bold ctermbg=2 ctermfg=15 +hi DiffChange cterm=bold ctermbg=4 ctermfg=15 +hi DiffDelete cterm=bold ctermbg=1 ctermfg=15 +hi DiffText cterm=bold ctermbg=3 ctermfg=8 +hi MatchParen cterm=none ctermbg=6 ctermfg=15 gui=none guibg=#2EB5C1 guifg=#F7F7F7 +hi CursorLine cterm=none ctermbg=238 ctermfg=none gui=none guibg=#424242 +hi Title cterm=none ctermbg=none ctermfg=4 gui=none guifg=#88CCE7 + +" ---------------------------------------------------------------------------- +" Syntax Highlighting +" ---------------------------------------------------------------------------- +hi Keyword cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Comment cterm=none ctermbg=none ctermfg=8 gui=none guifg=#8F8F8F +hi Delimiter cterm=none ctermbg=none ctermfg=15 gui=none guifg=#F7F7F7 +hi Identifier cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi Structure cterm=none ctermbg=none ctermfg=12 gui=none guifg=#9DEEF2 +hi Ignore cterm=none ctermbg=none ctermfg=8 gui=none guifg=bg +hi Constant cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi PreProc cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Type cterm=none ctermbg=none ctermfg=12 gui=none guifg=#96D9F1 +hi Statement cterm=none ctermbg=none ctermfg=10 gui=none guifg=#D1FA71 +hi Special cterm=none ctermbg=none ctermfg=6 gui=none guifg=#d7d7d7 +hi String cterm=none ctermbg=none ctermfg=3 gui=none guifg=#F6DC69 +hi Number cterm=none ctermbg=none ctermfg=3 gui=none guifg=#F6DC69 +hi Underlined cterm=underline gui=underline +hi Symbol cterm=none ctermbg=none ctermfg=9 gui=none guifg=#FAB1AB +hi Method cterm=none ctermbg=none ctermfg=15 gui=none guifg=#F7F7F7 +hi Interpolation cterm=none ctermbg=none ctermfg=6 gui=none guifg=#2EB5C1 + +" Erlang +hi link erlangAtom Keyword +hi link erlangBitType Keyword + +hi link rubyBeginend Keyword +hi link rubyClass Keyword +hi link rubyModule Keyword +hi link rubyKeyword Keyword +hi link rubyOperator Method +hi link rubyIdentifier Keyword +hi link rubyClassVariable Symbol +hi link rubyInstanceVariable Constant +hi link rubyGlobalVariable Constant +hi link rubyClassVariable Method +hi link rubyConstant Constant +hi link rubySymbol Symbol +hi link rubyFunction Constant +hi link rubyControl Keyword +hi link rubyConditional Keyword +hi link rubyInterpolation Interpolation +hi link rubyInterpolationDelimiter Interpolation +hi link rubyRailsMethod Method + + diff --git a/vim/vimrc.symlink b/vim/vimrc.symlink index fa0f9fc..b054050 100644 --- a/vim/vimrc.symlink +++ b/vim/vimrc.symlink @@ -112,7 +112,7 @@ set tm=500 syntax on set background=dark -colorscheme jellybeans +"colorscheme jellybeans "colorscheme xorium "colorscheme molokai "colorscheme ir_black @@ -121,6 +121,7 @@ colorscheme jellybeans "colorscheme vividchalk "colorscheme desert "colorscheme solarized +colorscheme smyck set number " show line numbers @@ -175,6 +176,8 @@ nnoremap K :q " remove extra whitespace nmap :%s/\s\+$ +nmap , :w + " set paste toggle set pastetoggle= diff --git a/zsh/config.zsh b/zsh/config.zsh index d35b58d..cefc890 100644 --- a/zsh/config.zsh +++ b/zsh/config.zsh @@ -16,7 +16,8 @@ setopt APPEND_HISTORY setopt COMPLETE_ALIASES -export PS1='%3~ ☠ ' +#export PS1='%3~ ☠ ' +#export PS1='%3~$(git_info_for_prompt) ☠ ' # make terminal command navigation sane again bindkey '^[^[[D' backward-word diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh new file mode 100644 index 0000000..1a81feb --- /dev/null +++ b/zsh/prompt.zsh @@ -0,0 +1,83 @@ +autoload colors && colors +# cheers, @ehrenmurdick +# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh + +git_branch() { + echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'}) +} + +git_dirty() { + st=$(/usr/bin/git status 2>/dev/null | tail -n 1) + if [[ $st == "" ]] + then + echo "" + else + if [[ $st == "nothing to commit (working directory clean)" ]] + then + echo "on %{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}" + else + echo "on %{$fg_bold[red]%}$(git_prompt_info)%{$reset_color%}" + fi + fi +} + +git_prompt_info () { + ref=$(/usr/bin/git symbolic-ref HEAD 2>/dev/null) || return +# echo "(%{\e[0;33m%}${ref#refs/heads/}%{\e[0m%})" + echo "${ref#refs/heads/}" +} + +unpushed () { + /usr/bin/git cherry -v @{upstream} 2>/dev/null +} + +need_push () { + if [[ $(unpushed) == "" ]] + then + echo " " + else + echo " with %{$fg_bold[magenta]%}unpushed%{$reset_color%} " + fi +} + +rb_prompt(){ + if $(which rbenv &> /dev/null) + then + echo "%{$fg_bold[yellow]%}$(rbenv version | awk '{print $1}')%{$reset_color%}" + else + echo "" + fi +} + +# This keeps the number of todos always available the right hand side of my +# command line. I filter it to only count those tagged as "+next", so it's more +# of a motivation to clear out the list. +todo(){ + if $(which todo.sh &> /dev/null) + then + num=$(echo $(todo.sh ls +next | wc -l)) + let todos=num-2 + if [ $todos != 0 ] + then + echo "$todos" + else + echo "" + fi + else + echo "" + fi +} + +directory_name(){ + echo "%{$fg_bold[cyan]%}%1/%\/%{$reset_color%}" +} + +export PROMPT=$'\n$(rb_prompt) in $(directory_name) $(git_dirty)$(need_push)\n› ' +set_prompt () { + export RPROMPT="%{$fg_bold[cyan]%}$(todo)%{$reset_color%}" +} + +precmd() { + title "zsh" "%m" "%55<...<%~" + set_prompt +} diff --git a/zsh/window.zsh b/zsh/window.zsh new file mode 100644 index 0000000..805cb92 --- /dev/null +++ b/zsh/window.zsh @@ -0,0 +1,19 @@ +# From http://dotfiles.org/~_why/.zshrc +# Sets the window title nicely no matter where you are +function title() { + # escape '%' chars in $1, make nonprintables visible + a=${(V)1//\%/\%\%} + + # Truncate command, and join lines. + a=$(print -Pn "%40>...>$a" | tr -d "\n") + + case $TERM in + screen) + print -Pn "\ek$a:$3\e\\" # screen title (in ^A") + ;; + xterm*|rxvt) + print -Pn "\e]2;$2\a" # plain xterm title ($3 for pwd) + ;; + esac +} +