| commit 27: | 4ca2c0075902 |
| parent 26: | 8a1aac34b173 |
| branch: | default |
Turned on line numbering by default.
emacs /
init.el
| r27:4ca2c0075902 | 110 loc | 3.4 KB | embed / history / annotate / raw / |
|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | ;; Add plugins to load-path
(add-to-list 'load-path "~/.emacs.d/plugins")
;; enable line numbers for text-mode
(global-linum-mode t)
;; set up textmate-mode
(require 'textmate-mode)
(add-hook 'python-mode-hook 'textmate-mode)
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(define-key emacs-lisp-mode-map "(" 'electric-pair)))
(defun electric-pair ()
"Insert character pair without sournding spaces"
(interactive)
(let (parens-require-spaces)
(insert-pair)))
;; Set tabs to be 4 spaces
(setq indent-tabs-mode nil)
(setq tab-width 4)
(setq-default py-indent-offset 4)
;; Put backup files somewhere less annoying
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
;; set more reasonable window size
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 120 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
;; pick whatever numbers make sense for you
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 120))
(add-to-list 'default-frame-alist (cons 'width 80)))
;; for the height, subtract a couple hundred pixels
;; from the screen height (for panels, menubars and
;; whatnot), then divide by the height of a char to
;; get the height we want
(add-to-list 'default-frame-alist
(cons 'height (/ (- (x-display-pixel-height) 200) (frame-char-height)))))))
(set-frame-size-according-to-resolution)
;; enable ido-mode
(require 'ido)
(ido-mode t)
(setq ido-enable-flex-matching t) ;; enable fuzzy matching
;; auto-indent new lines
(define-key global-map (kbd "RET") 'newline-and-indent)
;; Flymake
;; from Justin Lilly
(eval-after-load 'python-mode
'(progn
(require 'flymake)
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "epylint" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))))
;; yasnippet
(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet-0.6.1c")
(require 'yasnippet)
(yas/initialize)
(setq yas/root-directory '("~/.emacs.d/mysnippets"
"~/.emacs.d/plugins/yasnippet-0.6.1c/snippets"))
(mapc 'yas/load-directory yas/root-directory)
(load "~/.emacs.d/plugins/django-mode.el")
;; markdown mode
(autoload 'markdown-mode "markdown-mode.el"
"Major mode for editing Markdown files" t)
(setq auto-mode-alist
(cons '("\\.mdown" . markdown-mode) auto-mode-alist))
;; enable emacs-nav
(require 'nav)
;; display current column number in mode line
(setq column-number-mode t)
(require 'mercurial)
(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.
'(nav-quickdir-list (quote ("~/.emacs.d" "~/PROJECTS" "~/OPENSOURCE"))))
(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.
)
|
