Skip to content

Instantly share code, notes, and snippets.

@j14159
Created September 4, 2014 16:15
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 j14159/79631a8beab70f83f1cf to your computer and use it in GitHub Desktop.
Save j14159/79631a8beab70f83f1cf to your computer and use it in GitHub Desktop.
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(setq-default indent-tabs-mode nil)
(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
(define-key global-map (kbd "C-x g") 'magit-status)
(setq load-path (cons "/usr/local/Cellar/erlang/R16B03-1/lib/erlang/lib/tools-2.6.13/emacs" load-path))
(setq erlang-root-dir "/usr/local/Cellar/R16B03-1")
(setq exec-path (cons "/usr/local/Cellar/erlang/R16B03-1/bin" exec-path))
(require 'erlang-start)
(add-to-list 'load-path "~/opt/edts")
(require 'edts-start)
;; line and column numbering:
(line-number-mode 1)
(column-number-mode 1)
;; show matching parenth:
(show-paren-mode 1)
;; disable backup creation, we've got git for that:
(setq make-backup-files nil)
;; line numbers on left:
(add-to-list 'load-path "/Users/jeremy/.emacs.d")
(require 'linum)
(autoload 'linum-mode "linum" "toggle line numbers on/off" t)
(setq linum-format "%d ")
(global-linum-mode 1)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(edts-man-root "~/.emacs.d/edts/doc/R16B03"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "White" :foreground "Black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 140 :width normal :foundry "apple" :family "Source_Code_Pro")))))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode 1))
;; highlight-symbol key bindings:
(require 'highlight-symbol
(global-set-key (kbd "C-c C-c s") 'highlight-symbol-at-point)
(global-set-key (kbd "C-c C-c n") 'highlight-symbol-next)
(global-set-key (kbd "C-c C-c p") 'highlight-symbol-prev)
(global-set-key (kbd "C-c C-c r") 'highlight-symbol-query-replace)
;; Tyler's scala imenu stuff:
(add-hook 'scala-mode-hook
(lambda ()
(setq imenu-generic-expression
'(
("var" "\\(var +\\)\\([^(): ]+\\)" 2)
("val" "\\(val +\\)\\([^(): ]+\\)" 2)
("override def" "^[ \\t]*\\(override\\) +\\(def +\\)\\([^(): ]+\\)" 3)
("private def" "^[ \\t]*\\(private\\(\\[.*?\\]+\\)*\\) +\\(def +\\)\\([^(): ]+\\)" 4)
("protected def" "^[ \\t]*\\(protected\\(\\[.*?\\]+\\)*\\) +\\(def +\\)\\([^(): ]+\\)" 4)
("implicit def" "^[ \\t]*\\(implicit\\) +\\(def +\\)\\([^(): ]+\\)" 3)
("def" "^[ \\t]*\\(def +\\)\\([^(): ]+\\)" 2)
("trait" "\\(trait +\\)\\([^(): ]+\\)" 2)
("class" "^[ \\t]*\\(class +\\)\\([^(): ]+\\)" 2)
("case class" "^[ \\t]*\\(case class +\\)\\([^(): ]+\\)" 2)
("abstract class" "^[ \\t]*\\(abstract class +\\)\\([^(): ]+\\)" 2)
("object" "\\(object +\\)\\([^(): ]+\\)" 2)
))))
(define-derived-mode imenu-selection-mode fundamental-mode "imenu"
"Major mode for imenu selection."
(suppress-keymap imenu-selection-mode-map)
(define-key imenu-selection-mode-map "j" 'next-line)
(define-key imenu-selection-mode-map "k" 'previous-line)
(define-key imenu-selection-mode-map "l" 'imenu-selection-select)
(define-key imenu-selection-mode-map "\C-m" 'imenu-selection-select)
(define-key imenu-selection-mode-map "h" 'kill-this-buffer)
)
(global-set-key (kbd "C-.") 'imenu-anywhere)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment