Skip to content

Instantly share code, notes, and snippets.

@zoranzaric
Created September 6, 2009 09:40
Show Gist options
  • Save zoranzaric/181734 to your computer and use it in GitHub Desktop.
Save zoranzaric/181734 to your computer and use it in GitHub Desktop.
Ein paar meiner dotfiles
colorscheme wombat
set number ruler
set cursorline
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ %{(&fenc==\"\"?&enc:&fenc)}\ %{((exists(\"+bomb\")\ &&\ &bomb)?\"B,\":\"\")}\ %=[POS=%04l,%04v]\ [LEN=%L]
set laststatus=2
"Map CTRL-B to NERDTree
noremap <C-B> :NERDTree<CR>
inoremap [' ['']<Left><Left>
inoremap [<Space> []<Left>
inoremap [ [
inoremap (<Space> ()<Left>
inoremap ( (
noremap () ()
inoremap {<Space> {}<Left>
inoremap {<CR> {<CR>}<Esc>O<Tab>
inoremap { {
noremap {} {}
inoremap /* /**/<Left><Left>
inoremap /*<Space> /*<Space><Space>*/<Left><Left><Left>
inoremap /*<CR> /*<CR>*/<Esc>O
inoremap <Leader>/* /*
inoremap <?php<CR> <?php<CR>?><Esc>0<Tab>
inoremap <?php <?php
noremap <?php<Space>?> <?php<Space>?>
set showmatch " Show matching brackets.
set mat=5 " Bracket blinking.
"""""""""""""""""""""""""""""""""
" line wrapping and movements
"""""""""""""""""""""""""""""""""
" toggle wrapping with \w
noremap <silent> <Leader>w :call ToggleWrap()<CR>
function ToggleWrap()
if &wrap
echo "Wrap OFF"
call UnwrapIt()
else
echo "Wrap ON"
call WrapIt()
endif
endfunction
function WrapIt()
set wrap linebreak
set virtualedit=
set breakat=\ ^I!@*-+;:,./? " when wrapping, break at these characters (requires linbreak, see above)
set showbreak=> " character to show that a line is wrapped
setlocal display+=lastline
noremap <buffer> <silent> k gk
noremap <buffer> <silent> j gj
noremap <buffer> <silent> <Up> gk
noremap <buffer> <silent> <Down> gj
noremap <buffer> <silent> <Home> g<Home>
noremap <buffer> <silent> <End> g<End>
inoremap <buffer> <silent> <Up> <C-o>gk
inoremap <buffer> <silent> <Down> <C-o>gj
inoremap <buffer> <silent> <Home> <C-o>g<Home>
inoremap <buffer> <silent> <End> <C-o>g<End>
endfunction
function UnwrapIt()
set nowrap
set virtualedit=all
silent! nunmap <buffer> j
silent! nunmap <buffer> k
silent! nunmap <buffer> <Up>
silent! nunmap <buffer> <Down>
silent! nunmap <buffer> <Home>
silent! nunmap <buffer> <End>
silent! iunmap <buffer> <Up>
silent! iunmap <buffer> <Down>
silent! iunmap <buffer> <Home>
silent! iunmap <buffer> <End>
endfunction
if &wrap
call WrapIt()
endif
imap jk <ESC>
imap kj <ESC>
##Completion und Gentoo-Completions einbinden
autoload -U compinit && compinit;
setopt no_beep auto_cd complete_in_word correct
bindkey -e
PATH=$PATH:~/lib/android/current/tools
#Farben
eval `dircolors`
COLORS=auto
#GIT Branch Funktionen
typeset -ga preexec_functions
typeset -ga precmd_functions
typeset -ga chpwd_functions
setopt prompt_subst
export __CURRENT_GIT_BRANCH=
parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
preexec_functions+='zsh_preexec_update_git_vars'
zsh_preexec_update_git_vars() {
case "$(history $HISTCMD)" in
*git*)
export __CURRENT_GIT_BRANCH="$(parse_git_branch)"
;;
esac
}
chpwd_functions+='zsh_chpwd_update_git_vars'
zsh_chpwd_update_git_vars() {
export __CURRENT_GIT_BRANCH="$(parse_git_branch)"
}
get_git_prompt_info() {
echo $__CURRENT_GIT_BRANCH
}
#PROMPT
autoload -U promptinit
promptinit
PROMPT="%B%F{green}%n@%m%k %B%F{blue}%1T %# %b%f%k"
#RPROMPT
RPROMPT='%B%F{yellow}$(get_git_prompt_info)%f%b%B%F{blue}%/%f%b'
setopt transient_rprompt
##Editor und Pager setzen
export EDITOR=vim
export PAGER=less
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
bindkey "^[[3~" delete-char
##History
bindkey ^r history-incremental-search-backward
bindkey ^f history-incremental-search-forward
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh/history
setopt append_history
setopt inc_append_history
setopt extended_history
setopt hist_find_no_dups
setopt hist_ignore_all_dups
setopt hist_reduce_blanks
setopt hist_ignore_space
setopt hist_no_store
setopt hist_no_functions
setopt no_hist_beep
setopt hist_save_no_dups
#Aliase
alias ls='ls --color=auto'
alias ll='ls --color=auto -la'
alias grep='grep --colour=auto'
alias extip="wget -qO - http://checkip.dyndns.org | sed 's/[a-zA-Z<>/ :]//g'"
alias rsc='ruby script/console'
alias rss='ruby script/server'
#Globale Aliase
alias -g G='| grep'
#Suffix-Aliase
alias -s php=vim
alias -s pdf=evince
#Hashes
hash -d l=/var/log
hash -d m=/var/vmail
hash -d v=/etc/apache2/vhosts.d
hash -d w=/var/www
#Funktionen
gitrailsinit(){
git init
echo "Adding basic stuff to .gitignore"
echo "tmp/*/*" >> .gitignore
echo "log/*.log" >> .gitignore
echo "config/database.yml" >> .gitignore
echo "db/*.sqlite3" >> .gitignore
git add .
git commit -m "initial import"
}
git_diff() {
git diff --no-ext-diff -w "$@" | vim -R -
}
#!/bin/zsh
if [[ ! -o interactive ]] ; then
# Shell is non-interactive. Be done now!
return
fi
#key setup
source .zkbd/$TERM-$VENDOR-$OSTYPE
[[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n ${key[Home]} ]] && bindkey -M vicmd "${key[Home]}" vi-beginning-of-line
[[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
[[ -n ${key[End]} ]] && bindkey -M vicmd "${key[End]}" vi-end-of-line
[[ -n ${key[Insert]} ]] && bindkey "${key[Insert]}" overwrite-mode
[[ -n ${key[Insert]} ]] && bindkey -M vicmd "${key[Insert]}" vi-insert
[[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
[[ -n ${key[Delete]} ]] && bindkey -M vicmd "${key[Delete]}" vi-delete-char
[[ -n ${key[PageUp]} ]] && bindkey "${key[PageUp]}" history-beginning-search-backward
[[ -n ${key[PageDown]} ]] && bindkey "${key[PageDown]}" history-beginning-search-forward
bindkey "^R" history-incremental-search-backward
bindkey "^F" history-incremental-search-forward
bindkey -M vicmd u undo
bindkey -M vicmd "^R" redo
export LANG=en_US.UTF-8
# MacPorts Installer addition on 2009-01-04_at_22:56:32: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
# MacPorts Installer addition on 2009-01-04_at_22:56:32: adding an appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
# Finished adapting your MANPATH environment variable for use with MacPorts.
if [[ -f ~/.dir_colors ]]; then
eval `gdircolors -b ~/.dir_colors`
else
eval `gdircolors -b /etc/DIR_COLORS`
fi
#export ZLS_COLORS=$LS_COLORS
case $TERM in
*xterm*|*rxvt)
export mytitle="\e]0;%n@%m: %~\a"
#precmd () {print -Pn $mytitle}
chpwd () {print -Pn $mytitle}
preexec () {print -Pn "\e]0;%n@%m: %~ - $2\a"}
print -Pn $mytitle
;;
esac
autoload -U promptinit
promptinit
prompt gentoo
autoload -U compinit
compinit
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:*' group-name ''
setopt autocd
setopt extendedglob
export EDITOR=/opt/local/bin/vim
alias vi=vim
alias find=gfind
alias ls="gls --color=auto"
alias grep="grep --color=auto"
import XMonad
import XMonad.Config.Gnome
import XMonad.Util.EZConfig
myManageHook :: [ManageHook]
myManageHook =
[ resource =? "Do" --> doIgnore ]
main = xmonad $ gnomeConfig
{ manageHook = manageHook gnomeConfig <+> composeAll myManageHook
, modMask = mod4Mask
, borderWidth = 2
}
`additionalKeysP`
[
("M-<Space>", spawn "gnome-do" )
, ("M-n", sendMessage NextLayout )
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment