Function: vcursor-bind-keys

vcursor-bind-keys is a byte-compiled function defined in vcursor.el.gz.

Signature

(vcursor-bind-keys VAR VALUE)

Documentation

Alter the value of the variable VAR to VALUE, binding keys as required.

VAR is usually vcursor-key-bindings. Normally this function is called on loading vcursor and from the customize package.

Source Code

;; Defined in /usr/src/emacs/lisp/vcursor.el.gz
;; (defvar vcursor)

(defun vcursor-bind-keys (var value)
  "Alter the value of the variable VAR to VALUE, binding keys as required.
VAR is usually `vcursor-key-bindings'.  Normally this function is called
on loading vcursor and from the customize package."
  (set var value)
  (cond
   ((not value)) ;; Don't set any key bindings.
   ((or (eq value 'oemacs)
	(and (eq value t) (fboundp 'oemacs-version)))
    (global-set-key [C-f1] #'vcursor-toggle-copy)
    (global-set-key [C-f2] #'vcursor-copy)
    (global-set-key [C-f3] #'vcursor-copy-word)
    (global-set-key [C-f4] #'vcursor-copy-line)

    (global-set-key [S-f1] #'vcursor-disable)
    (global-set-key [S-f2] #'vcursor-other-window)
    (global-set-key [S-f3] #'vcursor-goto)
    (global-set-key [S-f4] #'vcursor-swap-point)

    (global-set-key [C-f5] #'vcursor-backward-char)
    (global-set-key [C-f6] #'vcursor-previous-line)
    (global-set-key [C-f7] #'vcursor-next-line)
    (global-set-key [C-f8] #'vcursor-forward-char)

    (global-set-key [M-f5] #'vcursor-beginning-of-line)
    (global-set-key [M-f6] #'vcursor-backward-word)
    (global-set-key [M-f6] #'vcursor-forward-word)
    (global-set-key [M-f8] #'vcursor-end-of-line)

    (global-set-key [S-f5] #'vcursor-beginning-of-buffer)
    (global-set-key [S-f6] #'vcursor-scroll-down)
    (global-set-key [S-f7] #'vcursor-scroll-up)
    (global-set-key [S-f8] #'vcursor-end-of-buffer)

    (global-set-key [C-f9] #'vcursor-isearch-forward)

    (global-set-key [S-f9] #'vcursor-execute-key)
    (global-set-key [S-f10] #'vcursor-execute-command)

    ;; Partial dictionary of Oemacs key sequences for you to roll your own,
    ;; e.g C-S-up: (global-set-key "\M-[\C-f\M-\C-m" 'vcursor-previous-line)
    ;;    Sequence:         Sends:
    ;; "\M-[\C-f\M-\C-m"   C-S-up
    ;; "\M-[\C-f\M-\C-q"   C-S-down
    ;; "\M-[\C-fs"         C-S-left
    ;; "\M-[\C-ft"         C-S-right
    ;;
    ;; "\M-[\C-fw"         C-S-home
    ;; "\M-[\C-b\C-o"      S-tab
    ;; "\M-[\C-f\M-\C-r"   C-S-insert
    ;; "\M-[\C-fu"         C-S-end
    ;; "\M-[\C-f\M-\C-s"   C-S-delete
    ;; "\M-[\C-f\M-\C-d"   C-S-prior
    ;; "\M-[\C-fv"         C-S-next
    ;;
    ;; "\M-[\C-f^"         C-S-f1
    ;; "\M-[\C-f_"         C-S-f2
    ;; "\M-[\C-f`"         C-S-f3
    ;; "\M-[\C-fa"         C-S-f4
    ;; "\M-[\C-fb"         C-S-f5
    ;; "\M-[\C-fc"         C-S-f6
    ;; "\M-[\C-fd"         C-S-f7
    ;; "\M-[\C-fe"         C-S-f8
    ;; "\M-[\C-ff"         C-S-f9
    ;; "\M-[\C-fg"         C-S-f10
    )
   (t
    (global-set-key (vcursor-cs-binding "up") #'vcursor-previous-line)
    (global-set-key (vcursor-cs-binding "down") #'vcursor-next-line)
    (global-set-key (vcursor-cs-binding "left") #'vcursor-backward-char)
    (global-set-key (vcursor-cs-binding "right") #'vcursor-forward-char)

    (global-set-key (vcursor-cs-binding "return") #'vcursor-disable)
    (global-set-key (vcursor-cs-binding "insert")  #'vcursor-copy)
    (global-set-key (vcursor-cs-binding "delete") #'vcursor-copy-word)
    (global-set-key (vcursor-cs-binding "remove") #'vcursor-copy-word)
    (global-set-key (vcursor-cs-binding "tab") #'vcursor-toggle-copy)
    (global-set-key (vcursor-cs-binding "backtab") #'vcursor-toggle-copy)
    (global-set-key (vcursor-cs-binding "home") #'vcursor-beginning-of-buffer)
    (global-set-key (vcursor-cs-binding "up" t) #'vcursor-beginning-of-buffer)
    (global-set-key (vcursor-cs-binding "end") #'vcursor-end-of-buffer)
    (global-set-key (vcursor-cs-binding "down" t) #'vcursor-end-of-buffer)
    (global-set-key (vcursor-cs-binding "prior") #'vcursor-scroll-down)
    (global-set-key (vcursor-cs-binding "next") #'vcursor-scroll-up)

    (global-set-key (vcursor-cs-binding "f6") #'vcursor-other-window)
    (global-set-key (vcursor-cs-binding "f7") #'vcursor-goto)

    (global-set-key (vcursor-cs-binding "select")
		    #'vcursor-swap-point) ; DEC keyboards
    (global-set-key (vcursor-cs-binding "tab" t) #'vcursor-swap-point)

    (global-set-key (vcursor-cs-binding "find")
		    #'vcursor-isearch-forward) ; DEC keyboards
    (global-set-key (vcursor-cs-binding "f8") #'vcursor-isearch-forward)

    (global-set-key (vcursor-cs-binding "left" t) #'vcursor-beginning-of-line)
    (global-set-key (vcursor-cs-binding "right" t) #'vcursor-end-of-line)

    (global-set-key (vcursor-cs-binding "prior" t) #'vcursor-backward-word)
    (global-set-key (vcursor-cs-binding "next" t) #'vcursor-forward-word)

    (global-set-key (vcursor-cs-binding "return" t) #'vcursor-copy-line)

    (global-set-key (vcursor-cs-binding "f9") #'vcursor-execute-key)
    (global-set-key (vcursor-cs-binding "f10") #'vcursor-execute-command)
    )))