Browse Source

Change some stuff in the init.el, including switching from helm to ivy + swiper

master
Taylor Bockman 9 years ago
parent
commit
be3afc2447
  1. 76
      dotfiles/emacs.d/init.el
  2. 4
      dotfiles/emacs.d/package.el
  3. 16
      dotfiles/emacs.d/smex-items
  4. 32
      dotfiles/global_gitignore

76
dotfiles/emacs.d/init.el

@ -53,11 +53,11 @@
;; Prefer UTF-8 for buffers ;; Prefer UTF-8 for buffers
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------
;; (prefer-coding-system 'utf-8) (prefer-coding-system 'utf-8)
;; (set-terminal-coding-system 'utf-8) (set-terminal-coding-system 'utf-8)
(defun set-buffer-utf8 () (defun set-buffer-utf8 ()
(set-buffer-process-coding-system 'iso-8859-8 'iso-8859-8) (set-buffer-process-coding-system 'utf-8 'utf-8)
) )
(add-hook 'eshell-mode-hook 'set-buffer-utf8) (add-hook 'eshell-mode-hook 'set-buffer-utf8)
@ -180,6 +180,10 @@
(package-initialize) (package-initialize)
;; This will force any out of date packages to update automatically
(when (not package-archive-contents)
(package-refresh-contents))
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------
;; Install and load Packages ;; Install and load Packages
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------
@ -269,20 +273,15 @@
(show-paren-mode 1) (show-paren-mode 1)
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------
;; Helm Configuration ;; Ivy Configuration
;;-------------------------------------------------------------------------------------- ;;--------------------------------------------------------------------------------------
(helm-mode t) (ivy-mode 1)
(helm-adaptive-mode t) ;; Sort results by most frequently used
(require 'helm-projectile)
(helm-projectile-on)
;; Use ag instead of grep for in-file searches in helm-find-file (setq projectile-completion-system 'ivy)
(setq magit-complete-read-function 'ivy-completing-read)
(setq ivy-use-virtual-buffers t)
(when (executable-find "ag")
(setq helm-grep-default-command "ag -H --nogroup --nocolor %e %p %f"
helm-grep-default-recurse-command "ag -H --nogroup --nocolor %e %p %f"))
;;------------------------------------------------------------------------------------- ;;-------------------------------------------------------------------------------------
;; Enable Autocomplete ;; Enable Autocomplete
@ -354,6 +353,24 @@
(info) (info)
) )
;; Remove strange characters that don't seem to correspond to anything
(defvar ansi-escape-re
(rx (or ?\233 (and ?\e ?\[))
(zero-or-more (char (?0 . ?\?)))
(zero-or-more (char ?\s ?- ?\/))
(char (?@ . ?~))))
(defun nuke-ansi-escapes (beg end)
(save-excursion
(goto-char beg)
(while (re-search-forward ansi-escape-re end t)
(replace-match ""))))
(defun eshell-nuke-ansi-escapes ()
(nuke-ansi-escapes eshell-last-output-start eshell-last-output-end))
(add-hook 'eshell-output-filter-functions 'eshell-nuke-ansi-escapes t)
;; Correct the path ;; Correct the path
(setenv "PATH" (concat "/usr/local/bin:/usr/local/sbin:" (getenv "PATH"))) (setenv "PATH" (concat "/usr/local/bin:/usr/local/sbin:" (getenv "PATH")))
@ -388,15 +405,17 @@
;; Neotree Configuration ;; Neotree Configuration
;;------------------------------------------------------------------------------------- ;;-------------------------------------------------------------------------------------
(setq neo-theme 'nerd) (setq neo-theme 'ascii)
(setq neo-vc-integration '(char)) (setq neo-vc-integration '(char))
(setq neo-persist-show t)
(add-hook 'neo-enter-hook 'redraw-display)
;;------------------------------------------------------------------------------------- ;;-------------------------------------------------------------------------------------
;; Key Bindings ;; Key Bindings
;;------------------------------------------------------------------------------------- ;;-------------------------------------------------------------------------------------
;; Unbind C-t from transpose ;; Unbind C-t from transpose
(global-set-key (kbd "C-t") nil) (global-set-key (kbd "C-t") nil)
(global-set-key (kbd "C-d") nil) (global-set-key (kbd "C-d") nil)
@ -406,15 +425,16 @@
;; Unbind C-c p f from projectile ;; Unbind C-c p f from projectile
(global-set-key (kbd "C-c p f") nil) (global-set-key (kbd "C-c p f") nil)
;; Unbind C-s from Isearch to make room for helm-ag ;; Unbind C-s from Isearch to make room for swiper
;(global-set-key (kbd "C-s") nil) (global-set-key (kbd "C-s") nil)
(global-set-key (kbd "C-x C-b") nil) (global-set-key (kbd "C-x C-b") nil)
(global-set-key (kbd "C-x C-f") nil)
(global-set-key (kbd "C-c r") nil) (global-set-key (kbd "C-c r") nil)
;; Neotree binds are prefixed by C-t ;; Neotree binds are prefixed by C-t
(global-set-key (kbd "C-t t") 'neotree-toggle) (global-set-key (kbd "C-t t") 'neotree-toggle)
(global-set-key (kbd "C-t n") 'neotree-create-node) (global-set-key (kbd "C-t n") 'neotree-create-node)
(global-set-key (kbd "C-t d") 'neotree-delete-node) (global-set-key (kbd "C-t d") 'neotree-delete-node)
@ -422,39 +442,41 @@
(global-set-key (kbd "C-t h") 'neotree-hidden-file-toggle) (global-set-key (kbd "C-t h") 'neotree-hidden-file-toggle)
;; Pane navigation ;; Pane navigation
(global-set-key (kbd "M-h") 'windmove-left) (global-set-key (kbd "M-h") 'windmove-left)
(global-set-key (kbd "M-j") 'windmove-down) (global-set-key (kbd "M-j") 'windmove-down)
(global-set-key (kbd "M-k") 'windmove-up) (global-set-key (kbd "M-k") 'windmove-up)
(global-set-key (kbd "M-l") 'windmove-right) (global-set-key (kbd "M-l") 'windmove-right)
;; Delete surrounding ;; Delete surrounding
(global-set-key (kbd "C-d s") 'delete-pair) (global-set-key (kbd "C-d s") 'delete-pair)
;; Kill whole line ;; Kill whole line
(global-set-key (kbd "C-d d") 'kill-whole-line) (global-set-key (kbd "C-d d") 'kill-whole-line)
;; Git utility ;; Git utility
(global-set-key (kbd "C-x g s") 'magit-status) (global-set-key (kbd "C-x g s") 'magit-status)
(global-set-key (kbd "C-x g b") 'magit-blame-popup) (global-set-key (kbd "C-x g b") 'magit-blame-popup)
(global-set-key (kbd "C-x g p") 'magit-dispatch-popup) (global-set-key (kbd "C-x g p") 'magit-dispatch-popup)
(global-set-key (kbd "C-x g f") 'magit-file-popup) (global-set-key (kbd "C-x g f") 'magit-file-popup)
;; Fix RET ;; Fix RET
(global-set-key (kbd "RET") 'electric-newline-and-maybe-indent) (global-set-key (kbd "RET") 'electric-newline-and-maybe-indent)
;; Helm ;; Helm
;(global-set-key (kbd "C-c p f") 'helm-projectile-find-file)
(global-set-key (kbd "C-c p f") 'helm-projectile-find-file) ;(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
;(global-set-key (kbd "C-s") 'helm-do-ag-this-file) ;(global-set-key (kbd "C-s") 'helm-do-ag-this-file)
;; IBuffer ;; Swiper
(global-set-key (kbd "C-s") 'swiper)
;; Ivy find file
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
;; Better M-x
;;(global-set-key (kbd "M-x") 'counsel-M-x)
;; IBuffer
(global-set-key (kbd "C-x C-b") 'ibuffer) (global-set-key (kbd "C-x C-b") 'ibuffer)
;; Relative line numbering ;; Relative line numbering

4
dotfiles/emacs.d/package.el

@ -2,8 +2,8 @@
(defvar my-packages '(ag auto-complete clojure-mode coffee-mode css-mode circe framemove flycheck (defvar my-packages '(ag auto-complete clojure-mode coffee-mode css-mode circe framemove flycheck
esh-help fill-column-indicator flycheck-clojure flycheck-haskell flycheck-rust esh-help fill-column-indicator flycheck-clojure flycheck-haskell flycheck-rust
flycheck-pos-tip gitignore-mode haskell-mode helm helm-ag linum-relative helm-projectile flycheck-pos-tip gitignore-mode haskell-mode swiper linum-relative
js2-mode less-css-mode magit neotree paredit scala-mode2 scss-mode powerline js2-mode less-css-mode magit neotree paredit scala-mode2 scss-mode smex powerline
projectile rust-mode color-theme-solarized wrap-region stylus-mode rainbow-delimiters) projectile rust-mode color-theme-solarized wrap-region stylus-mode rainbow-delimiters)
"Packages to make sure are installed") "Packages to make sure are installed")

16
dotfiles/emacs.d/smex-items

@ -0,0 +1,16 @@
;; ----- smex-history -----
(
ag
cd
5x5
arp
dbx
dig
erc
)
;; ----- smex-data -----
(
)

32
dotfiles/global_gitignore

@ -0,0 +1,32 @@
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
Loading…
Cancel
Save