Skip to content

Instantly share code, notes, and snippets.

@bcotton
Created February 20, 2015 04:13
Show Gist options
  • Save bcotton/81132ba976d20696a0b2 to your computer and use it in GitHub Desktop.
Save bcotton/81132ba976d20696a0b2 to your computer and use it in GitHub Desktop.
random emacs stuff
(vendor 'rainbow-delimiters)
(vendor 'undo-tree)
(set-face-background 'show-paren-match "#6c6c6c")
(set-face-foreground 'show-paren-match 'nil)
;; (set-face-foreground 'org-block-begin-line "grey31")
;; (set-face-foreground 'org-block-end-line "grey31")
;; (set-face-foreground 'org-block-background "grey14")
(vendor 'zenburn-theme)
(load-theme 'zenburn)
(add-hook 'org-mode-hook
(lambda ()
(local-set-key (kbd "\C-RET") 'org-insert-heading-respect-content)))
(vendor 'ess)
(vendor 'hydra)
(vendor 'ace-window)
(global-set-key (kbd "C-x o") 'ace-window)
(require 'ehelp)
(define-key global-map "\C-h" 'ehelp-command)
(define-key global-map [help] 'ehelp-command)
(define-key global-map [f1] 'ehelp-command)
(defun iwb ()
"indent whole buffer"
(interactive)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max)))
(global-set-key (kbd "\C-cg") 'goto-line)
(define-key global-map [f5] 'eval-region)
(define-key global-map [f12] 'next-error)
;;(define-key global-map "\M-o" 'other-frame)
(define-key global-map "\M-o" 'occur-dwim)
;; These are too global?
(define-key global-map "\M-j" 'dired-jump)
(define-key esc-map "p" 'pop-tag-mark)
(defun comment-or-uncomment-region-or-line ()
"Comments or uncomments the region or the current line if there's no active region."
(interactive)
(let (beg end)
(if (region-active-p)
(setq beg (region-beginning) end (region-end))
(setq beg (line-beginning-position) end (line-end-position)))
(comment-or-uncomment-region beg end)
(next-line)))
(global-set-key (kbd "s-/") 'comment-or-uncomment-region-or-line)
(vendor 'visual-regexp)
(define-key global-map (kbd "C-c r") 'vr/replace)
(define-key global-map (kbd "C-c q") 'vr/query-replace)
;; if you use multiple-cursors, this is for you:
(define-key global-map (kbd "C-c m") 'vr/mc-mark)
;; (add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(put 'narrow-to-region 'disabled nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment