Вопрос

Have been using wind-move package for switching the point b/w windows. The one problem with the windmove-default-keybindings function is that the shift is used as the modifier and the org-mode grabs the shift-left,right,up,down keys. How to set the Hyper key(windows-logo key) as the modifier. The below code is used by the windmove package to set the default bindings.

(defun windmove-default-keybindings (&optional modifier)
  "Set up keybindings for `windmove'.
Keybindings are of the form MODIFIER-{left,right,up,down}.
Default MODIFIER is 'shift."
  (interactive)
  (unless modifier (setq modifier 'shift))
  (global-set-key (vector (list modifier 'left))  'windmove-left)
  (global-set-key (vector (list modifier 'right)) 'windmove-right)
  (global-set-key (vector (list modifier 'up))    'windmove-up)
  (global-set-key (vector (list modifier 'down))  'windmove-down))
Это было полезно?

Решение

As you can see in the function, you can pass a modifier name to windmove-default-keybindings. In this case:

(windmove-default-keybindings 'hyper)

You can confirm that this works by using:

C-x@h<up>/<down>/<left>/<right>

And if your hyper modifier is working, then of course you can use:

<H-up> / <H-down> / <H-left> / <H-right>

(or you can just bind those directly, similarly to lawlist's answer; windmove just provides the function argument as a convenience)

Другие советы

Solution tested on Windows XP Professional (Service Pack 3) through Parallels Desktop (build 6.0.12090) on OSX Snow Leopard 10.6.8 -- using GNU Emacs 24.3.1 (i386-mingw-nt5.1.2600) of 2013-03-17 on MARVIN.

(setq w32-lwindow-modifier 'super)

(setq w32-rwindow-modifier 'super)

(global-set-key (kbd "<s-up>") 'windmove-up)

(global-set-key (kbd "<s-down>") 'windmove-down)

(global-set-key (kbd "<s-left>") 'windmove-left)

(global-set-key (kbd "<s-right>") 'windmove-right)
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top