Skip to content

Instantly share code, notes, and snippets.

View hchbaw's full-sized avatar

Takeshi Banse hchbaw

View GitHub Profile
#compdef - my-zargs t
setopt localoptions extendedglob
() {
local -a tmp0 tmp1 tmp
# copied from _zargs
echo "\
-eof::=eof e::=eof \
-exit x \
#!/bin/zsh
dashless=${${0:t}/-/ }
USAGE="[-f|--force] [-s|--stashify] <commit>..."
LONG_USAGE="$dashless <commit>...
save <commit>... in the stash ref namespace.
Basically $dashless deals with stashed <commit> but it could be:
[-f|--force] force operation
[-s|--stashify][-2] convert existing <commit> as if it were stashed.
# zaw.zsh source for 'git show-branch'.
# Thank you very much, nakamuray!
# https://github.com/nakamuray/zaw
zaw-src-git-showbranch () {
git rev-parse -q --is-inside-work-tree >/dev/null || return 1
#local b="${orig_lbuffer}${orig_rbuffer}"
local b="$BUFFER"
local z="$(git rev-parse --git-dir)""/zaw-src-git-showbranch"
# zaw.zsh source for the elements of the directory stack.
# https://github.com/nakamuray/zaw
# Thank you very much, nakamuray!
zmodload zsh/parameter
function zaw-src-dirstack() {
: ${(A)candidates::=$dirstack}
actions=("zaw-callback-execute" "zaw-callback-replace-buffer" "zaw-callback-append-to-buffer")
act_descriptions=("execute" "replace edit buffer" "append to edit buffer")
#compdef btrfs
_btrfs () {
_btrfs-help-v0.19 () {
echo "\
Usage:
btrfs subvolume snapshot <source> [<dest>/]<name>
Create a writable snapshot of the subvolume <source> with
the name <name> in the <dest> directory.
From d2f641ca50c792df09226b9cca3c0e66dc5dde9c Mon Sep 17 00:00:00 2001
From: Takeshi Banse <takebi@laafc.net>
Date: Fri, 7 Jan 2011 22:34:29 +0900
Subject: complete-word does not complete.
For example,
% bindkey "^I" complete-word
% bi<TAB>
From 950f3a97678690306c46855e4aac887b7a80c53b Mon Sep 17 00:00:00 2001
From: Takeshi Banse <takebi@laafc.net>
Date: Fri, 31 Dec 2010 09:45:30 +0900
Subject: [PATCH] Fix for some aliased commands
It seems that some aliases which contain some hyphens yeild an error.
% alias l='ls -sF --color=auto'
% l
_zsh_highlight-zle-buffer:local:16: not valid in this context: -sF