Use the helper to setup global keys

master
Jacopo De Simoi 7 years ago
parent e982bc0ce9
commit bf98805fba
  1. 38
      global.org

@ -280,22 +280,23 @@
The following are some convenient bindings; notice that on my layout F13 and The following are some convenient bindings; notice that on my layout F13 and
F14 are obtained by tapping the left and right shift respectively F14 are obtained by tapping the left and right shift respectively
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(global-set-key (kbd "<f13>") 'set-mark-command)
(global-set-key (kbd "<f14>") 'set-mark-command)
(defun jump-to-mark () (defun jump-to-mark ()
"Jumps to the local mark, respecting the `mark-ring' order. "Jumps to the local mark, respecting the `mark-ring' order.
This is the same as using \\[set-mark-command] with the prefix argument." This is the same as using \\[set-mark-command] with the prefix argument."
(interactive) (interactive)
(set-mark-command 1)) (set-mark-command 1))
(global-set-key (kbd "<M-f13>") 'jump-to-mark)
(global-set-key (kbd "<M-f14>") 'jump-to-mark)
(defun just-activate-mark () (defun just-activate-mark ()
(interactive) (interactive)
(activate-mark)) (activate-mark))
(global-set-key (kbd "<S-f13>") 'just-activate-mark)
(global-set-key (kbd "<S-f14>") 'just-activate-mark) (global-set-key-alist
'(("<f13>" . set-mark-command)
("<f14>" . set-mark-command)
("<M-f13>" . jump-to-mark)
("<M-f14>" . jump-to-mark)
("<S-f13>" . just-activate-mark)
("<S-f14>" . just-activate-mark)))
#+END_SRC #+END_SRC
** Global bindings ** Global bindings
Remove some supremely annoying bindings Remove some supremely annoying bindings
@ -313,11 +314,12 @@
#+END_SRC #+END_SRC
Add some opinionated bindings Add some opinionated bindings
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(global-set-key (kbd "C-M-d") 'kill-sexp) (global-set-key-alist
(global-set-key (kbd "C-M-<backspace>") 'backward-kill-sexp) '(("C-M-d" . kill-sexp)
(global-set-key (kbd "C-x k") 'kill-this-buffer) ("C-M-<backspace>" . backward-kill-sexp)
(global-set-key (kbd "C-S-v") 'scroll-down-command) ("C-x k" . kill-this-buffer)
(global-set-key (kbd "C-M-u") 'universal-argument) ("C-S-v" . scroll-down-command)
("C-M-u" . universal-argument)))
#+END_SRC #+END_SRC
** Disable commands ** Disable commands
Enable narrow commands Enable narrow commands
@ -1259,11 +1261,13 @@
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'helm-config) (require 'helm-config)
(helm-mode 1) (helm-mode 1)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-f") 'helm-find-files) (global-set-key-alist
(global-set-key (kbd "C-x b") 'helm-mini) '(("M-x" . helm-M-x)
(global-set-key (kbd "C-x C-b") 'helm-mini) ("C-x C-f" . helm-find-files)
(global-set-key (kbd "M-y") 'helm-show-kill-ring) ("C-x b" . helm-mini)
("C-x C-b" . helm-mini)
("M-y" . helm-show-kill-ring)))
(define-key helm-map (kbd "C-h") nil) (define-key helm-map (kbd "C-h") nil)
(define-key helm-find-files-map (kbd "C-h") nil) (define-key helm-find-files-map (kbd "C-h") nil)
(define-key helm-find-files-map (kbd "C-<backspace>") nil) (define-key helm-find-files-map (kbd "C-<backspace>") nil)

Loading…
Cancel
Save