Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Automatically run ls on blank line for faster navigation
- X-seq: zsh-users 16933
- From: Mitchell Burdette <mitchell.burdette@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Automatically run ls on blank line for faster navigation
- Date: Thu, 29 Mar 2012 15:55:05 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Naat4n6QfIYhPz1YAHiup50m6FBNs3pzUkvm7pVL2ks=; b=aXMbBQyh8ncM8DpZGPgM4KoltGQu+6VbJK+RbL2f2+ljEXDW7P5I3y6Ol0SSI7dlns 9EhZrExUmIa9+nHMYoxk55BvNeGkVD1HAFia2t1y1wR6QKMq9j3y2ZlUM5M9an/H0v4y qqRIGvK3DKZM6lycP6hVDsrvCMxoccu0MuaKcfQ2geuPCRVitrnkr5eEhHLc1W6ZrWUl EvTcjCuHznjsFiW6L4TJkm+F0WdF6tRN8cN3ZpBOYczEXevX/1JftRiSrY9M2D7l4D81 8UhtVer+7Xzwit6xH2OhL4jdCgFZWAjJJpye9+w6zbMH/cPmW4Wx30s8PMfsCiWb3RtE Qb3w==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
I rigged up a function that makes navigation super fast in zsh. If you
hit enter on a blank line, it runs ls automatically.
Just add the following to your .zshrc:
auto-ls () {
if [[ $#BUFFER -eq 0 ]]; then
echo ""
ls
zle redisplay
else
zle accept-line
fi
}
zle -N auto-ls
bindkey '^M' auto-ls
To get the ^M correct in vim, hit <Ctrl+V><Enter>. You could really
make this run whatever you want, on any key you want, but I like this
shortcut in particular (It goes great with autocd!).
Cheers,
Mitch
Messages sorted by:
Reverse Date,
Date,
Thread,
Author