public
Description: cheat sheet repository for chit
Homepage:
Clone URL: git://github.com/robin/chitsheet.git
robin (author)
Wed Jul 09 03:11:05 -0700 2008
commit  4d546432dd5b473dbbb5883f19cacc71b4599483
tree    d2371207000e34eb8ae02337f9e5c2f03ffdd22d
parent  8b2c5772e458466c24b4c2360fcf24e8b3b72468
chitsheet / zsh / bang.yml
100644 26 lines (21 sloc) 0.859 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
zsh::bang: |-
  1 % ls /user/dir/file.c
  2 % which firefox
  3 % make
  4 % ./foo -f foo.conf
  5 % vi foo.c bar.c
  
  Getting stuff from the previous commands:
  1 Previous command: % !! -->% vi foo.c bar.c
  2 Previous command: % !-1 -->% vi foo.c bar.c
  3 Second previous command: % !-2 -->% ./foo -f foo.conf
  
  Getting individual arguments:
  1 Last arg : % svn ci !$ -->% svn ci bar.c
  2 All args : % svn ci !* -->% svn ci foo.c bar.c
  3 First arg: % svn ci !!:1 -->% svn ci foo.c
  
  Modifying commandlines
  1 Head: % !ls:$:h -->% /user/dir
  2 Tail: % !ls:$:t -->% file.c
  3 Rm Suffix: % !ls:$:r -->% /user/dir/file
  4 Substitute: % !ls:$:s/user/dude/ -->% /dude/dir/file.c
  
  Note: a bang expression can be expanded with the tab key