]> git.madduck.net Git - etc/zsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

jump-after-first-word zle function
authormartin f. krafft <madduck@madduck.net>
Wed, 3 Aug 2011 07:49:41 +0000 (09:49 +0200)
committermartin f. krafft <madduck@madduck.net>
Wed, 3 Aug 2011 07:49:41 +0000 (09:49 +0200)
.zsh/zshrc/80_zle

index 05c094e3c80ec02a5fba9ee6c213c57248a76a7a..a7378006980c8c241a5a5e47f41eb3004164ea99 100644 (file)
@@ -38,4 +38,18 @@ autoload insert-unicode-char
 zle -N insert-unicode-char
 bindkey '^Xi' insert-unicode-char
 
+# jump behind the first word on the cmdline to add options
+function _jump_after_first_word() {
+    local words
+    words=(${(z)BUFFER})
+
+    if (( ${#words} <= 1 )) ; then
+        CURSOR=${#BUFFER}
+    else
+        CURSOR=${#${words[1]}}
+    fi
+}
+zle -N _jump_after_first_word
+bindkey '^x1' _jump_after_first_word
+
 # vim:ft=zsh