Skip to content

Commit

Permalink
Added Ctrl-x,Ctrl-l to zsh to insert output of last command
Browse files Browse the repository at this point in the history
  • Loading branch information
skwp committed Apr 20, 2012
1 parent 0ebd069 commit 2ad786a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ mnemonic aliases. Please feel free to edit them:

* Vim mode
* Bash style ctrl-R for reverse history finder
* Ctrl-x,Ctrl-l to insert output of last command
* Fuzzy matching - if you mistype a directory name, tab completion will fix it

### How To Customize ZSH
Expand Down
1 change: 1 addition & 0 deletions zsh/aliases.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ alias gz='tar -zcvf'

# Ruby
alias c='script/console --irb=pry'
alias ts='thin start'
alias ms='mongrel_rails start'

# Vim/ctags "mctags = make ctags", using the ruby specific version
Expand Down
7 changes: 7 additions & 0 deletions zsh/last-command.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Use Ctrl-x,Ctrl-l to get the output of the last command
zmodload -i zsh/parameter
insert-last-command-output() {
LBUFFER+="$(eval $history[$((HISTCMD-1))])"
}
zle -N insert-last-command-output
bindkey "^X^L" insert-last-command-output

0 comments on commit 2ad786a

Please sign in to comment.