Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; Load path
- (add-to-list 'load-path "~/.emacs.d/lisp")
- ;; Scroll one line
- (setq scroll-step 1)
- ;; C
- (setq c-default-style "linux")
- (setq-default indent-tabs-mode nil)
- (show-paren-mode t)
- (setq linum-format "%d ")
- ;; Colors
- (global-font-lock-mode t)
- ;; Colors
- (if (display-graphic-p)
- (progn
- (set-background-color "black")
- (set-foreground-color "white")
- (set-cursor-color "green"))
- (set-face-foreground 'minibuffer-prompt "white"))
- ;; EShell
- (add-hook 'eshell-mode-hook (lambda ()
- (define-key eshell-mode-map "\C-a" 'eshell-bol)))
- (defun require-or-get-and-require (feature url full-filename)
- "Download feature from url is not already there, then require feature
- The full-filename must be on path"
- (unless (require feature nil t)
- (condition-case err
- (with-current-buffer (url-retrieve-synchronously url)
- (goto-char (point-min))
- (write-region (1+ (re-search-forward "^$")) ;; Skip HTTP header
- (point-max)
- full-filename)
- (require feature))
- (error
- (message (format "Error: %s while downloading file %s" (nth 1 err) full-filename))))))
- (byte-compile 'require-or-get-and-require)
- (require-or-get-and-require
- 'xcscope
- "http://inst.eecs.berkeley.edu/~cs186/fa05/debugging/xcscope.el"
- "~/.emacs.d/lisp/xcscope.el")
- (setq cscope-use-face nil)
- ;; Neopastebin
- (add-to-list 'load-path "~/programming/emacs-pastebin/")
- (require 'neopastebin)
- (pastebin-create-login :dev-key "86d04e1d25921b3373b20793d5ce064f"
- :username "danielhilst")
- (defun jffs2size (size)
- "Calculate de size of a jffs2 filesystem, given its real size in bytes"
- (interactive "nSize: ")
- (let* ((lexical-binding t)
- (pg-size 2048)
- (size (format "%X" (+ size (- pg-size (% size pg-size))))))
- (kill-new size)
- (message (format "Size send to clipboard, %s" size))))
- (require-or-get-and-require
- 'bb-mode
- "https://raw.githubusercontent.com/mferland/bb-mode/master/bb-mode.el"
- "~/.emacs.d/lisp/bb-mode.el")
- (setq auto-mode-alist (cons '("\\.bb$" . bb-mode) auto-mode-alist))
- (setq auto-mode-alist (cons '("\\.inc$" . bb-mode) auto-mode-alist))
- (setq auto-mode-alist (cons '("\\.bbappend$" . bb-mode) auto-mode-alist))
- (setq auto-mode-alist (cons '("\\.bbclass$" . bb-mode) auto-mode-alist))
- (setq auto-mode-alist (cons '("\\.conf$" . bb-mode) auto-mode-alist))
- (defun bytes-in-region ()
- "Count bytes in region"
- (interactive)
- (message (format "%d bytes" (- (region-end) (region-beginning)))))
- (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.
- '(pastebin-default-paste-list-limit 200))
- (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.
- )
- ;; Wrinting latex
- (defun pdf-update ()
- "Recreates the PDF file from a .tex buffer"
- (interactive)
- (call-process "pdflatex" nil "*pdflatex*" nil (buffer-file-name)))
- (add-hook 'latex-mode-hook (lambda ()
- (add-hook 'after-save-hook 'pdf-update)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement