Skip to content
This repository

Add Function keys plugin: enables easy binding of function keys #981

Open
wants to merge 1 commit into from

2 participants

Rotem Yaari Robby Russell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 01, 2012
Rotem Yaari Add Function keys plugin: enables easy binding of function keys f165c05
This page is out of date. Refresh to see the latest.
94  plugins/function_keys/function_keys.plugin.zsh
... ...
@@ -0,0 +1,94 @@
  1
+##
  2
+# function keys plugin: defines easy hooks you can implement or override
  3
+# to respond to F1-F12 keys
  4
+
  5
+#F1
  6
+eval "f1() {zle push-line;LBUFFER+='fkey_f1';zle accept-line}"
  7
+zle -N f1
  8
+bindkey '^[OP' f1
  9
+#F2
  10
+eval "f2() {zle push-line;LBUFFER+='fkey_f2';zle accept-line}"
  11
+zle -N f2
  12
+bindkey '^[OQ' f2
  13
+#F3
  14
+eval "f3() {zle push-line;LBUFFER+='fkey_f3';zle accept-line}"
  15
+zle -N f3
  16
+bindkey '^[OR' f3
  17
+#F4
  18
+eval "f4() {zle push-line;LBUFFER+='fkey_f4';zle accept-line}"
  19
+zle -N f4
  20
+bindkey '^[OS' f4
  21
+#F5
  22
+eval "f5() {zle push-line;LBUFFER+='fkey_f5';zle accept-line}"
  23
+zle -N f5
  24
+bindkey '^[[15~' f5
  25
+#F6
  26
+eval "f6() {zle push-line;LBUFFER+='fkey_f6';zle accept-line}"
  27
+zle -N f6
  28
+bindkey '^[[17~' f6
  29
+#F7
  30
+eval "f7() {zle push-line;LBUFFER+='fkey_f7';zle accept-line}"
  31
+zle -N f7
  32
+bindkey '^[[18~' f7
  33
+#F8
  34
+eval "f8() {zle push-line;LBUFFER+='fkey_f8';zle accept-line}"
  35
+zle -N f8
  36
+bindkey '^[[19~' f8
  37
+#F9
  38
+eval "f9() {zle push-line;LBUFFER+='fkey_f9';zle accept-line}"
  39
+zle -N f9
  40
+bindkey '^[[20~' f9
  41
+#F10
  42
+eval "f10() {zle push-line;LBUFFER+='fkey_f10';zle accept-line}"
  43
+zle -N f10
  44
+bindkey '^[[21~' f10
  45
+#F11
  46
+eval "f11() {zle push-line;LBUFFER+='fkey_f11';zle accept-line}"
  47
+zle -N f11
  48
+bindkey '^[[23~' f11
  49
+#F12
  50
+eval "f12() {zle push-line;LBUFFER+='fkey_f12';zle accept-line}"
  51
+zle -N f12
  52
+bindkey '^[[24~' f12
  53
+
  54
+function fkey_f1 {
  55
+         _undefined_fkey
  56
+}
  57
+function fkey_f2 {
  58
+         _undefined_fkey
  59
+}
  60
+function fkey_f3 {
  61
+         _undefined_fkey
  62
+}
  63
+function fkey_f4 {
  64
+         _undefined_fkey
  65
+}
  66
+function fkey_f5 {
  67
+         _undefined_fkey
  68
+}
  69
+function fkey_f6 {
  70
+         _undefined_fkey
  71
+}
  72
+function fkey_f7 {
  73
+         _undefined_fkey
  74
+}
  75
+function fkey_f8 {
  76
+         _undefined_fkey
  77
+}
  78
+function fkey_f9 {
  79
+         _undefined_fkey
  80
+}
  81
+function fkey_f10 {
  82
+         _undefined_fkey
  83
+}
  84
+function fkey_f11 {
  85
+         _undefined_fkey
  86
+}
  87
+function fkey_f12 {
  88
+         _undefined_fkey
  89
+}
  90
+function _undefined_fkey {
  91
+         echo "Undefined key action"
  92
+}
  93
+
  94
+
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.