help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which modifier to use?


From: Arthur Miller
Subject: Re: Which modifier to use?
Date: Sat, 05 Dec 2020 15:55:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis <bugs@gnu.support> writes:

> I have too many keys on Hyper modifier and need a keys for many
> functions. Emacs is mostly not modal and I am not using viper mode,
> but as modal it would offer me quick access to key bindings such as:
>
> - / a
> - / s
>
> Maybe CapsLk can be used as modifier or prefix key?
Have  you considering using your own prefix?

I am using C-z C-v and C-f as prefixes
(C-f is a bit questionable :-)):

 (define-prefix-command 'C-z-map)
 (global-set-key (kbd "C-z") 'C-z-map)
 (define-prefix-command 'C-f-map)
 (global-set-key (kbd "C-f") 'C-f-map)
 (global-unset-key (kbd "C-v")

That gives me like 3 keyboards of extra keybindings to use, so I can
have my own bindings like this:

 (with-hook after-init
    (with-key-map global    
      ("M-x"     . helm-M-x)
      ("C-x C-b" . helm-buffers-list)
      ("C-z a"   . helm-ag)
      ("C-z b"   . helm-filtered-bookmarks)
      ("C-z c"   . helm-company)
      ("C-z d"   . helm-dabbrev)
      ("C-z e"   . helm-calcul-expression)
      ("C-z g"   . helm-google-suggest)
      ("C-z h"   . helm-descbinds)
      ("C-z i"   . helm-imenu-anywhere)
      ("C-z k"   . helm-show-kill-ring)

      ("C-z f"   . helm-find-files)
      ("C-z m"   . helm-mini)
      ("C-z o"   . helm-occur)
      ("C-z p"   . helm-browse-project)
      ("C-z q"   . helm-apropos)
      ("C-z r"   . helm-recentf)
      ("C-z s"   . helm-swoop)
      ("C-z C-c" . helm-colors)
      ("C-z x"   . helm-M-x)
      ("C-z y"   . helm-yas-complete)
      ("C-z C-g" . helm-ls-git-ls)
      ("C-z SPC" . helm-all-mark-rings)))
      
 (with-key-map global
               ;; Window-buffer operations
               ([f1]      . term-toggle)
               ([f2]      . term-toggle-eshell)
               ([f9]      . ispell-word)
               ([S-f10]   . next-buffer)
               ([f10]     . previous-buffer)
               ([f12]     . kill-buffer-but-not-some)
               ([M-f12]   . kill-buffer-other-window)
               ([C-M-f12] . only-current-buffer)

               ;; Emacs windows
               ("C-v <left>"   . windmove-left)
               ("C-v <right>"  . windmove-right)
               ("C-v <up>"     . windmove-up)
               ("C-v <down>"   . windmove-down)
               ("C-v o"        . other-window)
               ("C-v s"        . z-swap-windows)
               ("C-v l"        . windmove-left)
               ("C-v r"        . windmove-right)
               ("C-v u"        . windmove-up)
               ("C-v d"        . windmove-down)
               ("C-v C-+"      . enlarge-window-horizontally)
               ("C-v C-,"      . enlarge-window-vertically)
               ("C-v C--"      . shrink-window-horizontally)
               ("C-v C-."      . shrink-window-vertically)
               ("C-v -"        . winner-undo)
               ("C-v +"        . winner-redo)
               ("C-v C-k"      . delete-window)
               ("C-v C-l"      . kill-window-left)
               ("C-v C-r"      . kill-window-right)
               ("C-v C-a"      . kill-window-above)
               ("C-v C-b"      . kill-window-below)
               ("C-v <return>" . delete-other-windows)
               ("C-v ,"        . split-window-right)
               ("C-v ."        . split-window-below)

               ;; cursor movement
               ("M-n"     . scroll-up-line)
               ("M-N"     . scroll-up-command)
               ("M-p"     . scroll-down-line)
               ("M-P"     . scroll-down-command)
               ("C-f n"   . next-buffer)
               ("C-f p"   . previous-buffer)
               ("C-f C-c" . org-capture)

               ;; emms
               ("C-v e SPC"   . emms-pause)
               ("C-v e d"     . emms-play-directory)
               ("C-v e l"     . emms-play-list)
               ("C-v e n"     . emms-next)
               ("C-v e p"     . emms-previous)
               ("C-v e a"     . emms-add-directory)
               ("C-v e A"     . emms-add-directory-tree)
               ("C-v e +"     . emms-volume-raise)
               ("C-v e -"     . emms-volume-lower)
               ("C-v e +"     . emms-volume-mode-plus)
               ("C-v e -"     . emms-volume-mode-minus)
               ("C-v e r"     . emms-start)
               ("C-v e s"     . emms-stop)
               ("C-v e m"     . emms-play-m3u-playlist)

               ;; some random stuff
               ("C-f f"     . right-char)
               ("C-x C-j"   . dired-jump)
               ("C-x 4 C-j" . dired-jump-other-window)
               ("C-f i"     . (lambda() 
                                (interactive)
                                (find-file (expand-file-name
                                            "init.org" 
user-emacs-directory))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]