Advertisement
danielhilst

.emacs

Oct 13th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.34 KB | None | 0 0
  1. ;; Load path
  2. (add-to-list 'load-path "~/.emacs.d")
  3.  
  4. ;; Scroll one line
  5. (setq scroll-step 1)
  6.  
  7. ;; C
  8. (setq c-default-style "linux")
  9. (setq-default indent-tabs-mode nil)
  10. (show-paren-mode t)
  11. (setq linum-format "%d ")
  12.  
  13. ;; Colors
  14. (global-font-lock-mode t)
  15.  
  16. ;; Colors
  17. (if (display-graphic-p)
  18.     (progn
  19.       (set-background-color "black")
  20.       (set-foreground-color "white")
  21.       (set-cursor-color "green"))
  22.   (set-face-foreground 'minibuffer-prompt "white"))
  23.  
  24. ;; EShell
  25. (add-hook 'eshell-mode-hook (lambda ()
  26.                               (define-key eshell-mode-map "\C-a" 'eshell-bol)))
  27.  
  28. (defun require-or-get-and-require (feature url full-filename)
  29.   "Download feature from url is not already there, then require feature
  30. The full-filename must be on path"
  31.   (unless (require feature nil t)
  32.     (condition-case err
  33.         (with-current-buffer (url-retrieve-synchronously url)
  34.           (goto-char (point-min))
  35.           (write-region (1+ (re-search-forward "^$")) ;; Skip HTTP header
  36.                         (point-max)
  37.                         full-filename)
  38.           (require feature))
  39.       (error
  40.        (message (format "Error: %s while downloading file %s" (nth 1 err) full-filename))))))
  41. (byte-compile 'require-or-get-and-require)
  42.  
  43. (require-or-get-and-require
  44.  'xcscope
  45.  "http://inst.eecs.berkeley.edu/~cs186/fa05/debugging/xcscope.el"
  46.  "~/.emacs.d/xcscope.el")
  47.  
  48. ;; Neopastebin
  49. (add-to-list 'load-path "~/programming/emacs-pastebin/")
  50. (require 'neopastebin)
  51. (pastebin-create-login :dev-key "86d04e1d25921b3373b20793d5ce064f"
  52.                        :username "danielhilst")
  53.  
  54. (defun jffs2size (size)
  55.   "Calculate de size of a jffs2 filesystem, given its real size in bytes"
  56.   (interactive "nSize: ")
  57.   (let* ((lexical-binding t)
  58.         (pg-size 2048)
  59.         (size (format "%X" (+ size (- pg-size (% size pg-size))))))
  60.     (kill-new size)
  61.     (message (format "Size send to clipboard, %s" size))))
  62.  
  63.  
  64. (require-or-get-and-require
  65.  'bb-mode
  66.  "https://raw.githubusercontent.com/mferland/bb-mode/master/bb-mode.el"
  67.  "~/.emacs.d/bb-mode.el")
  68. (setq auto-mode-alist (cons '("\\.bb$" . bb-mode) auto-mode-alist))
  69. (setq auto-mode-alist (cons '("\\.inc$" . bb-mode) auto-mode-alist))
  70. (setq auto-mode-alist (cons '("\\.bbappend$" . bb-mode) auto-mode-alist))
  71. (setq auto-mode-alist (cons '("\\.bbclass$" . bb-mode) auto-mode-alist))
  72. (setq auto-mode-alist (cons '("\\.conf$" . bb-mode) auto-mode-alist))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement