Skip to content

Instantly share code, notes, and snippets.

@danidoni
Created April 10, 2014 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danidoni/10378344 to your computer and use it in GitHub Desktop.
Save danidoni/10378344 to your computer and use it in GitHub Desktop.
;; Move M-x to C-x C-m or C-c C-m
(global-set-key "\C-x\C-m" 'execute-extended-command)
(global-set-key "\C-c\C-m" 'execute-extended-command)
;; Remap keys on Mac OS
(when (eq 'ns (window-system))
(defun closing-curly-brace-symbol ()
(interactive)
(insert "}"))
(defun closing-braket-symbol ()
(interactive)
(insert "]"))
(defun at-symbol ()
(interactive)
(insert "@"))
(defun tilde-symbol ()
(interactive)
(insert "~"))
(defun sharp-symbol ()
(interactive)
(insert "#"))
(defun pipe-symbol ()
(interactive)
(insert "|"))
(defun slash-symbol ()
(interactive)
(insert "\\"))
(global-set-key (kbd "M-ç") 'closing-curly-brace-symbol)
(global-set-key (kbd "M-+") 'closing-braket-symbol)
(global-set-key (kbd "M-2") 'at-symbol)
(global-set-key (kbd "M-ñ") 'tilde-symbol)
(global-set-key (kbd "M-3") 'sharp-symbol)
(global-set-key (kbd "M-1") 'pipe-symbol)
(global-set-key (kbd "M-º") 'slash-symbol))
(setq ns-pop-up-frames nil)
;; Insert a debugger statement on cursor
(defun insert-debugger ()
(interactive)
(insert "require 'ruby-debug'; debugger; 2+2"))
(global-set-key (kbd "C-c C-d") 'insert-debugger)
(key-chord-mode -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment