Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
145 lines (106 sloc) 2.7 KB
# ZSH awesomeness lightning talk
# author: Jupp Mueller <jupp0r@gmail.com>
# find my .zshrc settings at https://github.com/jupp0r/oh-my-zsh
##########
# Basics #
##########
# show zsh version, should be > 4.3.9 for all the awesomeness shown here
zsh --version
# notice prompt
# jupp@lynx-omega ~ ᐅ _ < 15:26:14 12/20/11 >
# $PROMPT (we know that one) and additional $RPROMPT, hides when necessary
# https://github.com/robbyrussell/oh-my-zsh (Themes, Plugins, etc)
##############
# Completion #
##############
# completion revisited
# program must support --help
ls -<TAB><TAB><DOWN><ENTER>
# menu for everything
ls <TAB><TAB><ENTER><TAB>
# reads ssh .config
ssh -<TAB and play around>
# how was that host called again?
# yields lctp-gruppe1 lctp-gruppe2 lctp-gruppe3
ssh gruppe<TAB><TAB>
# completion is customizable and there are plugins for everything (manpages, git, svn, apt, ...)
# smart, too
brew install mpeg<TAB><TAB>
# you don't believe me?
kill <TAB>
# does not expand where undesirable
# bash would expand the ~ here, which would clobber our command
mv ~/Lib<TAB>
###########
# History #
###########
# all of this (also the rest can be undone)
# note the emacs bindings
<CMD + />
# a lot of this is really well explained in 'man zshexpn'
# command replacement
!?emac<TAB>
# we want to use another editor
joe !?emac?:*<TAB>
# ever had this problem
cp ~/Library/Application\ Support/Evom/libx264-evom_low.ffpreset !#$<TAB>
# even better
cp ~/Library/Application\ Support/Evom/libx264-evom_low.ffpreset !#$.bak<TAB>
# verify and show modification completion
ls !!:1:<TAB>h
# show command substitution
ps bux
# oops, wrong args
^bux^aux^<TAB>
# history is shared
# -> open new terminal
history
<CTRL-D>
##########
# Hashes #
##########
# define nice aliases
hash -d beleg=~/uni/grosser_beleg
# also shortens prompt
~beleg
#######
# Git #
#######
# enter some git repo
cd ~/Documents/github/nrtm-lightning-talks
# see that branch 'master' is clean
# create new branch (still clean)
git checkout -b new
# touch file
echo "test" > new-feature.txt
# see new symbol, x for dirty, star for untracked files
git status
# add file, using tab completion
git add <TAB>
# notice the + sign, commit now
git commit -m 'Started new feature'
# all clean, back to master
git checkout mas<TAB>
####################
# Variable Editing #
####################
# much nicer variable editing
vared PATH
#################################
# Interactive Shell Programming #
#################################
# for loops dont need ; or \
for i in `seq 1 10'
do
echo "${i}"
sleep 0.1
done
###########
# The End #
###########
# fun in the end
# to set up:
# autoload -U tetris
# zle -N tetris
# bindkey '^T' tetris
^T