Refactor initfiles

This commit is contained in:
Henrik Lissner
2014-07-21 03:52:01 -04:00
parent d5f2bb1d23
commit 223e9843b6
11 changed files with 96 additions and 84 deletions

View File

@@ -28,6 +28,7 @@
key-chord ; for mapping key chords in insert mode
multiple-cursors ; cursors, of the numerous variety
ediff
deferred
))

View File

@@ -3,26 +3,26 @@
(gmap (kbd "<C-escape>") 'open-scratch-buffer)
(gmap (kbd "M-x") 'smex)
(gmap (kbd "M-X") 'smex-major-mode-commands)
(gmap (kbd "C-c p") 'package-list-packages)
(gmap (kbd "C-c C-p") 'package-list-packages)
(when (is-osx)
(map (kbd "C-c o") 'send-dir-to-finder)
(map (kbd "C-c u") 'send-to-transmit)
(map (kbd "C-c l") 'send-to-launchbar)
(map (kbd "C-c L") 'send-dir-to-launchbar)
(map (kbd "C-c t") (lambda() (interactive) (shell)))
(map (kbd "C-s-RET") 'send-to-iterm)
(nmap (kbd "C-c o") 'send-dir-to-finder)
(nmap (kbd "C-c u") 'send-to-transmit)
(nmap (kbd "C-c l") 'send-to-launchbar)
(nmap (kbd "C-c L") 'send-dir-to-launchbar)
(nmap (kbd "C-c t") (lambda() (interactive) (shell)))
(nmap (kbd "C-s-RET") 'send-to-iterm)
;; Evaluating elisp
(nmap (kbd "C-c x") 'eval-buffer)
(vmap (kbd "C-c x") 'eval-region)
(nmap (kbd "C-c x") 'eval-buffer)
(vmap (kbd "C-c x") 'eval-region)
(when window-system
(gmap (kbd "s-+") 'text-scale-increase)
(gmap (kbd "s--") 'text-scale-decrease)
(gmap (kbd "s-+") 'text-scale-increase)
(gmap (kbd "s--") 'text-scale-decrease)
(gmap (kbd "s-/") 'evilnc-comment-or-uncomment-lines)
(gmap (kbd "s-w") 'kill-buffer-and-window)
(gmap (kbd "s-/") 'evilnc-comment-or-uncomment-lines)
(gmap (kbd "s-w") 'kill-buffer-and-window)
;; Faster scrolling
(nmap (kbd "s-j") "5j")
@@ -41,14 +41,14 @@
(imap (kbd "<kp-delete>") 'delete-char)
;; Leader alternatives
(map (kbd "s-f") 'projectile-find-file)
(map (kbd "s-F") 'projectile-ag)
(map (kbd "s-r") 'helm-recentf)
(map (kbd "s-R") 'projectile-recentf)
(map (kbd "s-o") 'ido-find-file)
(map (kbd "s-O") 'open-major-mode-conf)
(map (kbd "s-d") 'mc/mark-next-like-this)
(map (kbd "s-D") 'mc/mark-all-like-this)
(nmap (kbd "s-f") 'projectile-find-file)
(nmap (kbd "s-F") 'projectile-ag)
(nmap (kbd "s-r") 'helm-recentf)
(nmap (kbd "s-R") 'projectile-recentf)
(nmap (kbd "s-o") 'ido-find-file)
(nmap (kbd "s-O") 'open-major-mode-conf)
(nmap (kbd "s-d") 'mc/mark-next-like-this)
(nmap (kbd "s-D") 'mc/mark-all-like-this)
)
)
@@ -119,12 +119,6 @@
(evil-visual-restore))
)
(imap
; Auto-completion
(kbd "C-SPC") 'ac-fuzzy-complete
(kbd "C-S-SPC") 'ac-quick-help
)
;; Commenting lines
(nmap "gcc" 'evilnc-comment-or-uncomment-lines)
(vmap "gc" 'evilnc-comment-or-uncomment-lines)
@@ -134,7 +128,6 @@
(vmap "!" 'rotate-region)
;; (imap (kbd "RET") 'comment-indent-new-line)
;; Disable return for auto-completion, since tab does the trick
(define-key ac-completing-map (kbd "RET") nil)
(imap (kbd "<C-return>") 'indent-new-comment-line)
;; Enable TAB to do matchit

View File

@@ -14,6 +14,7 @@
(add-hook 'before-make-frame-hook
(lambda() (setq x-select-enable-clipboard t)))
;; TODO: Make server-friendly
(when window-system
;; Curse you Lion-esque fullscreen mode!
(setq ns-use-native-fullscreen nil)

View File

@@ -48,6 +48,35 @@
ido-enable-tramp-completion t
ido-enable-last-directory-history t)
;;; Filters ido-matches setting acronynm matches in front of the results
(defadvice ido-set-matches-1 (after ido-smex-acronym-matches activate)
(if (and (fboundp 'smex-already-running) (smex-already-running)
(> (length ido-text) 1))
(let ((regex (concat "^" (mapconcat 'char-to-string ido-text "[^-]*-")))
(acronym-matches (list))
(remove-regexes '("-menu-")))
;; Creating the list of the results to be set as first
(dolist (item items)
(if (string-match (concat regex "[^-]*$") item) ;; strict match
(add-to-list 'acronym-matches item)
(if (string-match regex item) ;; appending relaxed match
(add-to-list 'acronym-matches item t))))
;; Filtering ad-return-value
(dolist (to_remove remove-regexes)
(setq ad-return-value
(delete-if (lambda (item)
(string-match to_remove item))
ad-return-value)))
;; Creating resulting list
(setq ad-return-value
(append acronym-matches
ad-return-value))
(delete-dups ad-return-value)
(reverse ad-return-value))))
;;#projectile
(projectile-global-mode)
(setq projectile-completion-system 'grizzl

View File

@@ -33,7 +33,7 @@
;; Modeline settings
;; TODO: Customize modeline
;;;; GUI Settings ;;;;;;;;;;;;;;;;;;;;;
@@ -46,9 +46,9 @@
;; Use system clipboard
(setq ring-bell-function 'ignore)
(if (functionp 'tool-bar-mode) (tool-bar-mode -1))
(if (functionp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (functionp 'menu-bar-mode) (menu-bar-mode -1))
(when (functionp 'tool-bar-mode) (tool-bar-mode -1))
(when (functionp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (functionp 'menu-bar-mode) (menu-bar-mode -1))
;;

View File

@@ -1,4 +1,4 @@
(require 'cl)
;; (require 'cl)
;; Emacs under-the-hood
(setq redisplay-dont-pause t)
@@ -140,8 +140,8 @@
`(evil-ex-define-cmd ,ex ,function))
;; This one's unique for my own special mappings
(defmacro map (key command)
`(define-key my-mode-map ,key ,command))
;; (defmacro map (key command)
;; `(define-key my-mode-map ,key ,command))
(defmacro is-osx () '(eq system-type 'darwin))