]> 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:

Overhaul of the entire config. Yay for big diffs.
authormartin f. krafft <madduck@madduck.net>
Thu, 16 Mar 2017 02:31:31 +0000 (15:31 +1300)
committermartin f. krafft <madduck@madduck.net>
Wed, 17 May 2017 12:35:04 +0000 (14:35 +0200)
114 files changed:
.gitignore.d/zsh [deleted file]
.var/zsh/.gitignore
.zsh/.gitignore
.zsh/aliases/.noglob [new file with mode: 0644]
.zsh/aliases/Q [new file with mode: 0644]
.zsh/aliases/curl [new symlink]
.zsh/aliases/egrep [new symlink]
.zsh/aliases/fgrep [new symlink]
.zsh/aliases/find [new symlink]
.zsh/aliases/grep [new file with mode: 0644]
.zsh/aliases/links [new symlink]
.zsh/aliases/locate [new symlink]
.zsh/aliases/ls [new file with mode: 0644]
.zsh/aliases/mps [new file with mode: 0644]
.zsh/aliases/of [new file with mode: 0644]
.zsh/aliases/px [new file with mode: 0644]
.zsh/aliases/w3m [new symlink]
.zsh/aliases/wget [new symlink]
.zsh/aliases/zstyle [new symlink]
.zsh/dircolors
.zsh/dirhashes/debs [new symlink]
.zsh/dirhashes/doc [new symlink]
.zsh/dirhashes/log [new symlink]
.zsh/func/TS [deleted file]
.zsh/func/baseconv [deleted file]
.zsh/func/getpw [changed mode: 0755->0644]
.zsh/func/gitpub [changed mode: 0755->0644]
.zsh/func/giturl [changed mode: 0755->0644]
.zsh/func/p [changed mode: 0755->0644]
.zsh/func/prompt_madduck_setup [moved from .zsh/zshrc/60_vcsprompt with 56% similarity]
.zsh/func/svngit [changed mode: 0755->0644]
.zsh/func/urlencode [changed mode: 0755->0644]
.zsh/grml-etc-core [new submodule]
.zsh/logging
.zsh/oh-my-zsh [new submodule]
.zsh/sourcedir
.zsh/util
.zsh/zlogin/01-BREAK_HERE [deleted file]
.zsh/zlogin/90_db [deleted file]
.zsh/zlogout/01-BREAK_HERE [deleted file]
.zsh/zlogout/99-clear_screen [moved from .zsh/zlogout/99_cls with 93% similarity]
.zsh/zprofile/00-disable-core-dumps [moved from .zsh/zprofile/00_ulimit with 76% similarity]
.zsh/zprofile/01-BREAK_HERE [deleted file]
.zsh/zprofile/10-locales [moved from .zsh/zprofile/10_locale with 98% similarity]
.zsh/zprofile/10-umask [moved from .zsh/zshenv/40_editor with 69% similarity]
.zsh/zprofile/40_zcompile [deleted file]
.zsh/zshenv/00-apath [new file with mode: 0644]
.zsh/zshenv/00-dhpath [new file with mode: 0644]
.zsh/zshenv/00-fpath [moved from .zsh/zshenv/01_fpath with 70% similarity]
.zsh/zshenv/00-path [new file with mode: 0644]
.zsh/zshenv/00-tmpdir [new file with mode: 0644]
.zsh/zshenv/00-zvardir [new file with mode: 0644]
.zsh/zshenv/00_rdirs [deleted file]
.zsh/zshenv/01-BREAK_HERE [deleted file]
.zsh/zshenv/01_path [deleted file]
.zsh/zshenv/10_zvars [deleted file]
.zsh/zshenv/80_debian [deleted file]
.zsh/zshenv/80_pagers [deleted file]
.zsh/zshenv/80_texmf [deleted file]
.zsh/zshrc/00-autoload_executables_in_fpath [new file with mode: 0644]
.zsh/zshrc/00-load_alias-d [new file with mode: 0644]
.zsh/zshrc/00-load_dirhashes-d [new file with mode: 0644]
.zsh/zshrc/00_autoload [deleted file]
.zsh/zshrc/00_recompile [deleted file]
.zsh/zshrc/00_varsetup [deleted file]
.zsh/zshrc/01-BREAK_HERE [deleted file]
.zsh/zshrc/01-background_job_options [new file with mode: 0644]
.zsh/zshrc/01-basic_options [new file with mode: 0644]
.zsh/zshrc/02-colors_setup [new file with mode: 0644]
.zsh/zshrc/02-dircolors [new file with mode: 0644]
.zsh/zshrc/05-oh-my-zsh.disabled [new file with mode: 0644]
.zsh/zshrc/10-xterm_title [new file with mode: 0644]
.zsh/zshrc/19_dircolors [deleted file]
.zsh/zshrc/20-autoload_zsh_file_manipulation_functions [new file with mode: 0644]
.zsh/zshrc/20-tempfile+dir_functions [new file with mode: 0644]
.zsh/zshrc/20_compsys [deleted file]
.zsh/zshrc/20_dirhashes [deleted file]
.zsh/zshrc/30-chmod+chown_aliases [new file with mode: 0644]
.zsh/zshrc/30-ls_aliases [new file with mode: 0644]
.zsh/zshrc/30_aliases.disabled [moved from .zsh/zshrc/30_aliases with 62% similarity]
.zsh/zshrc/30_aliases_bugfix.disabled [moved from .zsh/zshrc/30_aliases_bugfix with 100% similarity]
.zsh/zshrc/39_tempfuncs [deleted file]
.zsh/zshrc/40-baseconv [new file with mode: 0644]
.zsh/zshrc/60-directory_stack [new file with mode: 0644]
.zsh/zshrc/75_vcsinfo.disabled [moved from .zsh/zshrc/75_vcsinfo with 100% similarity]
.zsh/zshrc/79-zle_widget_function_arrays [new file with mode: 0644]
.zsh/zshrc/79_bindkeys [deleted file]
.zsh/zshrc/80-completion [new file with mode: 0644]
.zsh/zshrc/80-history [moved from .zsh/zshrc/80_history with 66% similarity]
.zsh/zshrc/80-zle [new file with mode: 0644]
.zsh/zshrc/80-zle_add_sudo [new file with mode: 0644]
.zsh/zshrc/80-zle_edit_aliases+functions [new file with mode: 0644]
.zsh/zshrc/80-zle_inplace_mkdir [new file with mode: 0644]
.zsh/zshrc/80-zle_isearch [new file with mode: 0644]
.zsh/zshrc/80-zle_magic_abbreviations [new file with mode: 0644]
.zsh/zshrc/80-zle_mosh_home+end [new file with mode: 0644]
.zsh/zshrc/80-zle_parent-dir-shortcut [new file with mode: 0644]
.zsh/zshrc/80_abbreviations [deleted file]
.zsh/zshrc/80_inplacemkdir [deleted file]
.zsh/zshrc/80_zle [deleted file]
.zsh/zshrc/83-reporttime [new file with mode: 0644]
.zsh/zshrc/85-mime-integration [moved from .zsh/zlogin/60_mime with 94% similarity]
.zsh/zshrc/85_direnv.disabled [new file with mode: 0644]
.zsh/zshrc/85_prompt [deleted file]
.zsh/zshrc/85_termfonts [deleted file]
.zsh/zshrc/85_xtermtitle [deleted file]
.zsh/zshrc/90-ls_on_chdir [new file with mode: 0644]
.zsh/zshrc/90-run-help [new file with mode: 0644]
.zsh/zshrc/90_cleanfiles.disabled [moved from .zsh/zshrc/90_cleanfiles with 100% similarity]
.zsh/zshrc/95-watch-users [moved from .zsh/zshrc/95_watch with 91% similarity]
.zsh/zshrc/95_fortune.disabled [deleted file]
.zsh/zshrc/99-prompt_setup [new file with mode: 0644]
.zsh/zshrc/99_TODO [deleted file]
.zsh/zshrc/99_hookfunctions [deleted file]

diff --git a/.gitignore.d/zsh b/.gitignore.d/zsh
deleted file mode 100644 (file)
index d014443..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-*
-!/.var
-!/.var/zsh
-!/.var/zsh/.gitignore
-!/.zsh
-!/.zsh/dircolors
-!/.zshenv
-!/.zsh/func
-!/.zsh/func/baseconv
-!/.zsh/func/getpw
-!/.zsh/func/gitpub
-!/.zsh/func/giturl
-!/.zsh/func/p
-!/.zsh/func/svngit
-!/.zsh/func/TS
-!/.zsh/func/urlencode
-!/.zsh/.gitignore
-!/.zsh/logging
-!/.zsh/rcsstub
-!/.zsh/sourcedir
-!/.zsh/util
-!/.zsh/zlogin
-!/.zsh/.zlogin
-!/.zsh/zlogin/10_shlvl
-!/.zsh/zlogin/60_mime
-!/.zsh/zlogin/90_db
-!/.zsh/zlogin/.gitignore
-!/.zsh/zlogout
-!/.zsh/.zlogout
-!/.zsh/zlogout/90_sudo
-!/.zsh/zlogout/99_cls
-!/.zsh/zlogout/.gitignore
-!/.zsh/zprofile
-!/.zsh/.zprofile
-!/.zsh/zprofile/00_ulimit
-!/.zsh/zprofile/10_locale
-!/.zsh/zprofile/40_zcompile
-!/.zsh/zprofile/.gitignore
-!/.zsh/zshenv
-!/.zsh/.zshenv
-!/.zsh/zshenv/00_rdirs
-!/.zsh/zshenv/01_fpath
-!/.zsh/zshenv/01_path
-!/.zsh/zshenv/10_zvars
-!/.zsh/zshenv/40_editor
-!/.zsh/zshenv/80_debian
-!/.zsh/zshenv/80_pagers
-!/.zsh/zshenv/80_texmf
-!/.zsh/zshenv/.gitignore
-!/.zsh/zshrc
-!/.zsh/.zshrc
-!/.zsh/zshrc/00_autoload
-!/.zsh/zshrc/00_recompile
-!/.zsh/zshrc/00_varsetup
-!/.zsh/zshrc/19_dircolors
-!/.zsh/zshrc/20_compsys
-!/.zsh/zshrc/20_dirhashes
-!/.zsh/zshrc/30_aliases
-!/.zsh/zshrc/30_aliases_bugfix
-!/.zsh/zshrc/39_tempfuncs
-!/.zsh/zshrc/60_vcsprompt
-!/.zsh/zshrc/75_vcsinfo
-!/.zsh/zshrc/79_bindkeys
-!/.zsh/zshrc/80_abbreviations
-!/.zsh/zshrc/80_history
-!/.zsh/zshrc/80_inplacemkdir
-!/.zsh/zshrc/80_zle
-!/.zsh/zshrc/85_prompt
-!/.zsh/zshrc/85_termfonts
-!/.zsh/zshrc/85_xtermtitle
-!/.zsh/zshrc/90_cleanfiles
-!/.zsh/zshrc/95_fortune.disabled
-!/.zsh/zshrc/95_watch
-!/.zsh/zshrc/99_hookfunctions
-!/.zsh/zshrc/99_TODO
-!/.zsh/zshrc/.gitignore
index bd994d8fec0b219527a9b136dbc326f8ff22422d..7fb71c004721b7e4ec9bef952ae8423057ff9119 100644 (file)
@@ -1,4 +1,3 @@
 comp-*
 comp-*
-history
-mailpath
+history-*
 compcache
 compcache
index 5d74a078a4ac3fa13ad0a94090a5b2799ec53e94..e0e6506d0b3267f65387fe3dcccf8c4cad931c28 100644 (file)
@@ -1,2 +1,3 @@
 *.zwc
 *.zwc.old
 *.zwc
 *.zwc.old
+.*.sw?
diff --git a/.zsh/aliases/.noglob b/.zsh/aliases/.noglob
new file mode 100644 (file)
index 0000000..75a038a
--- /dev/null
@@ -0,0 +1 @@
+noglob $0
diff --git a/.zsh/aliases/Q b/.zsh/aliases/Q
new file mode 100644 (file)
index 0000000..fed9e16
--- /dev/null
@@ -0,0 +1 @@
+exec $SHELL
diff --git a/.zsh/aliases/curl b/.zsh/aliases/curl
new file mode 120000 (symlink)
index 0000000..ea7fe33
--- /dev/null
@@ -0,0 +1 @@
+.noglob
\ No newline at end of file
diff --git a/.zsh/aliases/egrep b/.zsh/aliases/egrep
new file mode 120000 (symlink)
index 0000000..9b059dc
--- /dev/null
@@ -0,0 +1 @@
+grep
\ No newline at end of file
diff --git a/.zsh/aliases/fgrep b/.zsh/aliases/fgrep
new file mode 120000 (symlink)
index 0000000..9b059dc
--- /dev/null
@@ -0,0 +1 @@
+grep
\ No newline at end of file
diff --git a/.zsh/aliases/find b/.zsh/aliases/find
new file mode 120000 (symlink)
index 0000000..ea7fe33
--- /dev/null
@@ -0,0 +1 @@
+.noglob
\ No newline at end of file
diff --git a/.zsh/aliases/grep b/.zsh/aliases/grep
new file mode 100644 (file)
index 0000000..6d9443e
--- /dev/null
@@ -0,0 +1 @@
+$0 --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} -D skip -d skip
diff --git a/.zsh/aliases/links b/.zsh/aliases/links
new file mode 120000 (symlink)
index 0000000..ea7fe33
--- /dev/null
@@ -0,0 +1 @@
+.noglob
\ No newline at end of file
diff --git a/.zsh/aliases/locate b/.zsh/aliases/locate
new file mode 120000 (symlink)
index 0000000..ea7fe33
--- /dev/null
@@ -0,0 +1 @@
+.noglob
\ No newline at end of file
diff --git a/.zsh/aliases/ls b/.zsh/aliases/ls
new file mode 100644 (file)
index 0000000..abef270
--- /dev/null
@@ -0,0 +1 @@
+LC_COLLATE=POSIX $0 -bC --color=auto --group-directories-first
diff --git a/.zsh/aliases/mps b/.zsh/aliases/mps
new file mode 100644 (file)
index 0000000..1f0199d
--- /dev/null
@@ -0,0 +1 @@
+ps -ao user,pcpu,start,command
diff --git a/.zsh/aliases/of b/.zsh/aliases/of
new file mode 100644 (file)
index 0000000..f8656a0
--- /dev/null
@@ -0,0 +1 @@
+lsof -np
diff --git a/.zsh/aliases/px b/.zsh/aliases/px
new file mode 100644 (file)
index 0000000..1f07c85
--- /dev/null
@@ -0,0 +1 @@
+ps afux
diff --git a/.zsh/aliases/w3m b/.zsh/aliases/w3m
new file mode 120000 (symlink)
index 0000000..ea7fe33
--- /dev/null
@@ -0,0 +1 @@
+.noglob
\ No newline at end of file
diff --git a/.zsh/aliases/wget b/.zsh/aliases/wget
new file mode 120000 (symlink)
index 0000000..ea7fe33
--- /dev/null
@@ -0,0 +1 @@
+.noglob
\ No newline at end of file
diff --git a/.zsh/aliases/zstyle b/.zsh/aliases/zstyle
new file mode 120000 (symlink)
index 0000000..ea7fe33
--- /dev/null
@@ -0,0 +1 @@
+.noglob
\ No newline at end of file
index 49c8b0d043549b92fa9c3878647276c0c45f7507..646810c4f7b486d6f47fca4591c796d31bc807b5 100644 (file)
@@ -11,8 +11,7 @@
 ### BEGIN dircolors --print-database output ##################################
 # Configuration file for dircolors, a utility to help you set the
 # LS_COLORS environment variable used by GNU ls with the --color option.
 ### BEGIN dircolors --print-database output ##################################
 # Configuration file for dircolors, a utility to help you set the
 # LS_COLORS environment variable used by GNU ls with the --color option.
-# Copyright (C) 1996, 1999-2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2016 Free Software Foundation, Inc.
 # Copying and distribution of this file, with or without modification,
 # are permitted provided the copyright notice and this notice are preserved.
 # The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
 # Copying and distribution of this file, with or without modification,
 # are permitted provided the copyright notice and this notice are preserved.
 # The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
@@ -82,6 +81,7 @@ CHR 40;33;01 # character device driver
 ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
 SETUID 37;41 # file that is setuid (u+s)
 SETGID 30;43 # file that is setgid (g+s)
 ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
 SETUID 37;41 # file that is setuid (u+s)
 SETGID 30;43 # file that is setgid (g+s)
+CAPABILITY 30;41 # file with capability
 STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
 OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
 STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
 STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
 OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
 STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
@@ -103,32 +103,52 @@ EXEC 01;32
  # archives or compressed (bright red)
 .tar 01;31
 .tgz 01;31
  # archives or compressed (bright red)
 .tar 01;31
 .tgz 01;31
-.svgz 01;31
+.arc 01;31
 .arj 01;31
 .taz 01;31
 .arj 01;31
 .taz 01;31
+.lha 01;31
+.lz4 01;31
 .lzh 01;31
 .lzma 01;31
 .lzh 01;31
 .lzma 01;31
+.tlz 01;31
+.txz 01;31
+.tzo 01;31
+.t7z 01;31
 .zip 01;31
 .z 01;31
 .Z 01;31
 .dz 01;31
 .gz 01;31
 .zip 01;31
 .z 01;31
 .Z 01;31
 .dz 01;31
 .gz 01;31
+.lrz 01;31
+.lz 01;31
+.lzo 01;31
+.xz 01;31
+.zst 01;31
+.tzst 01;31
 .bz2 01;31
 .bz 01;31
 .bz2 01;31
 .bz 01;31
+.tbz 01;31
 .tbz2 01;31
 .tz 01;31
 .deb 01;31
 .rpm 01;31
 .jar 01;31
 .tbz2 01;31
 .tz 01;31
 .deb 01;31
 .rpm 01;31
 .jar 01;31
+.war 01;31
+.ear 01;31
+.sar 01;31
 .rar 01;31
 .rar 01;31
+.alz 01;31
 .ace 01;31
 .zoo 01;31
 .cpio 01;31
 .7z 01;31
 .rz 01;31
 .ace 01;31
 .zoo 01;31
 .cpio 01;31
 .7z 01;31
 .rz 01;31
+.cab 01;31
 # image formats
 .jpg 01;35
 .jpeg 01;35
 # image formats
 .jpg 01;35
 .jpeg 01;35
+.mjpg 01;35
+.mjpeg 01;35
 .gif 01;35
 .bmp 01;35
 .pbm 01;35
 .gif 01;35
 .bmp 01;35
 .pbm 01;35
@@ -141,6 +161,7 @@ EXEC 01;32
 .tiff 01;35
 .png 01;35
 .svg 01;35
 .tiff 01;35
 .png 01;35
 .svg 01;35
+.svgz 01;35
 .mng 01;35
 .pcx 01;35
 .mov 01;35
 .mng 01;35
 .pcx 01;35
 .mov 01;35
@@ -148,6 +169,7 @@ EXEC 01;32
 .mpeg 01;35
 .m2v 01;35
 .mkv 01;35
 .mpeg 01;35
 .m2v 01;35
 .mkv 01;35
+.webm 01;35
 .ogm 01;35
 .mp4 01;35
 .m4v 01;35
 .ogm 01;35
 .mp4 01;35
 .m4v 01;35
@@ -162,15 +184,22 @@ EXEC 01;32
 .flc 01;35
 .avi 01;35
 .fli 01;35
 .flc 01;35
 .avi 01;35
 .fli 01;35
+.flv 01;35
 .gl 01;35
 .dl 01;35
 .xcf 01;35
 .xwd 01;35
 .yuv 01;35
 .gl 01;35
 .dl 01;35
 .xcf 01;35
 .xwd 01;35
 .yuv 01;35
+.cgm 01;35
+.emf 01;35
+# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
+.ogv 01;35
+.ogx 01;35
 # audio formats
 .aac 00;36
 .au 00;36
 .flac 00;36
 # audio formats
 .aac 00;36
 .au 00;36
 .flac 00;36
+.m4a 00;36
 .mid 00;36
 .midi 00;36
 .mka 00;36
 .mid 00;36
 .midi 00;36
 .mka 00;36
@@ -179,9 +208,14 @@ EXEC 01;32
 .ogg 00;36
 .ra 00;36
 .wav 00;36
 .ogg 00;36
 .ra 00;36
 .wav 00;36
+# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
+.oga 00;36
+.opus 00;36
+.spx 00;36
+.xspf 00;36
 ### END dircolors --print-database output ####################################
 
 ### END dircolors --print-database output ####################################
 
-# now override stuff for those who don't take as much LSD:
+# now override stuff
 
 # Attribute codes:
 # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
 
 # Attribute codes:
 # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
@@ -193,84 +227,101 @@ DIR 01;30
 LINK target
 EXEC 00;34
 
 LINK target
 EXEC 00;34
 
-# archives or compressed
+# and remove all the bold from the images and archives:
+# archives or compressed (bright red)
 .tar 00;31
 .tgz 00;31
 .tar 00;31
 .tgz 00;31
-.svgz 00;31
+.arc 00;31
 .arj 00;31
 .taz 00;31
 .arj 00;31
 .taz 00;31
+.lha 00;31
+.lz4 00;31
 .lzh 00;31
 .lzma 00;31
 .lzh 00;31
 .lzma 00;31
+.tlz 00;31
+.txz 00;31
+.tzo 00;31
+.t7z 00;31
 .zip 00;31
 .z 00;31
 .Z 00;31
 .dz 00;31
 .gz 00;31
 .zip 00;31
 .z 00;31
 .Z 00;31
 .dz 00;31
 .gz 00;31
+.lrz 00;31
+.lz 00;31
+.lzo 00;31
+.xz 00;31
+.zst 00;31
+.tzst 00;31
 .bz2 00;31
 .bz 00;31
 .bz2 00;31
 .bz 00;31
+.tbz 00;31
 .tbz2 00;31
 .tz 00;31
 .deb 00;31
 .rpm 00;31
 .jar 00;31
 .tbz2 00;31
 .tz 00;31
 .deb 00;31
 .rpm 00;31
 .jar 00;31
+.war 00;31
+.ear 00;31
+.sar 00;31
 .rar 00;31
 .rar 00;31
+.alz 00;31
 .ace 00;31
 .zoo 00;31
 .cpio 00;31
 .7z 00;31
 .rz 00;31
 .ace 00;31
 .zoo 00;31
 .cpio 00;31
 .7z 00;31
 .rz 00;31
+.cab 00;31
 # image formats
 # image formats
-.jpg 00
-.jpeg 00
-.gif 00
-.bmp 00
-.pbm 00
-.pgm 00
-.ppm 00
-.tga 00
-.xbm 00
-.xpm 00
-.tif 00
-.tiff 00
-.png 00
-.svg 00
-.mng 00
-.pcx 00
-.mov 00
-.mpg 00
-.mpeg 00
-.m2v 00
-.mkv 00
-.ogm 00
-.mp4 00
-.m4v 00
-.mp4v 00
-.vob 00
-.qt 00
-.nuv 00
-.wmv 00
-.asf 00
-.rm 00
-.rmvb 00
-.flc 00
-.avi 00
-.fli 00
-.gl 00
-.dl 00
-.xcf 00
-.xwd 00
-.yuv 00
-# audio formats
-.aac 00
-.au 00
-.flac 00
-.mid 00
-.midi 00
-.mka 00
-.mp3 00
-.mpc 00
-.ogg 00
-.ra 00
-.wav 00
+.jpg 00;35
+.jpeg 00;35
+.mjpg 00;35
+.mjpeg 00;35
+.gif 00;35
+.bmp 00;35
+.pbm 00;35
+.pgm 00;35
+.ppm 00;35
+.tga 00;35
+.xbm 00;35
+.xpm 00;35
+.tif 00;35
+.tiff 00;35
+.png 00;35
+.svg 00;35
+.svgz 00;35
+.mng 00;35
+.pcx 00;35
+.mov 00;35
+.mpg 00;35
+.mpeg 00;35
+.m2v 00;35
+.mkv 00;35
+.webm 00;35
+.ogm 00;35
+.mp4 00;35
+.m4v 00;35
+.mp4v 00;35
+.vob 00;35
+.qt 00;35
+.nuv 00;35
+.wmv 00;35
+.asf 00;35
+.rm 00;35
+.rmvb 00;35
+.flc 00;35
+.avi 00;35
+.fli 00;35
+.flv 00;35
+.gl 00;35
+.dl 00;35
+.xcf 00;35
+.xwd 00;35
+.yuv 00;35
+.cgm 00;35
+.emf 00;35
+# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
+.ogv 00;35
+.ogx 00;35
 
 # vim:ft=dircolors
 
 # vim:ft=dircolors
diff --git a/.zsh/dirhashes/debs b/.zsh/dirhashes/debs
new file mode 120000 (symlink)
index 0000000..b993a95
--- /dev/null
@@ -0,0 +1 @@
+/var/cache/apt/archives
\ No newline at end of file
diff --git a/.zsh/dirhashes/doc b/.zsh/dirhashes/doc
new file mode 120000 (symlink)
index 0000000..f964704
--- /dev/null
@@ -0,0 +1 @@
+/usr/share/doc
\ No newline at end of file
diff --git a/.zsh/dirhashes/log b/.zsh/dirhashes/log
new file mode 120000 (symlink)
index 0000000..38d1670
--- /dev/null
@@ -0,0 +1 @@
+/var/log
\ No newline at end of file
diff --git a/.zsh/func/TS b/.zsh/func/TS
deleted file mode 100755 (executable)
index 3075561..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# func/TS
-#
-# a convenient way to create an environment for collaborative testing
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-local topic filename ret
-topic="${(j:_:)@}"
-filename="${TMPDIR:-/tmp}/script.${topic:-$LOGNAME}.$$.$(date +%Y%m%d.%H%M)"
-echo "I: writing typescript to $filename ..." >&2
-PS1="
-%# " PS2= RPS1= script -c "zsh -f" -f -q "$filename"
-ret=$?
-echo "I: typescript is in $filename ."
-return $ret
-exit $ret
diff --git a/.zsh/func/baseconv b/.zsh/func/baseconv
deleted file mode 100755 (executable)
index 994d0cc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/zsh
-#
-# func/baseconv
-#
-# zsh-based conversion between numeric bases
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-if [ $# -ne 3 ]; then
-  echo Usage: ${0##*/} ibase obase number
-  return 1
-fi
-
-typeset -li $2 var
-eval ((var=${1}#${3}))
-echo ${var#*\#}
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
similarity index 56%
rename from .zsh/zshrc/60_vcsprompt
rename to .zsh/func/prompt_madduck_setup
index d0d33c1288cb73bea117a59c618dc79d1b2c8e0a..0b6dddcbdadcc073c2d000639617056c6b86ee6b 100644 (file)
@@ -1,17 +1,22 @@
-# zshrc/60_vcsprompt
 #
 #
-# Make git information available to the prompt
+# My zsh prompt theme
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
 #
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
 #
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
-# Shamelessly based on http://glandium.org/blog/?p=170
+# vcs stuff shamelessly based on http://glandium.org/blog/?p=170
 #
 
 #
 
+zstyle -m :madduck:prompt:default path-maxlen '*' \
+  || zstyle :madduck:prompt:default path-maxlen 25
+zstyle -m :madduck:prompt:default path-minlen '*' \
+  || zstyle :madduck:prompt:default path-minlen 10
+
 __on_networkfs()
 {
 __on_networkfs()
 {
+  emulate -L zsh
   case $(df -T . | sed -rne '$s,^[^[:space:]]+[[:space:]]+([^[:space:]]+).*,\1,p') in
     (cifs|nfs) return 0;;
   esac
   case $(df -T . | sed -rne '$s,^[^[:space:]]+[[:space:]]+([^[:space:]]+).*,\1,p') in
     (cifs|nfs) return 0;;
   esac
@@ -20,6 +25,7 @@ __on_networkfs()
 
 __git_get_reporoot()
 {
 
 __git_get_reporoot()
 {
+  emulate -L zsh
   # return the full path to the root of the current git repository
   [ -d "$GIT_DIR" ] && echo "$GIT_DIR" && return 0
   local dir; dir="$PWD/$(git rev-parse --show-cdup)"
   # return the full path to the root of the current git repository
   [ -d "$GIT_DIR" ] && echo "$GIT_DIR" && return 0
   local dir; dir="$PWD/$(git rev-parse --show-cdup)"
@@ -29,6 +35,10 @@ __git_get_reporoot()
 
 __git_get_branch()
 {
 
 __git_get_branch()
 {
+  emulate -L zsh
+  # use oh-my-zsh prompt info function if it exists
+  $(command -v git_prompt_info) && return
+
   # return the name of the git branch we're on
   local ref gitdir
   gitdir="$(git rev-parse --git-dir)"
   # return the name of the git branch we're on
   local ref gitdir
   gitdir="$(git rev-parse --git-dir)"
@@ -39,34 +49,73 @@ __git_get_branch()
 
 __git_print_preprompt()
 {
 
 __git_print_preprompt()
 {
+  emulate -L zsh
   [ "$(git config --get core.bare)" = false ] || return
   __on_networkfs && return
 
   [ "$(git config --get core.bare)" = false ] || return
   __on_networkfs && return
 
-  local output
-  output=(${(f):-"$(git diff --stat --relative 2>/dev/null)"})
-  if [[ ${#output} -gt 1 ]]; then
-    echo changes on filesystem:
-    print "${${(F)output[1,-2]}//\.\.\./…}"
-  fi
-  output=(${(f):-"$(git diff --cached --stat --relative 2>/dev/null)"})
-  if [[ ${#output} -gt 1 ]]; then
-    echo cached/staged changes:
-    print "${${(F)output[1,-2]}//\.\.\./…}"
+  local COLUMNS=${COLUMNS:-80}
+  local LINES=${LINES:-25}
+
+  function output() {
+    emulate -L zsh
+    local title="$@"
+    local output=(${(f)"$(cat)"})
+
+    [[ ${#output} -ge 1 ]] || return
+
+    local statl="$(echo ${output[-1]} | sed -re 's@^\s*([0-9]+)[^,]+(, ([0-9]+) [^(]+\(([-+])\))(, ([0-9]+) [^(]+\(([-+])\))?@\1/\4\3/\7\6@')"
+
+    if [[ ${output[-2]## } = '...' ]]; then
+      print "${title} (${statl%/}, abbrev.):"
+      print "${(F)output[1,-3]}"
+      print " …"
+    else
+      print "${title} (${statl%/}):"
+      print "${(F)output[1,-2]}"
+    fi
+  }
+
+  function gitdiffstat() {
+    emulate -L zsh
+    local common_options="--stat=$((COLUMNS/2-1)),$((COLUMNS/4-2)),$(($LINES/3)) --relative"
+    eval git diff $common_options "$@" 2>/dev/null
+  }
+
+  local cached=(${(f)"$(gitdiffstat --cached | output cached)"})
+  local changed=(${(f)"$(gitdiffstat | output changed)"})
+
+  local max=${#changed}
+  [[ $max -lt ${#cached} ]] && max=${#cached}
+
+  ((max == 0)) && return
+
+  local width=$(((COLUMNS-3)/2))
+
+  if (( ${#cached} > 0 && ${#changed} > 0 )); then
+    local i
+    for (( i=1 ; i <= max ; i++ )) do
+      printf "%-${width}s │ %-${width}s\n" "${cached[$i]}" "${changed[$i]}"
+    done
+  else
+    print ${(F)cached}${(F)changed}
   fi
 }
 
 __hg_get_reporoot()
 {
   fi
 }
 
 __hg_get_reporoot()
 {
+  emulate -L zsh
   hg root
 }
 
 __hg_get_branch()
 {
   hg root
 }
 
 __hg_get_branch()
 {
+  emulate -L zsh
   echo "hg:$(hg branch)"
 }
 
 __bzr_get_reporoot()
 {
   echo "hg:$(hg branch)"
 }
 
 __bzr_get_reporoot()
 {
+  emulate -L zsh
   local reporoot
   reporoot="$(bzr info | sed -rne 's, *branch root: ,,p')"
   case "$reporoot" in
   local reporoot
   reporoot="$(bzr info | sed -rne 's, *branch root: ,,p')"
   case "$reporoot" in
@@ -77,6 +126,7 @@ __bzr_get_reporoot()
 
 __bzr_get_branch()
 {
 
 __bzr_get_branch()
 {
+  emulate -L zsh
   local branch revno
   bzr version-info | while read i j; do
       case "$i" in
   local branch revno
   bzr version-info | while read i j; do
       case "$i" in
@@ -89,6 +139,7 @@ __bzr_get_branch()
 
 __vcs_get_repo_type()
 {
 
 __vcs_get_repo_type()
 {
+  emulate -L zsh
   # return the type of the closest repository in the path hierarchy
   local dir
   while true; do
   # return the type of the closest repository in the path hierarchy
   local dir
   while true; do
@@ -101,14 +152,27 @@ __vcs_get_repo_type()
   done
 }
 
   done
 }
 
+__get_prompt_path_len() {
+  emulate -L zsh
+  local result
+  zstyle -s ":madduck:prompt:$PWD" path-${1}len result
+  [ -z "$result" ] && zstyle -s ':madduck:prompt:default' path-${1}len result
+  echo $result
+}
+
 __vcs_get_prompt_path_components()
 {
 __vcs_get_prompt_path_components()
 {
+  emulate -L zsh
   # return formatted path components (prefix branch postfix) given
   # the repository root and the branch.
 
   # return formatted path components (prefix branch postfix) given
   # the repository root and the branch.
 
+  local MAXLEN MINLEN
+  MAXLEN=$(__get_prompt_path_len max)
+  MINLEN=$(__get_prompt_path_len min)
+
   # shortcut: if there are no arguments, return a default prompt
   if [ -z "${1:-}" ]; then
   # shortcut: if there are no arguments, return a default prompt
   if [ -z "${1:-}" ]; then
-    pwdnamed="${(%):-%${_PROMPT_PATH_MAXLEN}<…<%~%<<}"
+    pwdnamed="${(%):-%${MAXLEN}<…<%~%<<}"
     echo "$pwdnamed"
     return
   fi
     echo "$pwdnamed"
     return
   fi
@@ -140,11 +204,11 @@ __vcs_get_prompt_path_components()
   (( $postcomps > 0 )) && postfix="${(%):-%${postcomps}~}"
 
   # we don't want the prompt to get too long, so keep the total prompt length
   (( $postcomps > 0 )) && postfix="${(%):-%${postcomps}~}"
 
   # we don't want the prompt to get too long, so keep the total prompt length
-  # under $_PROMPT_PATH_MAXLEN (25), but ensure that the prefix is not shorter
-  # than $_PROMPT_PATH_MINLEN (10), no matter what
+  # under $MAXLEN, but ensure that the prefix is not shorter
+  # than $MINLEN, no matter what
   local prelen minlen prefix
   local prelen minlen prefix
-  prelen=$((${_PROMPT_PATH_MAXLEN:-25} - $#branch - $#postfix))
-  minlen=${_PROMPT_PATH_MINLEN:-10}
+  prelen=$((${MAXLEN} - $#branch - $#postfix))
+  minlen=${MINLEN}
   (( $prelen < $minlen )) && prelen=$minlen
   prefix="${(%):-%${prelen}<…<%-${precomps}~%<<}"
 
   (( $prelen < $minlen )) && prelen=$minlen
   prefix="${(%):-%${prelen}<…<%-${precomps}~%<<}"
 
@@ -153,6 +217,7 @@ __vcs_get_prompt_path_components()
 
 __vcs_set_prompt_variables()
 {
 
 __vcs_set_prompt_variables()
 {
+  emulate -L zsh
   # set psvar[1..3] depending on repo type, or just psvar[1] if no repo found
   local reporoot branch repotype
   repotype="${1:-$(__vcs_get_repo_type)}"
   # set psvar[1..3] depending on repo type, or just psvar[1] if no repo found
   local reporoot branch repotype
   repotype="${1:-$(__vcs_get_repo_type)}"
@@ -160,14 +225,14 @@ __vcs_set_prompt_variables()
   case "$repotype" in
     git)
       reporoot="$(__git_get_reporoot)" ||
   case "$repotype" in
     git)
       reporoot="$(__git_get_reporoot)" ||
-        { error "could not determine git repository root"; return 1 }
+        { zerror "could not determine git repository root"; return 1 }
       branch="$(__git_get_branch)" ||
       branch="$(__git_get_branch)" ||
-        { error "could not determine git branch"; return 1 }
+        { zerror "could not determine git branch"; return 1 }
       if [ -n "$VCSH_REPO_NAME" ]; then
         # if vcsh is used to get a subshell, then the repo root is the home
         # directory, but we want to indicate the vcsh context too:
         eval set -- $(__vcs_get_prompt_path_components "$HOME" "$branch")
       if [ -n "$VCSH_REPO_NAME" ]; then
         # if vcsh is used to get a subshell, then the repo root is the home
         # directory, but we want to indicate the vcsh context too:
         eval set -- $(__vcs_get_prompt_path_components "$HOME" "$branch")
-        set -- "vcsh:$VCSH_REPO_NAME" "$2" "$3"
+        set -- "vcsh:$VCSH_REPO_NAME" "$2" "$1${3:+/$3}"
       else
         eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch")
         if [ -d "$GIT_DIR" ]; then
       else
         eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch")
         if [ -d "$GIT_DIR" ]; then
@@ -180,16 +245,16 @@ __vcs_set_prompt_variables()
       ;;
     hg)
       reporoot="$(__hg_get_reporoot)" ||
       ;;
     hg)
       reporoot="$(__hg_get_reporoot)" ||
-        { error "could not determine hg repository root"; return 1 }
+        { zerror "could not determine hg repository root"; return 1 }
       branch="$(__hg_get_branch)" ||
       branch="$(__hg_get_branch)" ||
-        { error "could not determine hg branch"; return 1 }
+        { zerror "could not determine hg branch"; return 1 }
       eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch")
       ;;
     bzr)
       reporoot="$(__bzr_get_reporoot)" ||
       eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch")
       ;;
     bzr)
       reporoot="$(__bzr_get_reporoot)" ||
-        { error "could not determine bzr repository root"; return 1 }
+        { zerror "could not determine bzr repository root"; return 1 }
       branch="$(__bzr_get_branch)" ||
       branch="$(__bzr_get_branch)" ||
-        { error "could not determine bzr branch"; return 1 }
+        { zerror "could not determine bzr branch"; return 1 }
       eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch")
       ;;
     *)
       eval set -- $(__vcs_get_prompt_path_components "$reporoot" "$branch")
       ;;
     *)
@@ -197,6 +262,8 @@ __vcs_set_prompt_variables()
         NONE) :;;
         *) warn "$repotype repositories not (yet) supported in the prompt";;
       esac
         NONE) :;;
         *) warn "$repotype repositories not (yet) supported in the prompt";;
       esac
+      local MAXLEN MINLEN
+      MAXLEN=$(__get_prompt_path_len max)
       local p="%${MAXLEN}<…<%~%<<"
       #TODO find a better way so we don't have to nuke $psvar, but since the
       #     %(nv.true.false) check for prompts checks element count, not
       local p="%${MAXLEN}<…<%~%<<"
       #TODO find a better way so we don't have to nuke $psvar, but since the
       #     %(nv.true.false) check for prompts checks element count, not
@@ -210,8 +277,8 @@ __vcs_set_prompt_variables()
 
 __vcs_print_preprompt()
 {
 
 __vcs_print_preprompt()
 {
-  local reporoot
-  repotype="${1:-$(__vcs_get_repo_type)}"
+  emulate -L zsh
+  local repotype="${1:-$(__vcs_get_repo_type)}"
 
   case "$repotype" in
     git)
 
   case "$repotype" in
     git)
@@ -222,6 +289,7 @@ __vcs_print_preprompt()
 
 if ! is_root; then
   # too dangerous to be run as root
 
 if ! is_root; then
   # too dangerous to be run as root
+  autoload -U add-zsh-hook
 
   _update_vcs_prompt_vars_if_vcs_ran() {
     local vcs="$(__vcs_get_repo_type)"
 
   _update_vcs_prompt_vars_if_vcs_ran() {
     local vcs="$(__vcs_get_repo_type)"
@@ -230,20 +298,72 @@ if ! is_root; then
       *${vcs}*) __vcs_set_prompt_variables "$vcs"
     esac
   }
       *${vcs}*) __vcs_set_prompt_variables "$vcs"
     esac
   }
-  precmd_functions+=_update_vcs_prompt_vars_if_vcs_ran
+  add-zsh-hook precmd _update_vcs_prompt_vars_if_vcs_ran
 
   _update_vcs_prompt_vars() {
     __vcs_set_prompt_variables
   }
 
   _update_vcs_prompt_vars() {
     __vcs_set_prompt_variables
   }
-  chpwd_functions+=_update_vcs_prompt_vars
+  add-zsh-hook chpwd _update_vcs_prompt_vars
 
   _print_preprompt() {
     [[ $? -eq 0 ]] && __vcs_print_preprompt
   }
 
   _print_preprompt() {
     [[ $? -eq 0 ]] && __vcs_print_preprompt
   }
-  precmd_functions+=_print_preprompt
+  add-zsh-hook precmd _print_preprompt
 
   # call it once
   _update_vcs_prompt_vars
 fi
 
 
   # call it once
   _update_vcs_prompt_vars
 fi
 
+function make_ps1() {
+  # start with '+' if in a subshell
+  echo -n '%(2L.+.)'
+
+  # the machine name, bold or underlined based on non-root/root
+  local ps1_hl=B
+  is_root && ps1_hl=U
+  echo -n "%${ps1_hl:=B}%m%${(L)ps1_hl}"
+
+  # if we're in a Debian chroot, make that stand out
+  echo -n "${DEBIAN_CHROOT:+/%S$DEBIAN_CHROOT%s}"
+
+  # we end this with a :
+  echo -n :
+
+  # now comes the working directory, composed from parts in $psvar,
+  # which is managed by $ZDOTDIR/zshrc/06-vcsprompt
+  echo -n '%1v%(2v.|%B%2v%b|.)%(3v.%3v.)'
+
+  # and we finish with #/% for root/non-root, and a space
+  echo -n '%# '
+  echo
+}
+PS1=$(make_ps1)
+unfunction make_ps1
+PS2="%{$fg[red]%}%_>%{$reset_color%}"
+
+function make_rps1() {
+  # First, a comment character and parens
+  echo -n '#('
+
+  # Next, if the returncode was non-zero, make it stand-out
+  # and include a trailing space
+  echo -n "%(0?..%{$fg[red]%}%S%?%s%{$reset_color%} )"
+
+  # If there are background jobs, print their number, followed by
+  # '@':
+  echo -n '%(1j.%j@.)'
+
+  # and then the terminal line we're using
+  echo -n '%l'
+
+  # this concludes the first part, but there's more
+  echo -n ') '
+
+  # the timestamp will finish it off:
+  echo -n '%D{%d %H:%M:%S.%.}'
+  echo
+}
+RPS1=$(make_rps1)
+unfunction make_rps1
+
 # vim:ft=zsh
 # vim:ft=zsh
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/.zsh/grml-etc-core b/.zsh/grml-etc-core
new file mode 160000 (submodule)
index 0000000..c5383b1
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c5383b10d449697922b6da3262b63a95ed5cc83d
index 65c9532d19b35fec27061b71a9feee333bdf1d35..c23ad42773ecedce0d7249cade478747871e9feb 100644 (file)
@@ -9,31 +9,29 @@
 #
 
 __log() {
 #
 
 __log() {
+  setopt localoptions noxtrace
   local level; level="$1"; shift
   echo "${level}: $@" >&2
 }
 __do_debug() {
   local level; level="$1"; shift
   echo "${level}: $@" >&2
 }
 __do_debug() {
+  setopt localoptions noxtrace
   [ -n "${ZDEBUG:-}" ]
 }
 zerror() {
   [ -n "${ZDEBUG:-}" ]
 }
 zerror() {
-  [[ -o xtrace ]] && set +x && local __XTRACE=1
+  setopt localoptions noxtrace
   __log E "$@"
   __log E "$@"
-  [ "${__XTRACE:-}" ] && set -x
 }
 zwarn() {
 }
 zwarn() {
-  [[ -o xtrace ]] && set +x && local __XTRACE=1
+  setopt localoptions noxtrace
   __log W "$@"
   __log W "$@"
-  [ "${__XTRACE:-}" ] && set -x
 }
 zinfo() {
 }
 zinfo() {
-  [[ -o xtrace ]] && set +x && local __XTRACE=1
+  setopt localoptions noxtrace
   __log I "$@"
   __log I "$@"
-  [ "${__XTRACE:-}" ] && set -x
 }
 zdebug() {
 }
 zdebug() {
-  [[ -o xtrace ]] && set +x && local __XTRACE=1
+  setopt localoptions noxtrace
   __do_debug && __log D "$@"
   __do_debug && __log D "$@"
-  [ "${__XTRACE:-}" ] && set -x
 }
 
 # vim:ft=zsh
 }
 
 # vim:ft=zsh
diff --git a/.zsh/oh-my-zsh b/.zsh/oh-my-zsh
new file mode 160000 (submodule)
index 0000000..b908fee
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit b908feebcfb0ca8a9a80360d177e716c24c317d6
index cae94672df05740449553278936e699e6bdd0538..9b9803d03d051573a27d307cecb8fa9b3946480b 100644 (file)
@@ -20,7 +20,6 @@ sourcedir() {
     case "$f" in
       *~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;;
       *-BREAK_HERE)
     case "$f" in
       *~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;;
       *-BREAK_HERE)
-        zinfo "Breaking out of sourcing file in '$1' due to file '${f##*/}'…"
         break;;
     esac
 #    zdebug "  sourcing file $f"
         break;;
     esac
 #    zdebug "  sourcing file $f"
index 621fafbbacb852c72c8e13eaa9c0ea37cc323454..d3292f478b9626d1cf87fdc7982c2c5e003085e1 100644 (file)
--- a/.zsh/util
+++ b/.zsh/util
@@ -12,4 +12,22 @@ is_root() {
   test ${EUID:?} -eq 0
 }
 
   test ${EUID:?} -eq 0
 }
 
+array_prepend() {
+  local arrayname="$1"; shift
+  local i
+  for i; do
+    eval "$arrayname=(\$i \${$arrayname[@]/\$i})"
+  done
+}
+
+array_append() {
+  local arrayname="$1"; shift
+  local i
+  for i; do
+    eval "$arrayname=(\${$arrayname[@]/\$i} \$i)"
+  done
+}
+
+function trace() { ( eval "set -x; $@"; ) }
+
 # vim:ft=zsh
 # vim:ft=zsh
diff --git a/.zsh/zlogin/01-BREAK_HERE b/.zsh/zlogin/01-BREAK_HERE
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.zsh/zlogin/90_db b/.zsh/zlogin/90_db
deleted file mode 100644 (file)
index ba32ce5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# zlogin/90_db
-#
-# print today's reminder items
-#
-# Copyright © 1994–2013 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-if whence db >/dev/null; then
-  cnt=0
-  db -md1 | while read line; do
-    [ -n "$line" ] || continue
-    if [ $cnt -eq 0 ]; then
-      cnt=$((cnt+1))
-      echo "*** $line"
-    else
-      echo "$line"
-    fi
-  done
-  [ $cnt -gt 0 ] && echo
-fi
-
-# vim:ft=zsh
diff --git a/.zsh/zlogout/01-BREAK_HERE b/.zsh/zlogout/01-BREAK_HERE
deleted file mode 100644 (file)
index e69de29..0000000
similarity index 93%
rename from .zsh/zlogout/99_cls
rename to .zsh/zlogout/99-clear_screen
index df019716f3c26a5460ae55b6202720c89ce4e40d..b504821751fd97ca44079caca19c3e466d9b61a3 100644 (file)
@@ -1,4 +1,3 @@
-# zlogout/99_cls
 #
 # clear the screen
 #
 #
 # clear the screen
 #
similarity index 76%
rename from .zsh/zprofile/00_ulimit
rename to .zsh/zprofile/00-disable-core-dumps
index 6754893d9d6126c5637842d16b15b8b7330dec54..597dd41f785bd73044fc67a8274cb7000aeae43a 100644 (file)
@@ -1,6 +1,5 @@
-# zprofile/00_ulimit
 #
 #
-# sets process limits
+# disable core dumps
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
@@ -8,7 +7,6 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-# disable core files
 ulimit -c 0
 
 # vim:ft=zsh
 ulimit -c 0
 
 # vim:ft=zsh
diff --git a/.zsh/zprofile/01-BREAK_HERE b/.zsh/zprofile/01-BREAK_HERE
deleted file mode 100644 (file)
index e69de29..0000000
similarity index 98%
rename from .zsh/zprofile/10_locale
rename to .zsh/zprofile/10-locales
index 4f37e091a20394aba18f7cb654c47f8c3bca3e86..ef23bf109f1175b051dd8ab6415657d2d83dfa97 100644 (file)
@@ -1,4 +1,3 @@
-# zprofile/10_locale
 #
 # Defines locale settings
 #
 #
 # Defines locale settings
 #
@@ -118,7 +117,7 @@ if [ -x =locale ]; then
   unset _LOCALE
 fi
 
   unset _LOCALE
 fi
 
-export LANGUAGE="${LANG}:en"
+export LANGUAGE="${LANG}:${LANG%_*}"
 
 unfunction _set_regional_locale
 unfunction _set_locale
 
 unfunction _set_regional_locale
 unfunction _set_locale
similarity index 69%
rename from .zsh/zshenv/40_editor
rename to .zsh/zprofile/10-umask
index d97c647776d79ee11b23ed994518c804ea9c4887..ced69c6caecd0fa19c81456c9ba9bf4ec6e824f4 100644 (file)
@@ -1,6 +1,5 @@
-# zshenv/40_editor
 #
 #
-# set the editor variables
+# Defines a basic, restrictive umask
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
@@ -8,7 +7,6 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-export EDITOR==vim
-export VISUAL=$EDITOR
+umask 0077
 
 # vim:ft=zsh
 
 # vim:ft=zsh
diff --git a/.zsh/zprofile/40_zcompile b/.zsh/zprofile/40_zcompile
deleted file mode 100644 (file)
index ebc4ee7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# zlogin/40_zcompile
-#
-# compile zsh snippets
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-if [ -n "$ZDOTDIR" ] && [ -d "$ZDOTDIR" ]; then
-  rm -f $ZDOTDIR/**/*.zwc{,.old}(D.N)
-  for f in $ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.); do
-    case "$f:t" in
-      .gitignore|.*.sw?) continue;;
-    esac
-    zcompile $f
-  done
-fi
-
-if [ -n "$ZVARDIR" ] && [ -d "$ZVARDIR" ]; then
-  rm -f $ZVARDIR/**/*.zwc{,.old}(.N)
-  for f in $ZVARDIR/comp*(.N); do
-    case "$f:t" in
-      .gitignore|.*.sw?) continue;;
-    esac
-    zcompile $f
-  done
-fi
-
-# vim:ft=zsh
diff --git a/.zsh/zshenv/00-apath b/.zsh/zshenv/00-apath
new file mode 100644 (file)
index 0000000..36ec84e
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Adds local alias directory to $apath
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+typeset -gaU apath
+
+for ad in $ZDOTDIR/aliases; do
+  [ -d "$ad" ] && array_prepend apath "$ad"
+done
+
+# vim:ft=zsh
diff --git a/.zsh/zshenv/00-dhpath b/.zsh/zshenv/00-dhpath
new file mode 100644 (file)
index 0000000..e98e95b
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Adds local dirhashes directory to $dhpath
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+typeset -gaU dhpath
+
+for dh in $ZDOTDIR/dirhashes; do
+  [ -d "$dh" ] && array_prepend dhpath "$dh"
+done
+
+# vim:ft=zsh
similarity index 70%
rename from .zsh/zshenv/01_fpath
rename to .zsh/zshenv/00-fpath
index 0a1253a36418ceb25c387d4dbb067e5a7d650022..d5ad792eff3572d5e1d6651d15e478e756bf6e32 100644 (file)
@@ -1,4 +1,3 @@
-# zshenv/00_fpath
 #
 # Adds local functions directory to $fpath
 #
 #
 # Adds local functions directory to $fpath
 #
@@ -8,6 +7,10 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-fpath=($ZDOTDIR/func $fpath)
+typeset -gU fpath FPATH
+
+for fd in $ZDOTDIR/func; do
+  [ -d "$fd" ] && array_prepend fpath "$fd"
+done
 
 # vim:ft=zsh
 
 # vim:ft=zsh
diff --git a/.zsh/zshenv/00-path b/.zsh/zshenv/00-path
new file mode 100644 (file)
index 0000000..a25a6b5
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Adds custom directories to the $PATH
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+typeset -gU path PATH
+
+for bd in $HOME/bin $HOME/.bin; do
+  [ -d "$bd" ] && array_prepend path "$bd"
+done
+
+# vim:ft=zsh
diff --git a/.zsh/zshenv/00-tmpdir b/.zsh/zshenv/00-tmpdir
new file mode 100644 (file)
index 0000000..be817b5
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Define $TMPDIR and other stuff related to temporary files
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+export TMPDIR="/tmp/${(%):-%n}"
+mkdir --mode=700 --parent "${TMPDIR}"
+
+typeset -l LTMPDIR="${HOME}/.tmp"
+if [ -d $LTMPDIR ]; then
+  typeset -l VOLATILE="${LTMPDIR}/volatile"
+  [ -L "$VOLATILE" ] || ln -snfT "$TMPDIR" "$VOLATILE"
+  nTMPDIR=$LTMPDIR
+fi
+
+TMPPREFIX="${TMPDIR}/zsh"
+
+# vim:ft=zsh
diff --git a/.zsh/zshenv/00-zvardir b/.zsh/zshenv/00-zvardir
new file mode 100644 (file)
index 0000000..17b7aa8
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Define $ZVARDIR as the location where to store variable files
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+if [ -d $HOME/.var ]; then
+  export VARDIR=$HOME/.var
+  ZVARDIR=$VARDIR/zsh
+  mkdir --parent $ZVARDIR
+else
+  ZVARDIR=$ZDOTDIR
+fi
+
+# vim:ft=zsh
diff --git a/.zsh/zshenv/00_rdirs b/.zsh/zshenv/00_rdirs
deleted file mode 100644 (file)
index 03ad8c2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# zshenv/00_rdirs
-#
-# Assigns paths to related directories to a number of variables 
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-export VARDIR_REL=.var
-export VARDIR=$HOME/$VARDIR_REL
-export ZVARDIR=$VARDIR/zsh
-
-export BINDIR_REL=.bin
-export BINDIR=$HOME/$BINDIR_REL
-
-export TMPDIR_REL=.tmp
-export TMPDIR=$HOME/$TMPDIR_REL
-mkdir --mode=0700 --parent "$(readlink -f $TMPDIR)"
-
-# vim:ft=zsh
diff --git a/.zsh/zshenv/01-BREAK_HERE b/.zsh/zshenv/01-BREAK_HERE
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.zsh/zshenv/01_path b/.zsh/zshenv/01_path
deleted file mode 100644 (file)
index ab1625e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# zprofile/00_path
-#
-# Adds custom directories to the $PATH
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-__prepend_dir_to_path()
-{
-  local dir
-  for dir; do
-    case "$PATH" in
-      "*:${dir}:*"|"${dir}:*"|"*:${dir}") :;;
-      *) test -d "$dir" && path=("$dir" $path);;
-    esac
-  done
-}
-
-__append_dir_to_path()
-{
-  local dir
-  for dir; do
-    case "$PATH" in
-      "*:${dir}:*"|"${dir}:*"|"*:${dir}") :;;
-      *) test -d "$dir" && path+="$dir";;
-    esac
-  done
-}
-
-__prepend_dir_to_path $BINDIR
-__append_dir_to_path /usr/lib/surfraw
-
-# vim:ft=zsh
diff --git a/.zsh/zshenv/10_zvars b/.zsh/zshenv/10_zvars
deleted file mode 100644 (file)
index edbe4b7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# zshenv/10_zvars
-#
-# set a number of core zsh variables
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-# use $TMPDIR for TMPPREFIX
-TMPPREFIX="$TMPDIR/zsh"
-
-# vim:ft=zsh
diff --git a/.zsh/zshenv/80_debian b/.zsh/zshenv/80_debian
deleted file mode 100644 (file)
index 511ce65..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# zshenv/80_debian
-#
-# set a number of default variables related to Debian
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-export DEBFULLNAME='martin f. krafft'
-export DEBEMAIL=madduck@debian.org
-export DEBKEYID=55c9882d999bbcc4
-
-if [[ -z "$debian_chroot" && -r /etc/debian_chroot ]]; then
-  export debian_chroot="$(</etc/debian_chroot)"
-fi
-
-# vim:ft=zsh
diff --git a/.zsh/zshenv/80_pagers b/.zsh/zshenv/80_pagers
deleted file mode 100644 (file)
index ee2eb73..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# zshenv/80_pagers
-#
-# set a number of default variables related to pagers
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-eval `lesspipe 2>/dev/null`
-LESS='--no-init --hilite-search --SILENT'
-export LESS
-
-export LESSHISTFILE=~/.var/less/history
-[[ -d ${LESSHISTFILE%/*} ]] || mkdir --parent ${LESSHISTFILE%/*}
-
-# vim:ft=zsh
diff --git a/.zsh/zshenv/80_texmf b/.zsh/zshenv/80_texmf
deleted file mode 100644 (file)
index 8109661..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# zshenv/80_texmf
-#
-# set a number of default variables related to texmf
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-export TEXMFHOME=$HOME/.texmf
-export TEXMFCONFIG=$TEXMFHOME
-export TEXMFVAR=$VARDIR/texmf
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/00-autoload_executables_in_fpath b/.zsh/zshrc/00-autoload_executables_in_fpath
new file mode 100644 (file)
index 0000000..7f32c96
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Autoload functions from executable files in $fpath
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+autoload -U $^fpath/*(.xN:t)
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/00-load_alias-d b/.zsh/zshrc/00-load_alias-d
new file mode 100644 (file)
index 0000000..d2683e7
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# Turn files in $apath directories into aliases
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+function make_alias {
+  emulate -L zsh
+  setopt extendedglob
+  local fn="${1:t}" s
+  for l in ${(f)"$(<$1)"}; do
+    case "$s/$l" in
+      (*/\#*) continue;;
+      (/*) eval "alias $fn='${l//\$0/$fn}'"; s=s;;
+      (s/(#b)(*)) eval "$match[1]";;
+    esac
+  done
+}
+
+for ad in $apath; do
+  if [ ! -d "$ad" ]; then
+    zerror "no such directory: $ad"
+    continue
+  fi
+
+#  zdebug "sourcing alias directory ${ad#$ZDOTDIR/}"
+  for f in "$ad"/*(N.,@); do
+    case "$f" in
+      *~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;;
+    esac
+    make_alias "$f"
+  done
+done
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/00-load_dirhashes-d b/.zsh/zshrc/00-load_dirhashes-d
new file mode 100644 (file)
index 0000000..4d91dd0
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Turn symlinks in $dhpath directories into dirhashes
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+for dh in $dhpath; do
+  if [ ! -d "$dh" ]; then
+    zerror "no such directory: $dh"
+    continue
+  fi
+
+#  zdebug "sourcing dirhashes directory ${dh#$ZDOTDIR/}"
+  for l in "$dh"/*(@); do
+    eval hash -d "$l:t"="$l:A"
+  done
+done
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/00_autoload b/.zsh/zshrc/00_autoload
deleted file mode 100644 (file)
index e6b4591..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# zshrc/00_autoload
-#
-# Autoload available functions
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-# autoload all executable files in $fpath
-autoload -U $^fpath/*(.xN:t)
-
-# smart xargs replacement
-autoload -U zargs
-
-# programmable moving, copying, and linking
-autoload -U zmv
-
-# make color arrays available
-autoload -U colors ; colors
-
-# use shell builtins for standard file operations
-# disabled due to #479764
-#zmodload zsh/files
-
-# allow zwc file recompiling
-autoload -U zrecompile
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/00_recompile b/.zsh/zshrc/00_recompile
deleted file mode 100644 (file)
index 062cfef..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# zshrc/00_zrecompile
-#
-# recompile zsh snippets, if necessary
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-zrecompile $ZDOTDIR/**/*(/N) $ZVARDIR/**/*(/N) | while read pre file post; do
-    case "$post" in
-      succeeded*) rm -f "${file%:}".old;;
-      *) :;;
-    esac
-    info "$pre ${file##$HOME/} $post"
-  done
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/00_varsetup b/.zsh/zshrc/00_varsetup
deleted file mode 100644 (file)
index 7bc2a50..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# zshrc/00_varsetup
-#
-# set up global variables used by the shell
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-# automatically remove duplicates from these arrays
-typeset -gU path cdpath fpath manpath fignore
-
-# http://xanana.ucsc.edu/~wgscott/wordpress_new/wordpress/?p=12
-typeset -ga preexec_functions
-typeset -ga precmd_functions
-typeset -ga chpwd_functions
-
-__chpwd_run_first()
-{
-  [[ -n $__CHPWD_RUN_FIRST ]] || return
-  eval "$__CHPWD_RUN_FIRST"
-}
-chpwd_functions+=__chpwd_run_first
-
-# warn on accidental creation of global variables
-# unset for now until we work out the corner cases, like warning about $reply
-# and $HISTFILE or $REPORTTIME.
-#setopt warn_create_global
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/01-BREAK_HERE b/.zsh/zshrc/01-BREAK_HERE
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.zsh/zshrc/01-background_job_options b/.zsh/zshrc/01-background_job_options
new file mode 100644 (file)
index 0000000..4b574fa
--- /dev/null
@@ -0,0 +1,25 @@
+#
+# Set options related to background jobs
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+# report immediately when background jobs finish
+setopt notify
+
+# do not auto-nice background processes
+setopt no_bgnice
+
+# do not send HUP signal to jobs when the shell exits
+setopt nohup
+
+# do alert me of running jobs before exiting
+setopt checkjobs
+
+# display PID when suspending processes as well
+setopt longlistjobs
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/01-basic_options b/.zsh/zshrc/01-basic_options
new file mode 100644 (file)
index 0000000..146d559
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# Set basic options
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+# Warn on accidental creation of global variables
+setopt warn_create_global
+
+# Extended globbing. Why would you not want this?
+setopt extended_glob
+
+# If a pattern for filename generation has no matches, leave it unchanged in
+# the argument list.
+setopt no_nomatch
+
+# Prevent redirection from trunacting existing files.
+setopt no_clobber
+
+# Try to correct the spelling of commands
+setopt correct
+
+# use 0xXX and 0XX output instead of 16#XX/8#XX
+setopt c_bases
+
+# disable backslashed escape sequences unless -e is given to echo·
+setopt bsd_echo
+
+# handy script to query options
+autoload -U allopt
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/02-colors_setup b/.zsh/zshrc/02-colors_setup
new file mode 100644 (file)
index 0000000..9c04457
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Set up the colors array
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+autoload -U colors
+colors
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/02-dircolors b/.zsh/zshrc/02-dircolors
new file mode 100644 (file)
index 0000000..fe78a72
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# Load dircolors database
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+eval $(dircolors $ZDOTDIR/dircolors) 2>/dev/null || :
+
+if [ -n "$LS_COLORS" ]; then
+  # uniquify LS_COLORS due to #479544
+
+  local pair key
+  typeset -A pairs
+  for pair in ${(s.:.)LS_COLORS}; do
+    [ -z "${pair%%\=*}" ] && continue
+    pairs["${pair%%\=*}"]="${pair#*=}"
+  done
+
+  typeset -a items
+  for key in ${(k)pairs}; do
+    [ "$pairs[$key]" = 00 ] && continue #removes styles handled by normal
+    items+="${(Q)key}=$pairs[$key]"
+  done
+  LS_COLORS="${(j.:.)items}:"
+else
+  # fallback
+  export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:di=01;30:ln=target:ex=00;34:*.tar=00;31:*.tgz=00;31:*.arc=00;31:*.arj=00;31:*.taz=00;31:*.lha=00;31:*.lz4=00;31:*.lzh=00;31:*.lzma=00;31:*.tlz=00;31:*.txz=00;31:*.tzo=00;31:*.t7z=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.dz=00;31:*.gz=00;31:*.lrz=00;31:*.lz=00;31:*.lzo=00;31:*.xz=00;31:*.zst=00;31:*.tzst=00;31:*.bz2=00;31:*.bz=00;31:*.tbz=00;31:*.tbz2=00;31:*.tz=00;31:*.deb=00;31:*.rpm=00;31:*.jar=00;31:*.war=00;31:*.ear=00;31:*.sar=00;31:*.rar=00;31:*.alz=00;31:*.ace=00;31:*.zoo=00;31:*.cpio=00;31:*.7z=00;31:*.rz=00;31:*.cab=00;31:*.jpg=00;35:*.jpeg=00;35:*.mjpg=00;35:*.mjpeg=00;35:*.gif=00;35:*.bmp=00;35:*.pbm=00;35:*.pgm=00;35:*.ppm=00;35:*.tga=00;35:*.xbm=00;35:*.xpm=00;35:*.tif=00;35:*.tiff=00;35:*.png=00;35:*.svg=00;35:*.svgz=00;35:*.mng=00;35:*.pcx=00;35:*.mov=00;35:*.mpg=00;35:*.mpeg=00;35:*.m2v=00;35:*.mkv=00;35:*.webm=00;35:*.ogm=00;35:*.mp4=00;35:*.m4v=00;35:*.mp4v=00;35:*.vob=00;35:*.qt=00;35:*.nuv=00;35:*.wmv=00;35:*.asf=00;35:*.rm=00;35:*.rmvb=00;35:*.flc=00;35:*.avi=00;35:*.fli=00;35:*.flv=00;35:*.gl=00;35:*.dl=00;35:*.xcf=00;35:*.xwd=00;35:*.yuv=00;35:*.cgm=00;35:*.emf=00;35:*.ogv=00;35:*.ogx=00;35:';
+fi
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/05-oh-my-zsh.disabled b/.zsh/zshrc/05-oh-my-zsh.disabled
new file mode 100644 (file)
index 0000000..2a3455f
--- /dev/null
@@ -0,0 +1,85 @@
+#
+# Load Oh My Zsh
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+declare -g ZSH=$ZDOTDIR/oh-my-zsh
+declare -g ZSH_CUSTOM=$ZDOTDIR
+
+declare -g ZSH_THEME="madduck"
+declare -g DISABLE_AUTO_UPDATE="true"
+
+declare -g HIST_STAMPS="yyyy-mm-dd"
+
+# workaround for https://github.com/robbyrussell/oh-my-zsh/issues/5971
+declare -g ZSH_DISABLE_COMPFIX ZSH_CACHE_DIR config_file custom_config_file SHORT_HOST ZSH_COMPDUMP
+
+# Uncomment the following line to use case-sensitive completion.
+# CASE_SENSITIVE="true"
+
+# Uncomment the following line to use hyphen-insensitive completion. Case
+# sensitive completion must be off. _ and - will be interchangeable.
+# HYPHEN_INSENSITIVE="true"
+
+# Uncomment the following line to disable bi-weekly auto-update checks.
+
+# Uncomment the following line to change how often to auto-update (in days).
+# export UPDATE_ZSH_DAYS=13
+
+# Uncomment the following line to disable colors in ls.
+# DISABLE_LS_COLORS="true"
+
+# Uncomment the following line to display red dots whilst waiting for completion.
+# COMPLETION_WAITING_DOTS="true"
+
+# Uncomment the following line if you want to disable marking untracked files
+# under VCS as dirty. This makes repository status check for large repositories
+# much, much faster.
+# DISABLE_UNTRACKED_FILES_DIRTY="true"
+
+# Uncomment the following line if you want to change the command execution time
+# stamp shown in the history command output.
+# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
+
+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
+# Example format: plugins=(rails git textmate ruby lighthouse)
+# Add wisely, as too many plugins slow down shell startup.
+# plugins=(git)
+
+source $ZSH/oh-my-zsh.sh
+
+# User configuration
+
+# export MANPATH="/usr/local/man:$MANPATH"
+
+# You may need to manually set your language environment
+# export LANG=en_US.UTF-8
+
+# Preferred editor for local and remote sessions
+# if [[ -n $SSH_CONNECTION ]]; then
+#   export EDITOR='vim'
+# else
+#   export EDITOR='mvim'
+# fi
+
+# Compilation flags
+# export ARCHFLAGS="-arch x86_64"
+
+# ssh
+# export SSH_KEY_PATH="~/.ssh/rsa_id"
+
+# Set personal aliases, overriding those provided by oh-my-zsh libs,
+# plugins, and themes. Aliases can be placed here, though oh-my-zsh
+# users are encouraged to define aliases within the ZSH_CUSTOM folder.
+# For a full list of active aliases, run `alias`.
+#
+# Example aliases
+# alias zshconfig="mate ~/.zshrc"
+# alias ohmyzsh="mate ~/.oh-my-zsh"
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/10-xterm_title b/.zsh/zshrc/10-xterm_title
new file mode 100644 (file)
index 0000000..b695811
--- /dev/null
@@ -0,0 +1,78 @@
+#
+# Fancy setting of the xterm title
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+# Based on http://www.zshwiki.org/cgi-bin/wiki.pl?ZshHardStatus
+#
+
+autoload -U add-zsh-hook
+
+__set_xterm_title() {
+  emulate -L zsh
+  case $TERM in
+    screen)
+      print -nR $'\033k'$1$'\033'\\ 
+      print -nR $'\033]0;'$2$'\a'
+      ;;
+    xterm|rxvt*)
+      print -nR $'\033]0;'$*$'\a'
+      ;;
+  esac
+}
+
+__get_session_flags() {
+  emulate -L zsh
+  [ -n "$SSH_CONNECTION" ] || return
+  local flags
+  [ -n "$DISPLAY" ] && flags+=x
+  [ -n "$SSH_AUTH_SOCK" ] && flags+=a
+  [[ $SSH_CLIENT = *:* ]] && flags+=6
+  [ -n "$flags" ] && echo "[${flags}]"
+}
+
+__get_standard_prompt() {
+  emulate -L zsh
+  [[ -z $SSH_CLIENT ]] || print -nP "%m"
+  print -P "%#%25\<..\<%~ $(__get_session_flags)"
+}
+
+_set_plain_xterm_title() {
+  emulate -L zsh
+  __set_xterm_title "$(__get_standard_prompt)"
+}
+add-zsh-hook precmd _set_plain_xterm_title
+
+_set_cmd_xterm_title () {
+  emulate -L zsh
+  local -a cmd; cmd=(${(z)1})             # Re-parse the command line
+
+  # Construct a command that will output the desired job number.
+  case $cmd[1] in
+    fg) if (( $#cmd == 1 )); then
+          # No arguments, must find the current job
+          cmd=(builtin jobs -l %+)
+        else
+          # Replace the command name, ignore extra args.
+          cmd=(builtin jobs -l ${(Q)cmd[2]})
+        fi;;
+    %*) cmd=(builtin jobs -l ${(Q)cmd[1]});; # Same as "else" above
+    *) # Not resuming a job,
+      __set_xterm_title $cmd[1]:t${cmd[2]:+ }$cmd[2,-1] "| $(__get_standard_prompt)"
+      return;;                        # so we're all done
+  esac
+
+  local -A jt; jt=(${(kv)jobtexts})       # Copy jobtexts for subshell
+
+  # Run the command, read its output, and look up the jobtext.
+  # Could parse $rest here, but $jobtexts (via $jt) is easier.
+  $cmd 2>/dev/null >>(read num rest; cmd=(${(z)${(e):-\$jt$num}};)
+  __set_xterm_title $leader$cmd[1]:t${cmd[2]:+ }$cmd[2,-1] "| $(__get_standard_prompt)"
+)
+}
+add-zsh-hook preexec _set_cmd_xterm_title
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/19_dircolors b/.zsh/zshrc/19_dircolors
deleted file mode 100644 (file)
index 60e24f4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# zshrc/19_dircolors
-#
-# Load dircolors database
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-eval $(dircolors $ZDOTDIR/dircolors) 2>/dev/null || :
-
-if [ -n "$LS_COLORS" ]; then
-  # uniquify LS_COLORS due to #479544
-
-  typeset -A pairs
-  for pair in ${(s.:.)LS_COLORS}; do
-    [ -z "${pair%%\=*}" ] && continue
-    pairs["${pair%%\=*}"]="${pair#*=}"
-  done
-
-  typeset -a items
-  for key in ${(k)pairs}; do
-    [ "$pairs[$key]" = 00 ] && continue #removes styles handled by normal
-    items+="${(Q)key}=$pairs[$key]"
-  done
-  LS_COLORS="${(j.:.)items}:"
-else
-  # fallback
-  LS_COLORS="di=01;30:ln=target:ex=00;34:no=00:fi=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:*.tar=00;31:*.tgz=00;31:*.svgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.dz=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tbz2=00;31:*.tz=00;31:*.deb=00;31:*.rpm=00;31:*.jar=00;31:*.rar=00;31:*.ace=00;31:*.zoo=00;31:*.cpio=00;31:*.7z=00;31:*.rz=00;31:*.jpg=00:*.jpeg=00:*.gif=00:*.bmp=00:*.pbm=00:*.pgm=00:*.ppm=00:*.tga=00:*.xbm=00:*.xpm=00:*.tif=00:*.tiff=00:*.png=00:*.svg=00:*.mng=00:*.pcx=00:*.mov=00:*.mpg=00:*.mpeg=00:*.m2v=00:*.mkv=00:*.ogm=00:*.mp4=00:*.m4v=00:*.mp4v=00:*.vob=00:*.qt=00:*.nuv=00:*.wmv=00:*.asf=00:*.rm=00:*.rmvb=00:*.flc=00:*.avi=00:*.fli=00:*.gl=00:*.dl=00:*.xcf=00:*.xwd=00:*.yuv=00:*.aac=00:*.au=00:*.flac=00:*.mid=00:*.midi=00:*.mka=00:*.mp3=00:*.mpc=00:*.ogg=00:*.ra=00:*.wav=00"
-fi
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/20-autoload_zsh_file_manipulation_functions b/.zsh/zshrc/20-autoload_zsh_file_manipulation_functions
new file mode 100644 (file)
index 0000000..1cdcb93
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Autoload some smart replacements of common functionality implemented in zsh
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+# smart xargs replacement
+autoload -U zargs
+
+# programmable moving, copying, and linking
+autoload -U zmv
+
+alias zmv='noglob zmv'
+alias mmv='zmv -W'
+alias zcp='zmv -C'
+alias zln='zmv -L'
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/20-tempfile+dir_functions b/.zsh/zshrc/20-tempfile+dir_functions
new file mode 100644 (file)
index 0000000..5288098
--- /dev/null
@@ -0,0 +1,103 @@
+#
+# Helper functions for temporary files, directories, and pastebining
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+cdt() {
+  emulate -L zsh
+  REPLY=$(mktemp -td ${1:-cdt}.XXXXXX)
+  builtin cd $REPLY
+  rm -f ${TMPDIR:-/tmp}/cdt.latest
+  ln -s $REPLY ${TMPDIR:-/tmp}/cdt.latest
+}
+
+_cdt() {
+  cdt "$@"
+  zle reset-prompt
+  zle -M "$REPLY"
+}
+zle -N _cdt
+bindkey '\ed' _cdt
+
+vit() {
+  emulate -L zsh
+  local prefix i
+  for i in "$@"; do
+    case "$i" in
+      -) local stdin=1; shift;;
+      *) if [ -z "${prefix:-}" ]; then
+           prefix="$i"; shift
+         else
+           zwarn "prefix $prefix already specified, skipping: $i"
+         fi
+         ;;
+    esac
+  done
+  REPLY=$(mktemp -t ${prefix:-vit}-XXXXXX.txt)
+  [ -n "$stdin" ] && cat >| $REPLY
+  sensible-editor +start $REPLY </dev/tty >/dev/tty
+  ln -sf $REPLY ${TMPDIR:-/tmp}/vit.latest
+}
+_vit() {
+  vit "$@"
+  zle reset-prompt
+  zle -M "$REPLY"
+}
+zle -N _vit
+bindkey '\ef' _vit
+
+pastebin() {
+  local target="${(%):-"%D{%F-%H%M%S}"}-${1##*/}"
+  pub "${1}==${target}" 2>&1
+}
+
+_pastebinit() {
+  emulate -L zsh
+  if [[ -f "$REPLY" ]]; then
+    read -q "yesno?\rShould I paste the file $REPLY? [yN] "
+    zle reset-prompt
+  else
+    vit paste
+    yesno=y
+  fi
+  if [[ ${yesno:-n} == y ]]; then
+    zle -cR "pasting $REPLY …"
+    REPLY=$(pastebin "${REPLY}")
+    zle -M "$REPLY"
+  fi
+}
+zle -N _pastebinit
+bindkey '\ep' _pastebinit
+
+_copy_reply() {
+  if [[ -n "$REPLY" ]]; then
+    if (( $+commands[xclip] )); then
+      echo -En "$REPLY" | xclip -in
+      zle -M "Copied to primary clipboard: $REPLY"
+    else
+      zle -M "Cannot copy to clipboard, xclip command not found"
+    fi
+  else
+    zle -M "Nothing to copy, \$REPLY is empty"
+  fi
+}
+zle -N _copy_reply
+bindkey '\ec' _copy_reply
+
+TS() {
+  local topic ret quiet
+  typeset -g REPLY
+  topic="${(j:_:)@}"
+  REPLY="${TMPDIR:-/tmp}/script.${topic:-$LOGNAME}.$$.${(%):-"%D{%Y%m%d.%H%M}"}"
+  PS1="
+%# " RPS1= script -qe -c "zsh -f" -f "$REPLY"
+  ret=$?
+  zinfo "typescript is in $REPLY ."
+  return $ret
+}
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/20_compsys b/.zsh/zshrc/20_compsys
deleted file mode 100644 (file)
index 7229d9a..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-# zshrc/20_compsys
-#
-# Configures the completions system
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-zstyle :compinstall filename '$ZDOTDIR/zshrc/20_compsys'
-
-# automatically list choices on an ambiguous completion
-setopt auto_list
-
-# use menu after the second completion request
-setopt auto_menu
-
-# recognise exact matches even if they're ambiguous
-setopt rec_exact
-
-# move cursor to end of word being completed
-setopt always_to_end
-
-# correct the command if mistyped
-setopt correct
-
-# correct all arguments, not just the command
-#setopt correctall
-
-# be magic about adding/removing final characters on tab completion
-setopt auto_param_keys auto_param_slash auto_remove_slash
-
-# load fancy completion list and menu handler
-zmodload zsh/complist
-
-# initialise the completion system
-autoload -U compinit
-compinit -d $ZVARDIR/comp-$HOST
-
-# cache results
-zstyle ':completion:*' use-cache on
-zstyle ':completion:*' cache-path $ZVARDIR/compcache
-
-#zstyle ':completion:*' completer _list _expand _complete _ignored _match _correct _approximate _prefix
-zstyle ':completion:*' completer _complete _ignored _match _correct _approximate
-
-# allow cursor-key navigation through completion set
-zstyle ':completion:*:*:*:*' menu select
-
-# use colours in completion lists and menus
-zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
-
-# ignore working and backup copies, and compiled objects
-zstyle ':completion:*:(all-|)files' ignored-patterns \
-  '*.bk' '*.bak' '*.old' '*~' '.*.sw?' '*.o' '*.pyc'
-
-zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) not-numeric )'
-zstyle -e ':completion:*:correct:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/2)) numeric )'
-#zstyle ':completion:*:correct:::' max-errors 1 not-numeric
-#zstyle ':completion:*:approximate:::' max-errors 2 numeric
-
-#zstyle ':completion:*' list-suffixes true
-#zstyle ':completion:*' match-original both
-#zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
-#zstyle ':completion:*:match:*' original only
-#zstyle ':completion:*' original true
-#zstyle ':completion:*' squeeze-slashes true
-
-# functions which start with _ are internal and ignored
-zstyle ':completion:*:functions' ignored-patterns '_*'
-
-# do not offer files already specified on the line
-zstyle ':completion:*:rm:*' ignore-line yes
-
-#zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
-#zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}
-
-# ignore current directory when completing in ../
-#zstyle ':completion:*:cd:*' ignore-parents parent pwd
-zstyle ':completion:*' ignore-parents parent pwd
-
-# http://xana.scru.org/2005/08/20#ignorelatexjunk
-zstyle -e ':completion:*:*:vim#:*:*' ignored-patterns \
-  'texfiles=$(echo ${PREFIX}*.tex); [[ -n "$texfiles" ]] &&
-  reply=(*.(aux|dvi|log|ps|pdf|bbl|toc|lot|lof|latexmain)) || reply=()'
-
-# http://madism.org/~madcoder/dotfiles/zsh/40_completion
-zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"'
-
-# commands that take commands as arguments
-compdef _precommand gdb
-compdef _precommand nohup
-compdef _precommand strace
-
-zstyle ':completion:*' verbose yes
-zstyle ':completion:*:descriptions' format '%B%d%b'
-zstyle ':completion:*:messages' format '%d'
-zstyle ':completion:*:warnings' format 'no matches for: %d'
-zstyle ':completion:*' group-name ''
-
-# #527301
-zstyle :completion::complete:xmms2:\*:values list-grouped false
-zstyle :completion::complete:xmms2:\*:values sort false
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/20_dirhashes b/.zsh/zshrc/20_dirhashes
deleted file mode 100644 (file)
index fc77e8a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# zshrc/20_dirhashes
-#
-# populate some hashes for commonly used directories
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-hash -d doc=/usr/share/doc
-hash -d log=/var/log
-hash -d deb=/var/cache/apt/archives
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/30-chmod+chown_aliases b/.zsh/zshrc/30-chmod+chown_aliases
new file mode 100644 (file)
index 0000000..9d42db2
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Common aliases for chmod/chown/chgrp
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+typeset -la common_perms=(rw- rwx r-- r-x r-s rws)
+local perm
+for perm in $common_perms; do
+  eval alias $perm="'chmod $perm'"
+done
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/30-ls_aliases b/.zsh/zshrc/30-ls_aliases
new file mode 100644 (file)
index 0000000..4c373fb
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Common aliases for ls
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+alias l='ls --time-style=+%Y-%m-%d-%H:%M -gG'
+alias ll='ls -l'
+alias la='ls -a'
+alias lla='ls -la'
+alias lt='ls -lt'
+alias lrt='ls -lrt'
+alias lat='ls -lat'
+alias lart='ls -lart'
+# List only directories and symbolic links that point to directories
+alias lsd='ll -d *(-/DN)'
+
+# vim:ft=zsh
similarity index 62%
rename from .zsh/zshrc/30_aliases
rename to .zsh/zshrc/30_aliases.disabled
index 9614b2555d8bc91a5e35db1778df40eec41e365d..9b1039030ee9f99d46641dc2d38e8ece50de90a0 100644 (file)
@@ -8,82 +8,6 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-function trace() { eval "set -x; $@" }
-
-alias mv='nocorrect mv'
-alias cp='nocorrect cp'
-alias ln='nocorrect ln'
-alias mkdir='nocorrect mkdir'
-alias rm='nocorrect rm'
-
-alias find='noglob find'
-alias w3m='noglob w3m -no-mouse'
-alias links='noglob links'
-alias wb='noglob www-browser'
-alias wget='noglob wget'
-alias curl='noglob curl'
-alias apt-cache='noglob apt-cache'
-alias locate='noglob locate'
-
-local _USER_AGENT="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-2)"
-alias swget="noglob wget --user-agent='$USER_AGENT'"
-
-typeset -a _ls_opts; _ls_opts=(-bC --color=auto)
-command ls --group-directories-first >/dev/null 2>&1 \
-  && _ls_opts+=--group-directories-first
-# I prefer POSIX collation for ls
-alias ls="LC_COLLATE=POSIX ls $_ls_opts"
-
-alias l='ls --time-style=+%Y-%m-%d-%H:%M -gG'
-alias ll='ls -l'
-alias la='ls -a'
-alias lla='ls -la'
-alias lt='ls -lt'
-alias lrt='ls -lrt'
-alias lat='ls -lat'
-alias lart='ls -lart'
-# List only directories and symbolic links that point to directories
-alias lsd='ll -d *(-/DN)'
-
-alias lscontext=ls
-cd () { __CHPWD_RUN_FIRST=lscontext && builtin cd "$@" && unset __CHPWD_RUN_FIRST }
-#_cd_l() { ll }
-#chpwd_functions+=_cd_l
-
-# #183394
-alias w='w|cat'
-
-alias -g ND='*(/om[1])' # newest directory
-alias -g NF='*(.om[1])' # newest file
-
-alias egrep='egrep --color=auto -d skip -D skip'
-alias fgrep='fgrep --color=auto -d skip -D skip'
-alias grep='grep --color=auto -d skip -D skip'
-
-alias mmv='noglob zmv -W'
-alias zcp='zmv -C'
-alias zln='zmv -L'
-alias zgmv='zmv -p git-mv'
-
-alias cal='cal -3'
-alias ftp=lftp
-
-alias mbug='bts show --mbox'
-alias bug='BROWSER=www-browser bts show'
-
-edalias() {
-  [[ -z "$1" ]] && { echo "Usage: edalias <alias_to_edit>" ; return 1 } || vared aliases'[$1]' ;
-}
-compdef _aliases edalias
-
-edfunc() {
-  [[ -z "$1" ]] && { echo "Usage: edfunc <function_to_edit>" ; return 1 } || zed -f "$1" ;
-}
-compdef _functions edfunc
-
-doc() { cd /usr/share/doc/$1 }
-compdef '_files -W /usr/share/doc -/' doc
-
 alias giti='git init && git add . && git commit -minitial\ checkin && git tag orig'
 gbs() {
   local branch; branch="$(git symbolic-ref -q HEAD)"; branch="${branch##*/}"
 alias giti='git init && git add . && git commit -minitial\ checkin && git tag orig'
 gbs() {
   local branch; branch="$(git symbolic-ref -q HEAD)"; branch="${branch##*/}"
@@ -123,33 +47,8 @@ function lgrep() {
   eval egrep "'$pattern'" "~log/${(j: ~log/:)@}"
 }
 
   eval egrep "'$pattern'" "~log/${(j: ~log/:)@}"
 }
 
-alias px='ps afux'
-alias mps='ps -ao user,pcpu,start,command'
-
-function of() { lsof -np "$1" }
-compdef _pids of
-
 function psgrep() { ps aux | grep "[${1[1]}]${1[2,-1]}" }
 
 function psgrep() { ps aux | grep "[${1[1]}]${1[2,-1]}" }
 
-alias rw-='chmod 600'
-alias rwx='chmod 700'
-alias r--='chmod 644'
-alias r-x='chmod 755'
-alias r-s='chmod 2755'
-alias rws='chmod 2775'
-
-alias bofh='fortune bofh-excuses'
-
-autoload -U baseconv
-alias b2d='baseconv 2 10'
-alias d2b='baseconv 10 2'
-alias d2h='baseconv 10 16'
-alias h2d='baseconv 16 10'
-alias d2o='baseconv 10 8'
-alias d2o='baseconv 10 8'
-alias h2b='baseconv 16 2'
-alias b2h='baseconv 2 16'
-
 alias sendmail=/usr/sbin/sendmail
 
 _d() { dict $* }
 alias sendmail=/usr/sbin/sendmail
 
 _d() { dict $* }
@@ -174,8 +73,6 @@ for l in ${(k)_LANGUAGES}; do
 done
 unset _LANGUAGES
 
 done
 unset _LANGUAGES
 
-alias dpkg-buildpackage="dpkg-buildpackage -k$DEBKEYID -rfakeroot"
-
 bugsub() { echo X-debbugs-autosubscribe: madduck | sendmail -f $DEBEMAIL ${1:?No bug number}-subscribe@bugs.debian.org }
 bugunsub() { sendmail -f $DEBEMAIL ${1:?No bug number}-unsubscribe@bugs.debian.org </dev/null }
 ptssub() { echo subscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
 bugsub() { echo X-debbugs-autosubscribe: madduck | sendmail -f $DEBEMAIL ${1:?No bug number}-subscribe@bugs.debian.org }
 bugunsub() { sendmail -f $DEBEMAIL ${1:?No bug number}-unsubscribe@bugs.debian.org </dev/null }
 ptssub() { echo subscribe ${1:?E: no package name given.} | sendmail -f ${2:-$DEBEMAIL} pts@qa.debian.org }
diff --git a/.zsh/zshrc/39_tempfuncs b/.zsh/zshrc/39_tempfuncs
deleted file mode 100644 (file)
index 938b173..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# zshrc/40_tempfuncs
-#
-# Helper functions to create temporary files and directories
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-cdt () {
-  local tmpdir
-  tmpdir=$(mktemp -td ${1:-cdt}.XXXXXX)
-  builtin cd $tmpdir
-  pwd
-  rm -f ${TMPDIR:-/tmp}/cdt.latest
-  ln -s $tmpdir ${TMPDIR:-/tmp}/cdt.latest
-}
-
-vit () {
-  local prefix
-  for i in "$@"; do
-    case "$i" in
-      -) local stdin=1; shift;;
-      *) if [ -z "${prefix:-}" ]; then
-           prefix="$i"; shift
-         else
-           error "prefix already specified: $prefix"
-           return 1
-         fi
-         ;;
-    esac
-  done
-  local tmpfile=$(mktemp -t ${prefix:-vit}.XXXXXX)
-  [ -n "$stdin" ] && cat >| $tmpfile
-  sensible-editor $tmpfile </dev/tty >/dev/tty
-  echo $tmpfile
-  ln -sf $tmpfile ${TMPDIR:-/tmp}/vit.latest
-}
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/40-baseconv b/.zsh/zshrc/40-baseconv
new file mode 100644 (file)
index 0000000..b180e22
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# zsh-based conversion between numeric bases
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+function baseconv() {
+  if [ $# -ne 3 ]; then
+    echo Usage: ${0##*/} ibase obase number
+    return 1
+  fi
+
+  typeset -li $2 var
+  eval ((var=${1}#${3}))
+  echo ${var#*\#}
+}
+
+typeset -lA bases=(b 2 o 8 d 10 h 16)
+typeset -l {k,v}{1,2}
+for k1 v1 in ${(kv)bases}; do
+  for k2 v2 in ${(kv)bases}; do
+    [[ $k1 == $k2 ]] && continue
+    eval alias ${k1}2${k2}="'baseconv $v1 $v2'"
+  done
+done
diff --git a/.zsh/zshrc/60-directory_stack b/.zsh/zshrc/60-directory_stack
new file mode 100644 (file)
index 0000000..4fa684f
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# Configure keeping a directory stack
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+# make cd push the old directory onto the directory stack.
+setopt auto_pushd
+
+# iexchange the meanings of `+' and `-' when used with a number to specify
+# a directory in the stack
+setopt pushd_minus
+
+# pushd with no arguments act like `pushd $HOME'
+setopt pushd_to_home
+
+# do not push multiple copies of the same directory onto the directory stack
+setopt pushd_ignore_dups
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/79-zle_widget_function_arrays b/.zsh/zshrc/79-zle_widget_function_arrays
new file mode 100644 (file)
index 0000000..0d3abe7
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# Provide arrays for accept-line and magic-space handlers
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+function _widget_functions_handler() {
+  emulate -L zsh
+  local fn
+  for fn in ${(P)${:-"${WIDGET//-/_}_functions"}}; do eval $fn \"\$@\"; done
+  [[ $WIDGET != zle-* ]] || return
+  zle .${WIDGET} "$@"
+}
+
+# define arrays like $accept_line_functions so we can stack functions to be
+# called for these widgets
+typeset -l widget
+for widget in accept_line magic_space zle_line_init; do
+  typeset -ga ${widget}_functions
+  zle -N ${widget//_/-} _widget_functions_handler
+done
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/79_bindkeys b/.zsh/zshrc/79_bindkeys
deleted file mode 100644 (file)
index 28b54f0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# zshrc/80_bindkeys
-#
-# Defines key bindings
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-# use emacs keybindings by default
-bindkey -e
-
-# history expansion on pressing space
-#bindkey ' ' magic-space
-
-# repeat the previous shell-word ($WORDCHARS)
-bindkey '\e=' copy-prev-shell-word
-
-# allow for better ad-hoc multiline editing
-bindkey '\eq' push-line-or-edit
-
-# fix home/end keys (for mosh)
-bindkey "\e[7~" beginning-of-line
-bindkey "\e[8~" end-of-line
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/80-completion b/.zsh/zshrc/80-completion
new file mode 100644 (file)
index 0000000..e45b9fd
--- /dev/null
@@ -0,0 +1,223 @@
+#
+# Set up completion
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+### INITIALISATION
+
+zstyle :compinstall filename "$ZDOTDIR/zshrc/80-completion"
+
+autoload -Uz compinit
+compinit -d $ZVARDIR/comp-$HOSTS
+
+# load fancy completion list and menu handler
+zmodload zsh/complist
+
+# avoid old-style completion (compctl)
+zstyle ':completion:*' use-compctl false
+
+# cache results
+zstyle ':completion:*' use-cache on
+zstyle ':completion:*' cache-path $ZVARDIR/compcache-${HOST}
+
+### OPTIONS
+
+# show the list of completions right away when there's an ambiguous prefix
+# note that there's also the 'list' zstyle, which could override this
+setopt auto_list
+setopt no_list_ambiguous
+
+# use menu after the second completion request
+# cf. also the 'menu' zstyle, which eclipses this
+setopt auto_menu
+
+# these mess with the aforementioned behaviour, make sure they're off
+setopt no_menu_complete no_bash_auto_list
+
+# make the completion list smaller by printing the matches in columns with
+# different widths.
+setopt list_packed
+
+# do not recognise exact matches even if they're ambiguous
+# (we don't want this because /var/log/sys<tab> should also
+# offer /var/log/syslog…)
+setopt no_rec_exact
+
+# move cursor to end of word being completed
+setopt always_to_end
+
+# be magic about adding/removing final characters on tab completion
+setopt auto_param_keys auto_param_slash auto_remove_slash
+
+# allow completion to happen in the middle of a word
+setopt complete_in_word
+
+### COMPLETERS
+
+# set the list of completers
+zstyle ':completion:*' completer \
+  _expand_alias _expand \
+  _complete _prefix:-complete \
+  _approximate _prefix:-approximate \
+  _match _ignored
+zstyle ':completion:*:prefix-complete:*' completer _complete
+zstyle ':completion:*:prefix-approximate:*' completer _approximate
+
+# configure the _expand completer
+bindkey '^i' complete-word
+zstyle ':completion::expand:*' tag-order 'expansions all-expansions original'
+
+# do approximated completion, allowing 1 error per three characters
+zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )'
+
+### TRIM OUTPUT OF IGNORED PATTERNS
+
+# functions which start with _ are internal and ignored
+zstyle ':completion:*:*:-command-:*' tag-order 'functions:-non-comp'
+zstyle ':completion:*:functions-non-comp' ignored-patterns '_*'
+
+# ignore working and backup copies, and compiled objects
+zstyle ':completion:*:argument-rest:' file-patterns '
+  *(-/):directories:directories
+  (*.(ba#k|old)|*~):backup-files:"backup files"
+  *.(l#[oa]|py[co]|zwc):compiled-files:"compiled files"
+  *.te#mp:temp-files:"temp files"
+  .*.sw?:vim-swap-files:"vim swap files"
+  %p:globbed-files *:all-files
+  '
+zstyle ':completion:*:argument-rest:(all|globbed)-files' ignored-patterns \
+  '((*.(ba#k|old)|*~)|*.(l#[oa]|py[co]|zwc)|*.te#mp|.*.sw?|*(-/))'
+#TODO directories not ignored in files output:
+####  fishbowl:/tmp/cdt.6kIDed% cat <tab>
+####  directories
+####  foobar/
+####  backup files
+####  foo.bk                     foo.old
+####  compiled files
+####  foo.a    foo.la   foo.lo   foo.o    foo.pyc  foo.zwc
+####  temp files
+####  foo.tmp
+####  files
+####  foobar/      foo.c        foo.txt
+
+#zstyle ':completion:*:argument*' tag-order "
+#  globbed-files files all-files
+#  directories
+#  backup-files
+#  compiled-files
+#  temp-files
+#  vim-swap-files
+#  "
+zstyle ':completion:*:argument*' group-order \
+  vim-swap-files \
+  globbed-files files all-files \
+  directories \
+  backup-files \
+  compiled-files \
+  temp-files \
+#end
+#TODO no effect on ordering yet
+
+zstyle ':completion:*:argument*' group-order vim-swap-files directories \
+  globbed-files files all-files backup-files compiled-files temp-files
+
+resource() { source $ZDOTDIR/zshrc/80-completion; zle -M "resourced"; }
+zle -N resource
+bindkey '\er' resource
+
+# do not offer files already specified on the line
+zstyle ':completion:*:rm' ignore-line yes
+
+# do not offer current directory as completion in ../
+zstyle ':completion:*' ignore-parents parent pwd
+
+# http://xana.scru.org/2005/08/20#ignorelatexjunk
+zstyle -e ':completion:*:*:vim#' ignored-patterns \
+  'texfiles=$(echo ${PREFIX}*.tex); [[ -n "$texfiles" ]] &&
+  reply=(*.(aux|dvi|log|p(s|df)|bbl|toc|lo[tf]|latexmain)) || reply=()'
+
+### LOOK & FEEL
+
+# Take advantage of $LS_COLORS for completion as well.
+zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
+
+# List directories first/in a separate group
+zstyle ':completion:*' list-dirs-first yes
+
+# Use a less ambiguous list separator
+zstyle ':completion:*' list-separator '::'
+
+# allow cursor-key navigation through completion set
+zstyle ':completion:*' menu select
+
+# always offer the original string as a completion choice
+zstyle ':completion:*:match:*' original true
+
+# squash multiple slashes to one, which is the unix-style
+zstyle ':completion:*' squeeze-slashes true
+
+# Formatting of completion menu/list
+zstyle ':completion:*' verbose yes
+zstyle ':completion:*' auto-description 'missing description: %d'
+zstyle ':completion:*:descriptions' format '%B%d%b'
+zstyle ':completion:*:messages' format '%d'
+zstyle ':completion:*:warnings' format 'no matches for: %d'
+zstyle ':completion:*:corrections' format "%B%d $fg[red](errors: %e)$reset_color%b"
+#zstyle ':completion:*:matches' group 'yes'
+zstyle ':completion:*' group-name ''
+
+# Handle command-line options a bit differently
+zstyle ':completion:*:options' auto-description '%d'
+zstyle ':completion:*:options' description 'yes'
+
+### KEYBINDINGS
+
+# ^x^h :: provide context help, in addition to ^x h
+bindkey '^x^h' _complete_help
+
+### SPECIFIC COMMAND/CONTEXT HANDLING
+
+# commands that take commands as arguments
+compdef _precommand gdb
+compdef _precommand nohup
+compdef _precommand strace
+
+# a couple commands don't yet have -option completion but
+# they're generic GNU tools, so…
+typeset -la gnu_generic_tools=(mv)
+local c
+for c ($gnu_generic_tools) compdef _gnu_generic $c
+
+# custom path when expanding in the sudo context
+zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
+                                           /usr/local/bin  \
+                                           /usr/sbin       \
+                                           /usr/bin        \
+                                           /sbin           \
+                                           /bin            \
+                                           /usr/X11R6/bin
+
+# Completion of processes: show all user processes
+zstyle ':completion:*:processes' command 'PS="ps -au$USER -o pid,tty,time,pcpu,cmd"; eval $PS | grep -v "$PS"'
+
+# Integrate directory stack with cd -<tab> completion
+zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
+
+# Offer .. as a special-dir to completions
+zstyle -e ':completion:*' special-dirs '[[ $PREFIX = (../)#(|.|..) ]] && reply=(..)'
+#TODO does not yet work
+
+# complete manual by their section
+zstyle ':completion:*:manuals' separate-sections true
+zstyle ':completion:*:manuals.*' insert-sections   true
+zstyle ':completion:*:man:*' menu yes select
+
+# debbug #527301
+zstyle ':completion::complete:xmms2:*:values' list-grouped false
+zstyle ':completion::complete:xmms2:*:values' sort false
+
+# vim:ft=zsh
similarity index 66%
rename from .zsh/zshrc/80_history
rename to .zsh/zshrc/80-history
index 2f97935016efe0b47f0d377a5c3a70d87f42a391..11a174ee16b13b9f71a115bdf8eaa265b66e5549 100644 (file)
@@ -1,6 +1,5 @@
-# zshrc/80_history
 #
 #
-# Set up command line history functions
+# Configure history file storage
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
 #
 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
 # Released under the terms of the Artistic Licence 2.0
 
 # typeset -g on this one to make warn_create_global happy
 typeset -g HISTFILE=$ZVARDIR/history-$HOST
 
 # typeset -g on this one to make warn_create_global happy
 typeset -g HISTFILE=$ZVARDIR/history-$HOST
-[[ -e $ZVARDIR/history ]] && mv $ZVARDIR/history $HISTFILE
 HISTSIZE=10000
 SAVEHIST=$HISTSIZE
 LISTMAX=1000
 
 HISTSIZE=10000
 SAVEHIST=$HISTSIZE
 LISTMAX=1000
 
-# treat ! specially like csh did
-setopt bang_hist
+# properly lock the file on write (better on modern operating systems)
+setopt hist_fcntl_lock
 
 
-# ignore duplicates in the history
-setopt hist_ignore_dups
-
-# save timestamp and duration with each event
-setopt extended_history
+# add history lines to the $HISTFILE incrementally (as soon as they are
+# entered), rather than waiting until the shell exits.
+setopt inc_append_history
+setopt no_append_history
 
 
-# properly lock the file on write, if that option exists
-setopt hist_fcntl_lock 2>/dev/null
-
-# skip over non-contiguous duplicates when searching history
-setopt hist_find_no_dups
+# do not store duplicates in the history file
+setopt hist_ignore_dups
 
 # don't store commands starting with a space in the history file
 setopt hist_ignore_space
 
 
 # don't store commands starting with a space in the history file
 setopt hist_ignore_space
 
-# don't store history/fc -l invocations
-setopt hist_no_store
-
 # remove superfluous blanks from each command line
 setopt hist_reduce_blanks
 
 # remove superfluous blanks from each command line
 setopt hist_reduce_blanks
 
+# skip over non-contiguous duplicates when searching history
+setopt hist_find_no_dups
+
+# save timestamp and duration with each event
+setopt extended_history
+
 # vim:ft=zsh
 # vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle b/.zsh/zshrc/80-zle
new file mode 100644 (file)
index 0000000..78e3df8
--- /dev/null
@@ -0,0 +1,87 @@
+#
+# Configure the zsh line editor
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+# allow 700ms between esc and subsequent character
+KEYTIMEOUT=70
+
+# do not consider '/' to be part of a word, i.e. delete-word
+# iterates through URL components
+WORDCHARS="${WORDCHARS//\/}"
+
+# esc-= :: Repeat the previous shell-word ($WORDCHARS)
+bindkey '\e=' copy-prev-shell-word
+
+# esc-q :: allow for better ad-hoc multiline editing
+bindkey '\eq' push-line-or-edit
+
+# Perform history expansion and insert a space into the buffer.
+bindkey ' ' magic-space
+
+# Automatically escape URLs
+autoload -U url-quote-magic
+zle -N self-insert url-quote-magic
+# … even when pasted
+autoload -U bracketed-paste-magic
+zle -N bracketed-paste bracketed-paste-magic
+
+# Change defaults and remove {} from the meta characters, as we often use them
+# in the shell to create multiple URLs, e.g. http://example.org/{1,2,3}.txt
+zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#='
+
+# Allow editing of the command line using $EDITOR with esc-e
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey '\ee' edit-command-line
+
+# Bind esc-u/-U to insert date-/timestamp based on shell timezones
+# (esc-t/-T does it from urxvt in the local timezone
+_insert_datestamp() { LBUFFER+=${(%):-'%D{%Y-%m-%d}'}; }
+zle -N insert-datestamp _insert_datestamp
+bindkey '\eu' insert-datestamp
+_insert_timestamp() { LBUFFER+=${(%):-'%D{%Y-%m-%d-%H%M%S}'}; }
+zle -N insert-timestamp _insert_timestamp
+bindkey '\eU' insert-timestamp
+
+# Jump behind the first word (and the space) on the cmdline to add options
+function _jump_after_first_word() {
+  emulate -L zsh
+  local words
+  words=(${(z)BUFFER})
+
+  if (( ${#words} <= 1 )) ; then
+    CURSOR=${#BUFFER}
+  else
+    CURSOR=$((${#${words[1]}}+1))
+  fi
+}
+zle -N _jump_after_first_word
+bindkey '\e1' _jump_after_first_word
+
+# ^k :: kill through the end of the line
+bindkey '^k' kill-line
+
+# ^? :: borrow backspace behaviour from emacs-mode, rather than stilly limited
+# viins
+bindkey $terminfo[kbs] backward-delete-char
+
+# ^a/^e :: move to beginning and end of line, like emacs
+bindkey '^a' beginning-of-line
+bindkey '^e' end-of-line
+
+# \ew :: print pwd to status line
+function _whereami() {
+  zle -M "${(%):-"%m:%~"}"
+}
+zle -N _whereami
+bindkey '\ew' _whereami
+
+# ^x^x :: execute widgets directory
+bindkey '^x^x' execute-named-cmd
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle_add_sudo b/.zsh/zshrc/80-zle_add_sudo
new file mode 100644 (file)
index 0000000..020edf3
--- /dev/null
@@ -0,0 +1,20 @@
+#
+# Provide a means to (re-)run the command with sudo
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+function sudo-command-line () {
+    [[ -z $BUFFER ]] && zle up-history
+    if [[ $BUFFER != sudo\ * ]]; then
+        BUFFER="sudo $BUFFER"
+        CURSOR=$(( CURSOR+5 ))
+    fi
+}
+zle -N sudo-command-line
+bindkey '^os' sudo-command-line
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle_edit_aliases+functions b/.zsh/zshrc/80-zle_edit_aliases+functions
new file mode 100644 (file)
index 0000000..72952cb
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Useful vared wrappers to edit functions and aliases
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+edalias() {
+  [[ -z "$1" ]] && { echo "Usage: edalias <alias_to_edit>" ; return 1 }
+  vared aliases'[$1]';
+}
+compdef _aliases edalias
+
+edfunc() {
+  [[ -z "$1" ]] && { echo "Usage: edfunc <function_to_edit>" ; return 1 }
+  vared functions'[$1]';
+}
+compdef _functions edfunc
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle_inplace_mkdir b/.zsh/zshrc/80-zle_inplace_mkdir
new file mode 100644 (file)
index 0000000..eff5f13
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# Provide a way to to create directories while composing the ZLE
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+_mkdir_inplace() {
+  emulate -L zsh
+  local pathtomkdir
+  if ((REGION_ACTIVE==1)); then
+    local F=$MARK T=$CURSOR
+    if [[ $F -gt $T ]]; then
+      F=${CURSOR}
+      T=${MARK}
+    fi
+    # get marked area from buffer and eliminate whitespace
+    pathtomkdir=${BUFFER[F+1,T]%%[[:space:]]##}
+    pathtomkdir=${pathtomkdir##[[:space:]]##}
+  else
+    local bufwords iword
+    bufwords=(${(z)LBUFFER})
+    iword=${#bufwords}
+    bufwords=(${(z)BUFFER})
+    pathtomkdir="${(Q)bufwords[iword]}"
+  fi
+  [[ -z "${pathtomkdir}" ]] && return 1
+  pathtomkdir=${~pathtomkdir}
+  if [[ -e "${pathtomkdir}" ]]; then
+    zle -M " path already exists, doing nothing"
+  else
+    zle -M "$(mkdir -p -v "${pathtomkdir}")"
+    zle end-of-line
+  fi
+}
+zle -N _mkdir_inplace
+bindkey '\em' _mkdir_inplace
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle_isearch b/.zsh/zshrc/80-zle_isearch
new file mode 100644 (file)
index 0000000..ebbb4b5
--- /dev/null
@@ -0,0 +1,13 @@
+#
+# Configure incremental history search
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+bindkey '^r' history-incremental-search-backward
+bindkey '^f' history-incremental-search-forward
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle_magic_abbreviations b/.zsh/zshrc/80-zle_magic_abbreviations
new file mode 100644 (file)
index 0000000..fc831cf
--- /dev/null
@@ -0,0 +1,51 @@
+typeset -Ag zle_abbrevs
+zle_abbrevs=(
+#  '...'    '../..'
+#  '....'   '../../..'
+#  '.....'  '../../../..'
+#  '......' '../../../../..'
+  'WC'     '| wc'
+  'GR'     '|& grep '
+  'HD'     '| head'
+  'HL'     ' --help |& less -r'
+  'LS'     '| less'
+  'LR'     '|& less -r'
+  'NL'     '&>/dev/null'
+  'SL'     '| sort | less'
+  'SU'     '| sort -u'
+  'TL'     '| tail'
+  'VI'     '|& vim -'
+  'ND'     '*(/om[1])'
+  'NF'     '*(.om[1])'
+)
+# the ...## abbrevs are gone in favour of rationalise-dot
+
+magic-abbrev-expand() {
+  emulate -L zsh
+  setopt extendedglob
+  local MATCH MBEGIN MEND
+  LBUFFER=${LBUFFER%%(#m)[.A-Z]#}
+  LBUFFER+=${zle_abbrevs[$MATCH]:-$MATCH}
+}
+
+no-magic-abbrev-expand() {
+  emulate -L zsh
+  LBUFFER+=' '
+}
+
+zle -N magic-abbrev-expand
+zle -N no-magic-abbrev-expand
+
+magic_space_functions+=magic-abbrev-expand
+accept_line_functions+=magic-abbrev-expand
+
+bindkey "^x " no-magic-abbrev-expand
+bindkey -M isearch " " self-insert
+
+function help-show-magic-abbrevs() {
+  zle -M "$(print "Available abbreviations for expansion:"; print -a -C 2 ${(kv)zle_abbrevs})"
+}
+zle -N help-show-magic-abbrevs
+bindkey '\e?' help-show-magic-abbrevs
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle_mosh_home+end b/.zsh/zshrc/80-zle_mosh_home+end
new file mode 100644 (file)
index 0000000..a94a267
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# Fix keys for mosh
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+# fix home/end keys (for mosh)
+bindkey "\e[7~" beginning-of-line
+bindkey "\e[8~" end-of-line
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80-zle_parent-dir-shortcut b/.zsh/zshrc/80-zle_parent-dir-shortcut
new file mode 100644 (file)
index 0000000..9f49f6b
--- /dev/null
@@ -0,0 +1,20 @@
+#
+# Rationalise occurrences of three consecutive dots
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+rationalise-dot() {
+  if [[ $LBUFFER = *.. ]]; then
+    LBUFFER+=/..
+  else
+    LBUFFER+=.
+  fi
+}
+zle -N rationalise-dot
+bindkey . rationalise-dot
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/80_abbreviations b/.zsh/zshrc/80_abbreviations
deleted file mode 100644 (file)
index cae9274..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-typeset -Ag abbreviations
-abbreviations=(
-  '...'  '../..'
-  '....' '../../..'
-  'BG'   '& exit'
-  'WC'   '| wc'
-  'GR'   '|& grep '
-  'HD'   '| head'
-  'HL'   ' --help |& less -r'
-  'LS'   '| less'
-  'LR'   '|& less -r'
-  'NL'   '&>/dev/null'
-  'SL'   '| sort | less'
-  'SU'   '| sort -u'
-  'TL'   '| tail'
-  'VI'   '|& vim -'
-)
-
-magic-abbrev-expand() {
-    local MATCH
-    LBUFFER=${LBUFFER%%(#m)[-_a-zA-Z0-9]#}
-    LBUFFER+=${abbreviations[$MATCH]:-$MATCH}
-    zle self-insert
-}
-
-no-magic-abbrev-expand() {
-  LBUFFER+=' '
-}
-
-zle -N magic-abbrev-expand
-zle -N no-magic-abbrev-expand
-bindkey " " magic-abbrev-expand
-bindkey "^x " no-magic-abbrev-expand
-bindkey -M isearch " " self-insert
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/80_inplacemkdir b/.zsh/zshrc/80_inplacemkdir
deleted file mode 100644 (file)
index 91acd91..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# from grml
-_inplaceMkDirs() {
-    local PATHTOMKDIR
-    if ((REGION_ACTIVE==1)); then
-        local F=$MARK T=$CURSOR
-        if [[ $F -gt $T ]]; then
-            F=${CURSOR}
-            T=${MARK}
-        fi
-        # get marked area from buffer and eliminate whitespace
-        PATHTOMKDIR=${BUFFER[F+1,T]%%[[:space:]]##}
-        PATHTOMKDIR=${PATHTOMKDIR##[[:space:]]##}
-    else
-        local bufwords iword
-        bufwords=(${(z)LBUFFER})
-        iword=${#bufwords}
-        bufwords=(${(z)BUFFER})
-        PATHTOMKDIR="${(Q)bufwords[iword]}"
-    fi
-    [[ -z "${PATHTOMKDIR}" ]] && return 1
-    PATHTOMKDIR=${~PATHTOMKDIR}
-    if [[ -e "${PATHTOMKDIR}" ]]; then
-        zle -M " path already exists, doing nothing"
-    else
-        zle -M "$(mkdir -p -v "${PATHTOMKDIR}")"
-        zle end-of-line
-    fi
-}
-zle -N _inplaceMkDirs && bindkey '^xm' _inplaceMkDirs
diff --git a/.zsh/zshrc/80_zle b/.zsh/zshrc/80_zle
deleted file mode 100644 (file)
index ca59e4e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# zshrc/80_zle
-#
-# Configure the zsh line editor
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-# automatically escape URLs
-# /usr/share/zsh*/functions/Zle/url-quote-magic
-autoload -U url-quote-magic
-zle -N self-insert url-quote-magic
-setopt no_nomatch
-
-# http://www.zsh.org/mla/users/2006/msg00399.html
-autoload      edit-command-line
-zle -N        edit-command-line
-bindkey '\ee' edit-command-line
-
-_insert_datestamp() { LBUFFER+=${(%):-'%D{%Y.%m.%d}'}:; }
-zle -N insert-datestamp _insert_datestamp
-bindkey '\et' insert-datestamp
-
-# prefix search (up to cursor position)
-autoload history-search-end
-zle -N history-beginning-search-backward-end history-search-end
-zle -N history-beginning-search-forward-end  history-search-end
-bindkey "\e[5~" history-beginning-search-backward-end # PageUp
-bindkey "\e[6~" history-beginning-search-forward-end  # PageDown
-
-_insert_last_typed_word() { zle insert-last-word -- 0 -1 };
-zle -N _insert_last_typed_word;
-bindkey "\em" _insert_last_typed_word
-
-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
diff --git a/.zsh/zshrc/83-reporttime b/.zsh/zshrc/83-reporttime
new file mode 100644 (file)
index 0000000..048bfa3
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Report time for commands running longer than n seconds
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+typeset -g REPORTTIME=5
+
+# vim:ft=zsh
similarity index 94%
rename from .zsh/zlogin/60_mime
rename to .zsh/zshrc/85-mime-integration
index 66a341cc94485864e24d2b22651e5ce3e373838a..bc31a1f43550a1c5f8ca4f81aa7afc3c3faabab3 100644 (file)
@@ -1,4 +1,3 @@
-# zlogin/60_mime
 #
 # set up the shell's mime support
 #
 #
 # set up the shell's mime support
 #
diff --git a/.zsh/zshrc/85_direnv.disabled b/.zsh/zshrc/85_direnv.disabled
new file mode 100644 (file)
index 0000000..6f02033
--- /dev/null
@@ -0,0 +1,15 @@
+# zshrc/85_direnv
+#
+# load direnv hook
+#
+# Copyright © 2014 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+if whence direnv >/dev/null; then
+  eval "$(direnv hook zsh)"
+fi
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/85_prompt b/.zsh/zshrc/85_prompt
deleted file mode 100644 (file)
index 6874ec3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# zshrc/80_prompt
-#
-# Formats the shell prompt
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-if [ "${PS1:-}" = '%m%# ' ]; then
-  local _MIDDLE="%1v%(2v.|%B%2v%b|.)%(3v.%3v.)"
-  if is_root; then
-    _MIDDLE="%25<…<%~%<<"
-    local _PS1_HL=U
-  fi
-
-  local _MACHINE_NAME="${_PS1_HL:=B}%m%${(L)_PS1_HL}"
-  _MACHINE_NAME="$_MACHINE_NAME${debian_chroot:+/%S$debian_chroot%s}"
-
-  PS1="%(2L.+.)%${_MACHINE_NAME}:${_MIDDLE}%# "
-fi
-
-: ${RPS1:="#%(0?..%?,)%! [%l]"}
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/85_termfonts b/.zsh/zshrc/85_termfonts
deleted file mode 100644 (file)
index 73d7799..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-# zshrc/80_termfonts
-#
-# provide helper methods to increase/decrease fonts from the command line
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-typeset -ga _XTERM_FONTS
-#_XTERM_FONTS+=-misc-fixed-medium-r-normal--6-60-75-75-c-40-iso10646-1
-#_XTERM_FONTS+=-misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1
-#_XTERM_FONTS+=-misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1
-#_XTERM_FONTS+=-misc-fixed-medium-r-normal--9-90-75-75-c-60-iso10646-1
-#_XTERM_FONTS+=-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
-_XTERM_FONTS+=-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
-#_XTERM_FONTS+=-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1
-_XTERM_FONTS+=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
-#_XTERM_FONTS+=-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
-_XTERM_FONTS+=-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
-_XTERM_FONTS+=-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
-_XTERM_FONTS+='-*-lucidatypewriter-*-*-*-*-26-*-*-*-*-*-iso10646-1'
-_XTERM_FONT=${_XTERM_FONT:=1}
-
-_set_xterm_font() {
-  if [ $1 -lt 1 ]; then
-    warn "no smaller font available"
-    _XTERM_FONT=1
-    return 1
-  elif [ $1 -gt $#_XTERM_FONTS ]; then
-    warn "no larger font available"
-    _XTERM_FONT=$#_XTERM_FONTS
-    return 1
-  fi
-  _XTERM_FONT=$1
-  info "selecting font: $_XTERM_FONTS[$_XTERM_FONT]"
-  echo -en "\033]50;$_XTERM_FONTS[$1]\007"
-}
-#_set_xterm_font $_XTERM_FONT 2>/dev/null
-
-f++() { _set_xterm_font $((_XTERM_FONT + 1)) }
-f--() { _set_xterm_font $((_XTERM_FONT - 1)) }
-f0() { _set_xterm_font 1 }
-fx() { _set_xterm_font $#_XTERM_FONTS }
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/85_xtermtitle b/.zsh/zshrc/85_xtermtitle
deleted file mode 100644 (file)
index 32b0226..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-# zshrc/80_xtermtitle
-#
-# Fancy setting of the xterm title
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-# Based on http://www.zshwiki.org/cgi-bin/wiki.pl?ZshHardStatus
-#
-
-__set_xterm_title() {
-  case $TERM in
-    screen)
-      print -nR $'\033k'$1$'\033'\\ 
-      print -nR $'\033]0;'$2$'\a'
-      ;;
-    xterm|rxvt*)
-      print -nR $'\033]0;'$*$'\a'
-      ;;
-  esac
-}
-
-__get_session_flags() {
-  [ -n "$SSH_CONNECTION" ] || return
-  local flags; flags=
-  [ -n "$DISPLAY" ] && flags="${flags}x"
-  [ -n "$SSH_AUTH_SOCK" ] && flags="${flags}a"
-  [[ $SSH_CLIENT = *:* ]] && flags="${flags}6"
-  [ -n "$flags" ] && echo "[${flags}]"
-}
-
-__get_standard_prompt() {
-  [[ -z $SSH_CLIENT ]] || print -nP "%m"
-  print -P "%#%25\<..\<%~ $(__get_session_flags)"
-}
-
-_set_plain_xterm_title() {
-  __set_xterm_title "$(__get_standard_prompt)"
-}
-precmd_functions+=_set_plain_xterm_title
-
-_set_cmd_xterm_title () {
-    local -a cmd; cmd=(${(z)1})             # Re-parse the command line
-
-    # Construct a command that will output the desired job number.
-    case $cmd[1] in
-        fg) if (( $#cmd == 1 )); then
-                # No arguments, must find the current job
-                cmd=(builtin jobs -l %+)
-            else
-                # Replace the command name, ignore extra args.
-                cmd=(builtin jobs -l ${(Q)cmd[2]})
-            fi;;
-        %*) cmd=(builtin jobs -l ${(Q)cmd[1]});; # Same as "else" above
-        *) # Not resuming a job,
-            __set_xterm_title $cmd[1]:t${cmd[2]:+ }$cmd[2,-1] "| $(__get_standard_prompt)"
-            return;;                        # so we're all done
-    esac
-
-    local -A jt; jt=(${(kv)jobtexts})       # Copy jobtexts for subshell
-
-    # Run the command, read its output, and look up the jobtext.
-    # Could parse $rest here, but $jobtexts (via $jt) is easier.
-    $cmd >>(
-              read num rest
-              cmd=(${(z)${(e):-\$jt$num}})
-              __set_xterm_title $leader$cmd[1]:t${cmd[2]:+ }$cmd[2,-1] "| $(__get_standard_prompt)"
-           )
-}
-preexec_functions+=_set_cmd_xterm_title
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/90-ls_on_chdir b/.zsh/zshrc/90-ls_on_chdir
new file mode 100644 (file)
index 0000000..22c1e36
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Print directory context on chdir
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+autoload -U add-zsh-hook
+
+function _ls_on_chpwd() {
+  emulate -L zsh
+  ls -AF --group-directories-first
+}
+add-zsh-hook chpwd _ls_on_chpwd
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/90-run-help b/.zsh/zshrc/90-run-help
new file mode 100644 (file)
index 0000000..c6a9bbd
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Enable ZLE access to manpages and run-help
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+(( ${+aliases[run-help]} )) && unalias run-help
+autoload -U run-help{,-{git,ip,openssl,sudo}}
+
+bindkey '\eh' run-help
+bindkey '^[[11~' run-help
+
+# vim:ft=zsh
similarity index 91%
rename from .zsh/zshrc/95_watch
rename to .zsh/zshrc/95-watch-users
index 9ac0eb4851dc047aa33103522b5b409dcc4c1371..17f7a1a3104c14adedf214285d8085586e40e2b7 100644 (file)
@@ -1,4 +1,3 @@
-# zshrc/95_watch
 #
 # watch activity of other users
 #
 #
 # watch activity of other users
 #
@@ -8,6 +7,7 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
+typeset -U watch WATCH
 watch=(notme)
 LOGCHECK=120
 
 watch=(notme)
 LOGCHECK=120
 
diff --git a/.zsh/zshrc/95_fortune.disabled b/.zsh/zshrc/95_fortune.disabled
deleted file mode 100644 (file)
index ca1c199..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# zshrc/95_fortune
-#
-# Prints a fortune cookie to each interactive shell
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-fortune -a 2>/dev/null || :
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/99-prompt_setup b/.zsh/zshrc/99-prompt_setup
new file mode 100644 (file)
index 0000000..bc6181c
--- /dev/null
@@ -0,0 +1,14 @@
+#
+# Configure the prompt
+#
+# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
+# Released under the terms of the Artistic Licence 2.0
+#
+# Source repository: http://git.madduck.net/v/etc/zsh.git
+#
+
+autoload -Uz promptinit
+promptinit
+prompt madduck
+
+# vim:ft=zsh
diff --git a/.zsh/zshrc/99_TODO b/.zsh/zshrc/99_TODO
deleted file mode 100644 (file)
index 3ee8155..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# zshrc/99_TODO
-#
-# All kinds of stuff not yet split to other files
-# TEMPORARY
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-ldir() { eval hash -d $1="$PWD"; cd .; }
-
-alias Q='exec zsh -$-'
-alias ozsh='ZDOTDIR=$HOME/.etc/zsh.migrated exec zsh'
-
-# do not clobber files with >
-setopt noclobber
-
-# automatically maintain a directory stack
-setopt autopushd pushdminus pushdsilent pushdtohome
-
-# brace expansion
-setopt braceccl
-
-# report immediately when background jobs finish
-setopt notify
-# do not auto-nice background processes
-setopt no_bgnice
-# do not send HUP signal to jobs when the shell exits
-setopt nohup
-# do alert me of running jobs before exiting
-setopt checkjobs
-# display PID when suspending processes as well
-setopt longlistjobs
-
-# disable backslashed escape sequences unless -e is given to echo 
-setopt bsd_echo
-
-# use full globbing powers
-setopt extended_glob
-
-# don't bitch about bad patterns, just use them verbatim
-setopt no_bad_pattern
-
-# don't bitch about no matches, just the glob character verbatim
-setopt no_nomatch
-
-# do. not. ever. beep.
-setopt no_beep
-
-# use 0xXX and 0XX output instead of 16#XX/8#XX
-setopt c_bases
-
-[ "$(umask)" = 022 ] && umask 0077
-
-# remove '/' from WORDCHARS
-WORDCHARS="${WORDCHARS//\/}"
-
-# report time stats when command takes longer than 5 seconds
-# typeset -g to make warn_create_global happy
-typeset -g REPORTTIME=5
-
-MAILCHECK=0
-
-# http://grml.org/zsh/zsh-lovers.html
-rationalise-dot() {
-  if [[ $LBUFFER = *.. ]]; then
-    LBUFFER+=/..
-  else
-    LBUFFER+=.
-  fi
-}
-#zle -N rationalise-dot
-#bindkey . rationalise-dot
-
-:
-
-# vim:ft=zsh
diff --git a/.zsh/zshrc/99_hookfunctions b/.zsh/zshrc/99_hookfunctions
deleted file mode 100644 (file)
index 2583517..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# zshrc/99_hookfunctions
-#
-# define hook functions in case the *_functions arrays are not honoured
-#
-# Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-# Source repository: http://git.madduck.net/v/etc/zsh.git
-#
-
-autoload -U is-at-least
-if ! is-at-least 4.3.6; then
-  for i in precmd preexec chpwd periodic; do
-    if [ -n "$functions[$i]" ]; then
-      warn "$i function already defined"
-      continue
-    fi
-    eval "${i}() { for fn (\$${i}_functions) \$fn \"\$@\" }"
-  done
-fi
-
-# vim:ft=zsh