move into functions file
authorJoerg Jaspert <joerg@debian.org>
Thu, 4 Apr 2013 22:28:35 +0000 (00:28 +0200)
committerJoerg Jaspert <joerg@debian.org>
Thu, 4 Apr 2013 22:28:35 +0000 (00:28 +0200)
.zsh/05_Functions.zsh

index d2083f1..f91375b 100644 (file)
@@ -140,3 +140,10 @@ function Status Start Stop Restart Reload {
         sudo /etc/init.d/${script} ${0:l}
     }
 }
+# move cursor between chars when typing '', "", (), [], and {}
+magic-single-quotes() { if [[ $LBUFFER[-1] == \' ]]; then zle self-insert; zle .backward-char; else zle self-insert; fi };
+magic-double-quotes() { if [[ $LBUFFER[-1] == \" ]]; then zle self-insert; zle .backward-char; else zle self-insert; fi };
+magic-parentheses() { if [[ $LBUFFER[-1] == \( ]]; then zle self-insert; zle .backward-char; else zle self-insert; fi };
+magic-square-brackets() { if [[ $LBUFFER[-1] == \[ ]]; then zle self-insert; zle .backward-char; else zle self-insert; fi };
+magic-curly-brackets() { if [[ $LBUFFER[-1] == \{ ]]; then zle self-insert; zle .backward-char; else zle self-insert; fi };
+magic-angle-brackets() { if [[ $LBUFFER[-1] == \< ]]; then zle self-insert; zle .backward-char; else zle self-insert; fi };