summaryrefslogtreecommitdiffstats
path: root/.zfunc
diff options
context:
space:
mode:
Diffstat (limited to '.zfunc')
-rw-r--r--.zfunc/bell3
-rw-r--r--.zfunc/e3
-rw-r--r--.zfunc/osc7_prompt5
-rw-r--r--.zfunc/p3
-rw-r--r--.zfunc/prompt_marc_setup28
-rw-r--r--.zfunc/set-title29
-rw-r--r--.zfunc/v4
7 files changed, 75 insertions, 0 deletions
diff --git a/.zfunc/bell b/.zfunc/bell
new file mode 100644
index 0000000..cc01adc
--- /dev/null
+++ b/.zfunc/bell
@@ -0,0 +1,3 @@
+#!zsh
+
+echoti bel
diff --git a/.zfunc/e b/.zfunc/e
new file mode 100644
index 0000000..c714d76
--- /dev/null
+++ b/.zfunc/e
@@ -0,0 +1,3 @@
+#!zsh
+
+"${EDITOR:-ed}" "$@"
diff --git a/.zfunc/osc7_prompt b/.zfunc/osc7_prompt
new file mode 100644
index 0000000..28d7a42
--- /dev/null
+++ b/.zfunc/osc7_prompt
@@ -0,0 +1,5 @@
+#!zsh
+emulate -L zsh
+
+printf "\e]7;file://%s%s\e\\" "${HOSTNAME}" "$(/usr/lib/vte-urlencode-cwd)"
+
diff --git a/.zfunc/p b/.zfunc/p
new file mode 100644
index 0000000..59115b7
--- /dev/null
+++ b/.zfunc/p
@@ -0,0 +1,3 @@
+#!zsh
+
+${PAGER:-less} "$@"
diff --git a/.zfunc/prompt_marc_setup b/.zfunc/prompt_marc_setup
new file mode 100644
index 0000000..834b233
--- /dev/null
+++ b/.zfunc/prompt_marc_setup
@@ -0,0 +1,28 @@
+#!zsh
+emulate -L zsh
+
+prompt_marc_precmd() {
+ vcs_info
+ RPS1="%B$vcs_info_msg_0_%b"
+ set-title "$(print -Pn "%n@%m %~")"
+}
+
+prompt_marc_preexec() {
+ set-title "$(print -Pn "%n@%m %~ %# ")${1}"
+}
+
+prompt_marc_setup () {
+ autoload -Uz vcs_info set-title
+ add-zsh-hook precmd prompt_marc_precmd
+ add-zsh-hook preexec prompt_marc_preexec
+
+ zstyle ':vcs_info:*' check-for-changes true
+ zstyle ':vcs_info:*' get-revision true
+ zstyle ':vcs_info:*' formats "%s:%R|%S@%b %m%u%c"
+ zstyle ':vcs_info:*' actionformats "%s:%r|%S@%b (%a) %m%u%c"
+
+ prompt_opts=( )
+ PS1='%B%? %n@%M:%~ %# %b'
+}
+
+prompt_marc_setup "$@"
diff --git a/.zfunc/set-title b/.zfunc/set-title
new file mode 100644
index 0000000..ae46b5a
--- /dev/null
+++ b/.zfunc/set-title
@@ -0,0 +1,29 @@
+#!zsh
+emulate -L zsh
+
+if tput hs
+then
+ tsl="$(tput tsl)"
+ fsl="$(tput fsl)"
+ hs=1
+else
+ case ${TERM} in
+ xterm*|rxvt*)
+ tsl="$(printf "\x1b]0;")"
+ fsl="$(printf "\a")"
+ hs=1
+ ;;
+ screen*)
+ tsl="$(printf "\x1b_")"
+ fsl="$(printf "\x1b\\")"
+ hs=1
+ ;;
+ esac
+fi
+
+if test "$hs" = 1
+then
+ printf "%s" "$tsl"
+ printf "%s" "$@"
+ printf "%s" "$fsl"
+fi
diff --git a/.zfunc/v b/.zfunc/v
new file mode 100644
index 0000000..a223795
--- /dev/null
+++ b/.zfunc/v
@@ -0,0 +1,4 @@
+#!zsh
+
+"${VISUAL:-${EDITOR:-vi}}" "$@"
+