1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-09-20 02:31:42 +00:00
dotfiles/emacs.d/init.el

260 lines
7.1 KiB
EmacsLisp
Raw Normal View History

2015-03-10 16:30:06 +00:00
; BalkEmacs --- My emacs configuration
2015-02-21 00:40:31 +00:00
;;; Commentary:
2015-03-24 21:58:59 +00:00
(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.
'(custom-safe-themes (quote ("c3c0a3702e1d6c0373a0f6a557788dfd49ec9e66e753fb24493579859c8e95ab" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" default))))
(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.
)
;;; Config that needs to be loaded before require
(setq evil-want-C-u-scroll t)
2015-02-21 00:40:31 +00:00
;;; Code:
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(setq package-enable-at-startup nil)
(unless (require 'el-get nil 'noerror)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(goto-char (point-max))
(eval-print-last-sexp)))
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
(setq el-get-sources
'((:name molokai-theme
:type github
:pkgname "hbin/molokai-theme"
:load "molokai-theme.el")))
(setq
my:el-get-packages
'(el-get ; el-get is self-hosting
ace-jump-mode
2015-02-23 06:07:14 +00:00
auctex
auctex-latexmk
2015-02-21 00:40:31 +00:00
auto-complete ; complete as you type with overlays
2015-02-23 06:07:14 +00:00
ein
2015-02-21 00:40:31 +00:00
emmet-mode
2015-02-23 06:07:14 +00:00
; escreen ; screen for emacs, C-\ C-h
2015-02-21 00:40:31 +00:00
evil
evil-jumper
evil-matchit
evil-nerd-commenter
2015-03-24 21:58:59 +00:00
evil-numbers
2015-02-21 00:40:31 +00:00
evil-surround
2015-02-23 06:07:14 +00:00
fill-column-indicator
2015-02-21 00:40:31 +00:00
flycheck
2015-02-23 06:07:14 +00:00
gist
2015-02-21 00:40:31 +00:00
helm
2015-02-23 06:07:14 +00:00
helm-ag
2015-02-21 00:40:31 +00:00
helm-projectile
helm-pydoc
2015-02-23 06:07:14 +00:00
jedi
magit
2015-02-21 00:40:31 +00:00
markdown-mode
2015-03-24 21:58:59 +00:00
neotree
2015-02-23 06:07:14 +00:00
nxhtml
2015-03-10 16:30:06 +00:00
nose
2015-02-23 06:07:14 +00:00
pivotal-tracker
2015-03-24 21:58:59 +00:00
popwin
2015-02-23 06:07:14 +00:00
pretty-mode
projectile
;; smex
2015-03-24 21:58:59 +00:00
smart-mode-line
2015-02-23 06:07:14 +00:00
switch-window ; takes over C-x o
2015-03-24 21:58:59 +00:00
undo-tree
2015-02-23 06:07:14 +00:00
yasnippet
; zencoding-mode ; http://www.emacswiki.org/emacs/ZenCoding
2015-02-21 00:40:31 +00:00
;; color-theme-solarized
;; color-theme-tango)) ; check out color-theme-olarized
;; install new packages and init already installed packages
))
(setq my:el-get-packages
(append my:el-get-packages
(mapcar #'el-get-source-name el-get-sources)))
(require 'el-get-elpa)
(unless (file-directory-p el-get-recipe-path-elpa)
(el-get-elpa-build-local-recipes))
(el-get 'sync my:el-get-packages)
(set-default-font "DejaVu Sans Mono")
;;(color-theme-solarized-dark)
;(load-theme 'soothe t)
;;(require 'monokai-theme)
(load-theme 'molokai t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'after-init-hook #'global-flycheck-mode)
2015-03-24 21:58:59 +00:00
(setq flycheck-temp-prefix ".flycheck")
2015-02-21 00:40:31 +00:00
;;(require 'autopair)
;;(autopair-global-mode) ;; to enable in all buffers
;;(setq completion-cycle-threshold t)
(defun toggle-current-window-dedication ()
(interactive)
(let* ((window (selected-window))
(dedicated (window-dedicated-p window)))
(set-window-dedicated-p window (not dedicated))
(message "Window %sdedicated to %s"
(if dedicated "no longer " "")
(buffer-name))))
(global-set-key [pause] 'toggle-current-window-dedication)
2015-03-24 21:58:59 +00:00
;;; Linum
2015-02-21 00:40:31 +00:00
(require 'linum)
(set-face-attribute 'linum nil :height 100 :foreground "#666")
(setq linum-format " %d ")
(set-face-background 'hl-line-face "gray18")
2015-03-24 21:58:59 +00:00
;; (global-linum-mode 1)
;; (setq linum-mode-inhibit-modes-list '(eshell-mode
;; helm-buffer
;; shell-mode
;; ein:notebook-bg-mode
;; ein:bg/ein:notebook
;; ein:bg
;; ein:notebook
;; ))
;; (defadvice linum-on (around linum-on-inhibit-for-modes)
;; "Stop the load of linum-mode for some major modes."
;; (unless (member major-mode linum-mode-inhibit-modes-list)
;; ad-do-it))
;; (ad-activate 'linum-on)
(add-hook 'prog-mode-hook 'linum-mode)
;; (require 'powerline)
;; (powerline-center-evil-theme)
(sml/setup)
(sml/apply-theme 'dark)
2015-02-23 06:07:14 +00:00
2015-02-21 00:40:31 +00:00
(display-time-mode t)
2015-03-24 21:58:59 +00:00
;;; Global emacs settings
;; Disable splash screen
(setq inhibit-splash-screen t)
(setq truncate-partial-width-windows nil)
(set-default 'truncate-lines nil)
2015-02-21 00:40:31 +00:00
;; No tabs, only 4 spaces, as default
(setq-default indent-tabs-mode nil)
(setq tab-width 4)
(setq default-tab-width 4);
2015-02-21 00:40:31 +00:00
2015-03-24 21:58:59 +00:00
;; Separate Configs
2015-02-21 00:40:31 +00:00
(add-to-list 'load-path (concat user-emacs-directory "config"))
2015-03-24 21:58:59 +00:00
(require 'config-latex)
(require 'config-python)
2015-02-21 00:40:31 +00:00
(eval-after-load 'ein-notebooklist
'(require 'config-ein))
2015-03-24 21:58:59 +00:00
(require 'config-helm)
(require 'config-evil)
(require 'config-org)
(require 'config-secret)
2015-02-21 00:40:31 +00:00
2015-03-24 21:58:59 +00:00
;;; popwin
(require 'popwin)
2015-02-21 00:40:31 +00:00
2015-03-24 21:58:59 +00:00
;;; Global modes
(tool-bar-mode -1)
(global-hl-line-mode)
(savehist-mode 1)
(show-paren-mode t)
(popwin-mode 1)
(yas-global-mode 1)
2015-02-21 00:40:31 +00:00
2015-03-24 21:58:59 +00:00
;;; Specific modes
;; (autoload 'markdown-mode "markdown-mode"
;; "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
2015-02-21 00:40:31 +00:00
2015-03-24 21:58:59 +00:00
;;
;; Global Keybindings
;;
2015-02-21 00:40:31 +00:00
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
2015-03-24 21:58:59 +00:00
(global-set-key [escape] 'keyboard-escape-quit)
(define-key helm-map (kbd "C-w") 'backward-kill-word)
2015-02-21 00:40:31 +00:00
;; Don't clover my folders
(setq
backup-by-copying t ; don't clobber symlinks
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t) ; use versioned backups
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" , temporary-file-directory t)))
2015-03-24 21:58:59 +00:00
;; Preven #file#.txt files
(setq create-lockfiles nil)
2015-02-21 00:40:31 +00:00
(setq inhibit-startup-message t)
2015-03-24 21:58:59 +00:00
2015-02-21 00:40:31 +00:00
(toggle-indicate-empty-lines)
2015-03-24 21:58:59 +00:00
;;; Columns
2015-02-21 00:40:31 +00:00
(require 'fill-column-indicator)
(setq fci-rule-column 79)
(fringe-mode '(1 . 1))
2015-02-23 06:07:14 +00:00
(eval-after-load 'magit
'(progn
(set-face-foreground 'magit-diff-add "green3")
(set-face-foreground 'magit-diff-del "red3")
(set-face-background 'magit-item-highlight "black")))
2015-03-24 21:58:59 +00:00
;; Fix Scrolling in tmux
2015-03-10 16:30:06 +00:00
(defun my-terminal-config (&optional frame)
"Establish settings for the current terminal."
(if (not frame) ;; The initial call.
(xterm-mouse-mode 1)
;; Otherwise called via after-make-frame-functions.
(if xterm-mouse-mode
;; Re-initialise the mode in case of a new terminal.
(xterm-mouse-mode 1))))
;; Evaluate both now (for non-daemon emacs) and upon frame creation
;; (for new terminals via emacsclient).
(my-terminal-config)
(add-hook 'after-make-frame-functions 'my-terminal-config)
;; Disable copying to the clipboard
;; (setq x-select-enable-clipboard nil)
;; (setq x-select-enable-primary t)
2015-03-24 21:58:59 +00:00
;;; Neotree
(setq projectile-switch-project-action 'neotree-projectile-action)
2015-03-15 22:29:01 +00:00
2015-03-24 21:58:59 +00:00
;;; Dired
(setq-default dired-listing-switches "-alhv")
(provide '.emacs)