remove emacs
This commit is contained in:
parent
cea751281d
commit
2ba3cdf77e
153 changed files with 129 additions and 107850 deletions
259
.emacs.d/init.el
259
.emacs.d/init.el
|
|
@ -1,107 +1,31 @@
|
|||
;; /This/ file (~init.el~) that you are reading
|
||||
;; should be in this folder
|
||||
(add-to-list 'load-path "~/.emacs.d/")
|
||||
|
||||
(if (< emacs-major-version 23)
|
||||
(defun characterp (obj)
|
||||
(and (char-or-string-p obj) (not (stringp obj)))))
|
||||
|
||||
(add-to-list 'load-path "~/.emacs.d")
|
||||
(add-to-list 'load-path "~/.emacs.d/auto-complete")
|
||||
(add-to-list 'load-path "~/.emacs.d/icicles")
|
||||
(add-to-list 'load-path "~/.emacs.d/tabbar")
|
||||
(add-to-list 'load-path "~/.emacs.d/evil")
|
||||
|
||||
(require 'package)
|
||||
(when (< emacs-major-version 24)
|
||||
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
|
||||
(add-to-list 'package-archives
|
||||
'("melpa" . "http://melpa.milkbox.net/packages/") t)
|
||||
(package-initialize)
|
||||
|
||||
(defun characterp (obj)
|
||||
(and (char-or-string-p obj) (not (stringp obj)))))
|
||||
|
||||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
(require 'icicles)
|
||||
(icy-mode 1)
|
||||
;; Package Manager
|
||||
;; See ~Cask~ file for its configuration
|
||||
;; https://github.com/cask/cask
|
||||
(require 'cask "~/.cask/cask.el")
|
||||
(cask-initialize)
|
||||
|
||||
; Requires
|
||||
;(require 'vimpulse)
|
||||
(require 'evil)
|
||||
(require 'color-theme)
|
||||
(require 'color-theme-autoloads)
|
||||
(require 'tabbar)
|
||||
;(require 'highlight-symbol)
|
||||
(require 'auto-complete-config)
|
||||
(require 'cl)
|
||||
(evil-mode 1)
|
||||
(eval-after-load 'flymake '(require 'flymake-cursor))
|
||||
;; Keeps ~Cask~ file in sync with the packages
|
||||
;; that you install/uninstall via ~M-x list-packages~
|
||||
;; https://github.com/rdallasgray/pallet
|
||||
(require 'pallet)
|
||||
|
||||
;; Root directory
|
||||
(setq root-dir (file-name-directory
|
||||
(or (buffer-file-name) load-file-name)))
|
||||
|
||||
;; Hack to get *Messages* in viper-mode.
|
||||
;; ;; (must be done after loading viper)
|
||||
;; ;; Futzing with fundamental-mode doesn't seem to help.
|
||||
;; (save-excursion
|
||||
;; (set-buffer "*Messages*")
|
||||
;; (viper-change-state-to-vi))
|
||||
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
|
||||
|
||||
|
||||
(add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/dict")
|
||||
(ac-config-default)
|
||||
(setq ac-dwim t)
|
||||
(setq ac-expand-on-auto-complete nil)
|
||||
(setq ac-use-fuzzy t)
|
||||
;(setq viper-search-wrap-around t)
|
||||
;(setq viper-no-multiple-ESC t)
|
||||
;(setq viper-translate-all-ESC-keysequences nil)
|
||||
;(setq viper-always t)
|
||||
;(setq viper-vi-style-in-minibuffer nil)
|
||||
(setq-default indent-tabs-mode nil)
|
||||
;(define-key ac-completing-map "\t" 'ac-fuzzy-complete)
|
||||
;(define-key ac-completing-map "\r" nil)
|
||||
(define-key ac-completing-map (kbd "<escape>") 'ac-stop)
|
||||
|
||||
|
||||
; This is the other Vim-mode. Maybe should delete this..
|
||||
;
|
||||
;(add-to-list 'load-path "~/.emacs.d/vim-mode")
|
||||
;(require 'vim)
|
||||
;(vim-mode 1)
|
||||
|
||||
; Tabbar settings (Simple groups)
|
||||
(defun tabbar-buffer-groups ()
|
||||
"Return the list of group names the current buffer belongs to.
|
||||
This function is a custom function for tabbar-mode's tabbar-buffer-groups.
|
||||
This function group all buffers into 3 groups:
|
||||
Those Dired, those user buffer, and those emacs buffer.
|
||||
Emacs buffer are those starting with “*”."
|
||||
(list
|
||||
(cond
|
||||
((string-equal "*" (substring (buffer-name) 0 1))
|
||||
"Emacs Buffer"
|
||||
)
|
||||
((eq major-mode 'dired-mode)
|
||||
"Dired"
|
||||
)
|
||||
(t
|
||||
"User Buffer"
|
||||
)
|
||||
))) ;; from Xah Lee
|
||||
(setq tabbar-buffer-groups-function 'tabbar-buffer-groups)
|
||||
|
||||
(tabbar-mode)
|
||||
|
||||
;(add-to-list 'ex-token-alist '("ls" (list-buffers)))
|
||||
;(add-to-list 'ex-token-alist '("mx" (icicle-execute-extended-command)))
|
||||
;(vimpulse-map "gn" 'tabbar-forward-tab)
|
||||
;(vimpulse-map "gp" 'tabbar-backward-tab)
|
||||
;(vimpulse-map "gw" 'vimpulse-search-forward-for-symbol-at-point)
|
||||
;(vimpulse-map "gK" 'kill-buffer-and-window)
|
||||
;(vimpulse-map "gc" 'kill-buffer-and-window)
|
||||
;(define-key viper-insert-global-user-map "\C-d" 'delete-char))
|
||||
(define-key evil-normal-state-map "gn" 'tabbar-forward-tab)
|
||||
(define-key evil-normal-state-map "gp" 'tabbar-backward-tab)
|
||||
(define-key evil-normal-state-map "gc" 'kill-buffer-and-window)
|
||||
|
||||
(add-hook 'window-setup-hook 'delete-other-windows)
|
||||
|
||||
; Basic frame defaults
|
||||
;; Don't show startup screen
|
||||
(let ((background-color "#2F2F2F")
|
||||
(foreground-color "LightGrey")
|
||||
(fname "Inconsolata-13")
|
||||
|
|
@ -117,61 +41,104 @@
|
|||
(add-to-list 'default-frame-alist (cons 'height fheight))
|
||||
(add-to-list 'default-frame-alist (cons 'width fwidth))
|
||||
)
|
||||
(custom-set-variables '(inhibit-startup-screen t))
|
||||
(custom-set-faces)
|
||||
; Run color-theme
|
||||
(color-theme-initialize)
|
||||
(color-theme-barak)
|
||||
(color-theme-barak-extras)
|
||||
(setq font-lock-maximum-decoration 3)
|
||||
(setq inhibit-startup-screen t)
|
||||
|
||||
(load "~/.emacs.d/haskell-mode/haskell-site-file")
|
||||
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
|
||||
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
|
||||
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
|
||||
(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
|
||||
;; Show keystrokes
|
||||
(setq echo-keystrokes 0.02)
|
||||
|
||||
(require 'highlight-parentheses)
|
||||
;; Path
|
||||
(require 'exec-path-from-shell)
|
||||
(when (memq window-system '(mac ns))
|
||||
(exec-path-from-shell-initialize))
|
||||
|
||||
(setq hl-paren-colors
|
||||
'(;"#8f8f8f" ; this comes from Zenburn
|
||||
; and I guess I'll try to make the far-outer parens look like this
|
||||
"orange1" "yellow1" "greenyellow" "green1"
|
||||
"springgreen1" "cyan1" "slateblue1" "magenta1" "purple"))
|
||||
;; Evil!
|
||||
(require 'evil)
|
||||
(evil-mode 1)
|
||||
(setq evil-default-cursor t)
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook (lambda () (highlight-parentheses-mode)))
|
||||
;; Git
|
||||
(require 'magit)
|
||||
(eval-after-load 'magit
|
||||
(progn '(global-set-key (kbd "C-x g") 'magit-status)))
|
||||
|
||||
;(defadvice viper-maybe-checkout (around viper-svn-checkin-fix activate)
|
||||
;"Advise viper-maybe-checkout to ignore svn files."
|
||||
;(let ((file (expand-file-name (buffer-file-name buf))))
|
||||
;(when (and (featurep 'vc-hooks)
|
||||
;(not (memq (vc-backend file) '(nil SVN))))
|
||||
;ad-do-it)))
|
||||
;; flx-ido completion system, recommended by Projectile
|
||||
(require 'flx-ido)
|
||||
(flx-ido-mode 1)
|
||||
;; change it if you have a fast processor.
|
||||
(setq flx-ido-threshhold 1000)
|
||||
|
||||
;; add a buffer modification state indicator in the tab label,
|
||||
;; and place a space around the label to make it looks less crowd
|
||||
(defadvice tabbar-buffer-tab-label (after fixup_tab_label_space_and_flag activate)
|
||||
(setq ad-return-value
|
||||
(if (and (buffer-modified-p (tabbar-tab-value tab))
|
||||
(buffer-file-name (tabbar-tab-value tab)))
|
||||
(concat " " (concat ad-return-value "+ "))
|
||||
(concat " " (concat ad-return-value " ")))))
|
||||
;; called each time the modification state of the buffer changed
|
||||
(defun ztl-modification-state-change ()
|
||||
(tabbar-set-template tabbar-current-tabset nil)
|
||||
(tabbar-display-update))
|
||||
;; first-change-hook is called BEFORE the change is made
|
||||
(defun ztl-on-buffer-modification ()
|
||||
(set-buffer-modified-p t)
|
||||
(ztl-modification-state-change))
|
||||
;; Project management
|
||||
(require 'ack-and-a-half)
|
||||
(require 'projectile)
|
||||
(projectile-global-mode)
|
||||
|
||||
(defun ztl-on-buffer-demodification ()
|
||||
(set-buffer-modified-p nil)
|
||||
(ztl-modification-state-change))
|
||||
(add-hook 'after-save-hook 'ztl-modification-state-change)
|
||||
;; this doesn't work for revert, I don't know
|
||||
(add-hook 'after-revert-hook 'ztl-on-buffer-demodification)
|
||||
(add-hook 'first-change-hook 'ztl-on-buffer-modification)
|
||||
;; Snippets
|
||||
;; https://github.com/capitaomorte/yasnippet
|
||||
(require 'yasnippet)
|
||||
(yas-load-directory (concat root-dir "snippets"))
|
||||
(yas-global-mode 1)
|
||||
|
||||
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
|
||||
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
|
||||
;; Evil Key Defines
|
||||
(define-key evil-normal-state-map "gc" 'kill-buffer-and-window)
|
||||
|
||||
(load-theme 'barak)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; Hack to get *Messages* in viper-mode.
|
||||
;; ;; (must be done after loading viper)
|
||||
;; ;; Futzing with fundamental-mode doesn't seem to help.
|
||||
;; (save-excursion
|
||||
;; (set-buffer "*Messages*")
|
||||
;; (viper-change-state-to-vi))
|
||||
|
||||
|
||||
;Tabbar settings (Simple groups)
|
||||
;(defun tabbar-buffer-groups ()
|
||||
;"Return the list of group names the current buffer belongs to.
|
||||
;This function is a custom function for tabbar-mode's tabbar-buffer-groups.
|
||||
;This function group all buffers into 3 groups:
|
||||
;Those Dired, those user buffer, and those emacs buffer.
|
||||
;Emacs buffer are those starting with “*”."
|
||||
;(list
|
||||
;(cond
|
||||
;((string-equal "*" (substring (buffer-name) 0 1))
|
||||
;"Emacs Buffer"
|
||||
;)
|
||||
;((eq major-mode 'dired-mode)
|
||||
;"Dired"
|
||||
;)
|
||||
;(t
|
||||
;"User Buffer"
|
||||
;)
|
||||
;))) ; from Xah Lee
|
||||
;(setq tabbar-buffer-groups-function 'tabbar-buffer-groups)
|
||||
|
||||
;(tabbar-mode)
|
||||
|
||||
;(add-to-list 'ex-token-alist '("ls" (list-buffers)))
|
||||
;(add-to-list 'ex-token-alist '("mx" (icicle-execute-extended-command)))
|
||||
;(vimpulse-map "gn" 'tabbar-forward-tab)
|
||||
;(vimpulse-map "gp" 'tabbar-backward-tab)
|
||||
;(vimpulse-map "gw" 'vimpulse-search-forward-for-symbol-at-point)
|
||||
;(vimpulse-map "gK" 'kill-buffer-and-window)
|
||||
;(vimpulse-map "gc" 'kill-buffer-and-window)
|
||||
;(define-key viper-insert-global-user-map "\C-d" 'delete-char))
|
||||
;(define-key evil-normal-state-map "gn" 'tabbar-forward-tab)
|
||||
;(define-key evil-normal-state-map "gp" 'tabbar-backward-tab)
|
||||
|
||||
;(add-hook 'window-setup-hook 'delete-other-windows)
|
||||
(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 ("f2acfa2f448218e8868bbb4b914e9f5a8c580e8a33d19809f4a4f32ad306cab5" "9df3b76bdd78c0209521b4e0374dcbdd4f2c8cd40ca00fedcd499e53630c646b" "6ca7862869dcbf7079ab507dbceb37e42e71fe7dd4b83f994de9b42037436bf2" "7a3b1a9661a271313a71a5177f31f344f533cab4c68c47985571d28b8f320769" "9370aeac615012366188359cb05011aea721c73e1cb194798bc18576025cabeb" 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.
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue