From a686ccfe1e72d10ff105be3f7d936c6648a3c052 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Mon, 20 Dec 2010 12:18:52 -0300 Subject: [PATCH] Added function that cds to ~/code, with tab-completion. Lifted from Ryan Bates' dotfiles. --- plugins/c/_c | 2 ++ plugins/c/c.plugin.zsh | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 plugins/c/_c create mode 100644 plugins/c/c.plugin.zsh diff --git a/plugins/c/_c b/plugins/c/_c new file mode 100644 index 000000000..24ca71afa --- /dev/null +++ b/plugins/c/_c @@ -0,0 +1,2 @@ +#compdef c +_files -W ~/code -/ diff --git a/plugins/c/c.plugin.zsh b/plugins/c/c.plugin.zsh new file mode 100644 index 000000000..8f4d126a0 --- /dev/null +++ b/plugins/c/c.plugin.zsh @@ -0,0 +1,8 @@ +# add function that cds to ~/code, with tab-completion +function c() { + cd ~/code/$1; +} + +fpath=($ZSH/plugins/c $fpath) +autoload -U compinit +compinit -i