
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef clbuild | |
# TODO: clbuild-bash-completion.sh stuff (run/update/install/uninstall) | |
# Especially `update' found in this script is totally broken:) | |
_clbuild () { | |
local clbuild_dir=${clbuild_dir:=$(pwd)} | |
(( $+functions[__clbuild_commands] )) || | |
__clbuild_commands () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!zsh | |
# _git vcs_info | |
# __git_branch_switches | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' enable git | |
#zstyle ':vcs_info:*' formats '%B%F{black}(%f%b%F{black})%f%%b' # `%f` eats "1" | |
zstyle ':vcs_info:*' formats '%B%F{black}(%F{white}%b%F{black})%f%%b' | |
zstyle ':vcs_info:*' actionformats '%B%F{black}(%F{white}%b%F{black}|%F{white}%a%F{black})%f%%b' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro aif (test-form then-form &optional else-form) | |
(declare (indent 1)) | |
`(let ((it ,test-form)) | |
(if it ,then-form ,else-form))) | |
(defmacro aand (&rest args) | |
(declare (indent 0)) | |
(cond ((null args) t) | |
((null (cdr args)) (car args)) | |
(t `(aif ,(car args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; http://repo.or.cz/w/emacs.git/blob/HEAD:/src/fileio.c#l5557 | |
;; (install-my-restore-message-function alcs-make-candidates) | |
(defmacro w/uniq (names &rest body) | |
(declare (indent 1)) | |
`(let ,(mapcar (lambda (s) `(,s (gensym ,(symbol-name s)))) | |
(if (consp names) names (list names))) | |
,@body)) | |
(defmacro with-my-restore-message (&rest body) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#autoload | |
local -a flags | |
flags=( | |
'):end of flags' | |
'#:as numeric' | |
'%:expand %s in result as in prompts' | |
'@:array expand even in double quotes' | |
'A:create an array parameter with ${...=...}, (AA) associative array' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!zsh | |
# エディタのファイルの履歴を補完候補にするようなスクリプトです | |
_rf () { | |
local ref=$1 | |
shift | |
local -a xs | |
xs=("$@") | |
local -a ret | |
ret=() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!zsh | |
# コマンドライン上の今のカーソルの左の要素の展開具合を補完候補にするようなス | |
# クリプトです。 | |
_expand_word_fu () { | |
compstate[insert]= | |
local origprefix=$PREFIX | |
case $origprefix[1] in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!zsh | |
# 直前のコマンドラインの要素を補完候補にするようなスクリプトです。 | |
_complete_previous_commandline () { | |
local cl xs | |
cl="$(fc -l -n -1)" | |
xs=${(@z)cl} | |
compadd \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!zsh | |
# 直前のコマンドを再度実行して、その出力を補完候補するようなスクリプトです | |
_complete_previous_output () { | |
local command xs | |
command=${(Q)$(fc -l -n -1)} | |
xs=(${(f)"$(${=command})"}) | |
_message "($command)" |