Rewrite core initfiles; fix a lot of evil/PATH bugs
This commit is contained in:
parent
8a6f973c3e
commit
02863ee529
8 changed files with 222 additions and 172 deletions
39
init.el
39
init.el
|
@ -4,15 +4,15 @@
|
|||
;; URL: https://github.com/hlissner/emacs.d
|
||||
;;
|
||||
;; These settings set up a very vim-like experience, with some of emacs goodness
|
||||
;; squeezed in between the cracks.
|
||||
;; squeezed into the cracks.
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
(cd "~") ; Default directory, instead of /
|
||||
;; (setq debug-on-error t)
|
||||
|
||||
;; Append homebrew's bin to emac's PATH
|
||||
(setq exec-path (append exec-path '("/usr/local/bin")))
|
||||
(server-mode t)
|
||||
(unless (server-running-p) (server-start))
|
||||
|
||||
;; Global vars
|
||||
(defvar my-dir (file-name-directory load-file-name))
|
||||
|
@ -37,6 +37,7 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(dolist (module '(
|
||||
;; Just the... bear necessities...
|
||||
core ; Emacs core settings
|
||||
core-packages ; Package init & management
|
||||
core-ui ; Look and behavior of the emacs UI
|
||||
|
@ -44,15 +45,16 @@
|
|||
core-osx ; OSX-specific settings & functions
|
||||
core-project ; Project navigation settings & packages
|
||||
|
||||
;; Editor essentials
|
||||
;; Modules to improve on emacs' heresy
|
||||
mod-ac ; Auto-complete engine & settings
|
||||
;; mod-shell ; Terminal emulator settings
|
||||
mod-snippets ; Snippet engine
|
||||
mod-git ; GIT tools/settings
|
||||
mod-fly ; Syntax and spell checkers
|
||||
; mod-webdev ; Webdev tools (sass, js, etc)
|
||||
; mod-gamedev ; Gamedev tools (C++, love2D, html5)
|
||||
; mod-shell ; Goodies for ansi-term
|
||||
|
||||
;; Must be last!
|
||||
;; Must be last
|
||||
core-keymaps ; Global & local keybindings for all modes
|
||||
))
|
||||
(require module))
|
||||
|
@ -60,15 +62,20 @@
|
|||
|
||||
;;;; Modes ;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(associate-mode 'ruby-mode '(".rb" ".rake" "RakeFile"))
|
||||
(associate-mode 'markdown-mode '(".md" ".markdown" "README"))
|
||||
(associate-mode 'scss-mode '(".scss"))
|
||||
(associate-mode 'org-mode '(".org" ".gtd") t)
|
||||
(associate-mode 'js2-mode '(".js" ".json"))
|
||||
(associate-mode 'web-mode '(".html" ".htm" ".phtml" ".tpl" ".tpl.php" ".erb"))
|
||||
(associate-mode 'lua-mode '(".lua"))
|
||||
(associate-mode 'yaml-mode '(".yml"))
|
||||
(associate-mode 'python-mode '(".py"))
|
||||
(associate-mode 'c++-mode '(".h") t)
|
||||
;; Associates a mode with a path regex. If the third parameter is t,
|
||||
;; then don't try to install the mode (use for modes that are included
|
||||
;; with emacs).
|
||||
(associate-mode 'ruby-mode '("\\.rb\\'" "\\.rake\\'" "Rakefile\\'"))
|
||||
(associate-mode 'markdown-mode '("\\.md\\'" "\\.markdown\\'" "/README"))
|
||||
(associate-mode 'scss-mode '("\\.scss\\'"))
|
||||
(associate-mode 'org-mode '("\\.org\\'" "\\.gtd\\'") t)
|
||||
(associate-mode 'js-mode '("\\.js\\'") t)
|
||||
(associate-mode 'json-mode '("\\.json\\'" "\\.jshintrc\\'"))
|
||||
(associate-mode 'web-mode '("\\.\\(p\\)?htm\\(l\\)?\\'" "\\.tpl\\(\\.php\\)?\\'" "\\.erb\\'"))
|
||||
(associate-mode 'lua-mode '("\\.lua\\'"))
|
||||
(associate-mode 'yaml-mode '("\\.yml\\'"))
|
||||
(associate-mode 'python-mode '("\\.py\\'"))
|
||||
(associate-mode 'c++-mode '("\\.h\\'") t)
|
||||
(associate-mode 'shell-script-mode '("\\.zsh\\(rc\\|env\\)?\\'") t)
|
||||
|
||||
;;
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
(require-package 'evil)
|
||||
(evil-mode 1)
|
||||
(evil-mode nil)
|
||||
|
||||
;; Has to be done this way to ensure special buffers have evil,
|
||||
;; evil-leader, and all the various keymaps enabled.
|
||||
(add-hook 'after-init-hook (lambda() (evil-mode 1)))
|
||||
|
||||
;; Now we can carry on with the rest...
|
||||
(require-packages
|
||||
'(evil-leader
|
||||
evil-nerd-commenter ; auto commenting made easy
|
||||
|
@ -12,10 +17,8 @@
|
|||
evil-visualstar ; visual-based * and #
|
||||
evil-ex-registers ; paste from registers in ex commands
|
||||
autopair ; delimiter auto-closing
|
||||
yasnippet ; snippets: expand with tab
|
||||
rainbow-delimiters ; colored matching parenthesis
|
||||
rainbow-mode ; highlight color codes
|
||||
;; highlight-indentation ; visual indentation guides
|
||||
saveplace ; restore cursor position on buffer load
|
||||
volatile-highlights ; temporarily highlight changes on undo/yank
|
||||
anzu ; display current + total matches searching
|
||||
|
@ -23,19 +26,22 @@
|
|||
rotate-text ; like vim-switch
|
||||
recentf ; access to list of recent files
|
||||
key-chord ; for mapping key chords in insert mode
|
||||
multiple-cursors ; cursors, of the numerous variety
|
||||
ediff
|
||||
))
|
||||
|
||||
|
||||
;;;; Editor behavior ;;;;;;;;;;;;;;;;
|
||||
|
||||
(electric-indent-mode +1)
|
||||
(setq initial-scratch-buffer nil) ; empty scratch buffer
|
||||
(kill-buffer "*scratch*")
|
||||
|
||||
(electric-indent-mode +1) ; auto-indent on RET
|
||||
(global-hl-line-mode +1) ; highlight the line
|
||||
(setq blink-matching-paren nil) ; disable blink-matching-paren
|
||||
(setq-default
|
||||
tab-width 4 ; set tab width to 4 for all buffers
|
||||
indent-tabs-mode t ; always replace tabs with spaces
|
||||
tab-always-indent t)
|
||||
tab-always-indent nil)
|
||||
|
||||
;; do not soft-wrap lines
|
||||
(setq-default truncate-lines t)
|
||||
|
@ -43,7 +49,6 @@
|
|||
|
||||
;; Prettify code-related major modes
|
||||
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
|
||||
;; (add-hook 'prog-mode-hook #'highlight-indentation-mode)
|
||||
|
||||
;; Remove trailing whitespace
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace)
|
||||
|
@ -51,16 +56,7 @@
|
|||
|
||||
;;;; Init plugins ;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;#key-chord
|
||||
(key-chord-mode 1)
|
||||
(setq key-chord-two-keys-delay 0.5)
|
||||
|
||||
;;;#smex
|
||||
(smex-initialize)
|
||||
;; Hook up smex to auto-update, rather than update on every run
|
||||
(defun smex-update-after-load (unused)
|
||||
(when (boundp 'smex-cache) (smex-update)))
|
||||
(add-hook 'after-load-functions 'smex-update-after-load)
|
||||
(diminish 'undo-tree-mode)
|
||||
|
||||
;;;#evil
|
||||
(setq evil-want-C-i-jump t)
|
||||
|
@ -73,10 +69,10 @@
|
|||
|
||||
(evil-exchange-install)
|
||||
|
||||
(evil-space-setup "t" ";" ",")
|
||||
(evil-space-setup "f" ";" ",")
|
||||
(evil-space-setup "T" "," ";")
|
||||
(evil-space-setup "F" "," ";")
|
||||
(evil-space-setup "t" ";" ",") ; Repeat t with space
|
||||
(evil-space-setup "f" ";" ",") ; Repeat f with space
|
||||
(evil-space-setup "T" "," ";") ; Repeat T with space
|
||||
(evil-space-setup "F" "," ";") ; Repeat F with space
|
||||
(evil-define-operator evil-destroy (beg end type register yank-handler)
|
||||
(evil-delete beg end type ?_ yank-handler))
|
||||
|
||||
|
@ -86,15 +82,23 @@
|
|||
;;;#autopair
|
||||
(autopair-global-mode)
|
||||
(setq autopair-blink nil)
|
||||
(setq blink-matching-paren nil) ; disable blink-matching-paren
|
||||
(diminish 'autopair-mode)
|
||||
|
||||
;;;#anzu
|
||||
(global-anzu-mode)
|
||||
(diminish 'anzu-mode)
|
||||
|
||||
;;;#ediff
|
||||
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
|
||||
|
||||
;;;#key-chord
|
||||
(key-chord-mode 1)
|
||||
(setq key-chord-two-keys-delay 0.5)
|
||||
|
||||
;;;#volatile-highlights
|
||||
(volatile-highlights-mode t)
|
||||
(diminish 'volatile-highlights-mode)
|
||||
|
||||
;;;#saveplace
|
||||
(setq-default save-place t)
|
||||
|
@ -110,12 +114,19 @@
|
|||
savehist-file (expand-file-name "savehist" my-tmp-dir))
|
||||
(savehist-mode 1)
|
||||
|
||||
;;;#smex
|
||||
(smex-initialize)
|
||||
;; Hook up smex to auto-update, rather than update on every run
|
||||
(defun smex-update-after-load (unused)
|
||||
(when (boundp 'smex-cache) (smex-update)))
|
||||
(add-hook 'after-load-functions 'smex-update-after-load)
|
||||
|
||||
;;;#recentf
|
||||
(recentf-mode 1)
|
||||
(setq recentf-max-menu-items 25)
|
||||
|
||||
;;;#yasnippet
|
||||
(yas-global-mode t)
|
||||
(add-to-list 'recentf-exclude "\\.ido\\.last\\'")
|
||||
(add-to-list 'recentf-exclude "\\.revive\\'")
|
||||
(setq recentf-auto-cleanup 'never)
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -3,61 +3,88 @@
|
|||
(gmap (kbd "<C-escape>") 'open-scratch-buffer)
|
||||
(gmap (kbd "M-x") 'smex)
|
||||
(gmap (kbd "M-X") 'smex-major-mode-commands)
|
||||
(gmap (kbd "C-x C-p") 'package-list-packages)
|
||||
|
||||
(if (is-osx) (progn
|
||||
(gmap (kbd "s-+") 'text-scale-increase)
|
||||
(gmap (kbd "s--") 'text-scale-decrease)
|
||||
(gmap (kbd "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)
|
||||
|
||||
;; Evaluating elisp
|
||||
(nmap (kbd "C-c x") 'eval-buffer)
|
||||
(vmap (kbd "C-c x") 'eval-region)
|
||||
))
|
||||
|
||||
(map (kbd "C-c t") (lambda() (interactive) (eshell t))) ; open in terminal
|
||||
(map (kbd "C-c g") 'magit-status)
|
||||
(when window-system
|
||||
(gmap (kbd "s-+") 'text-scale-increase)
|
||||
(gmap (kbd "s--") 'text-scale-decrease)
|
||||
|
||||
(map (kbd "s-o") 'ido-find-file)
|
||||
(map (kbd "s-p") 'projectile-switch-project)
|
||||
(map (kbd "s-f") 'projectile-find-file)
|
||||
(map (kbd "s-F") 'projectile-ag)
|
||||
(map (kbd "s-R") 'projectile-recentf)
|
||||
(gmap (kbd "s-/") 'evilnc-comment-or-uncomment-lines)
|
||||
(gmap (kbd "s-w") 'kill-buffer-and-window)
|
||||
|
||||
;; Faster scrolling
|
||||
(nmap (kbd "s-j") "5j")
|
||||
(nmap (kbd "s-k") "5k")
|
||||
|
||||
;; Newlines from insert mode
|
||||
(imap (kbd "<s-return>") 'evil-open-below)
|
||||
(imap (kbd "<S-s-return>") 'evil-open-above)
|
||||
|
||||
;; Fix OSX text navigation shortcuts
|
||||
(imap (kbd "<s-left>") 'move-beginning-of-line)
|
||||
(imap (kbd "<s-right>") 'move-end-of-line)
|
||||
(imap (kbd "<s-backspace>") 'backward-kill-line)
|
||||
|
||||
;; Fixes delete
|
||||
(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)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; Local keymaps ;;;;;;;;;;;;;;;;
|
||||
|
||||
(evil-leader/set-leader ",")
|
||||
(evil-leader/set-key
|
||||
"`" 'open-major-mode-conf
|
||||
"d" 'mc/mark-next-like-this
|
||||
"D" 'mc/mark-all-like-this
|
||||
"e" 'ido-find-file
|
||||
"E" 'my-init
|
||||
"p" 'projectile-switch-project
|
||||
"f" 'projectile-find-file
|
||||
"F" 'projectile-ag
|
||||
"r" 'projectile-recentf
|
||||
"M" 'open-major-mode-conf
|
||||
"g" 'magit-status
|
||||
"/" 'imenu
|
||||
"r" 'helm-recentf ; recent GLOBAL files
|
||||
"R" 'projectile-recentf ; recent PROJECT files
|
||||
"p" 'projectile-switch-project
|
||||
"/" 'evilnc-comment-or-uncomment-lines
|
||||
"\\" 'toggle-sidebar
|
||||
";" 'helm-imenu
|
||||
"," 'ido-switch-buffer
|
||||
"=" 'align-regexp
|
||||
"X" 'kill-other-buffers
|
||||
)
|
||||
|
||||
(nmap
|
||||
";" 'evil-ex
|
||||
";" 'evil-ex ; Remap ; to : - SPC and shift-SPC replace ; and ,
|
||||
|
||||
; Moving rows rather than lines (in case of wrapping)
|
||||
;; Moving rows rather than lines (in case of wrapping)
|
||||
"j" 'evil-next-visual-line'
|
||||
"k" 'evil-previous-visual-line
|
||||
|
||||
"X" 'evil-destroy ; Delete without yanking
|
||||
|
||||
; copy to end of line
|
||||
;; copy to end of line
|
||||
"Y" (lambda()
|
||||
(interactive)
|
||||
(evil-yank (point) (point-at-eol)))
|
||||
|
@ -66,19 +93,13 @@
|
|||
"]b" 'previous-buffer
|
||||
"[b" 'next-buffer
|
||||
|
||||
; winner-mode: window layout undo/redo (see init-core.el)
|
||||
;; winner-mode: window layout undo/redo (see init-core.el)
|
||||
(kbd "C-w u") 'winner-undo
|
||||
(kbd "C-w C-r") 'winner-redo
|
||||
|
||||
; Increment/decrement number under cursor
|
||||
;; Increment/decrement number under cursor
|
||||
(kbd "<C-tab>") 'evil-numbers/inc-at-pt
|
||||
(kbd "<S-C-tab>") 'evil-numbers/dec-at-pt
|
||||
|
||||
; Map split navigation with arrow keys
|
||||
(kbd "<up>") 'windmove-up
|
||||
(kbd "<down>") 'windmove-down
|
||||
(kbd "<left>") 'windmove-left
|
||||
(kbd "<right>") 'windmove-right
|
||||
)
|
||||
|
||||
(vmap
|
||||
|
@ -180,6 +201,8 @@
|
|||
|
||||
;;;; Keymap fixes ;;;;;;;;;;;;;;;
|
||||
|
||||
(imap (kbd "s-j") '(lambda() (interactive) (evil-join-line) (evil-indent-line)))
|
||||
|
||||
;; Make ESC quit all the things
|
||||
(nmap [escape] 'keyboard-quit)
|
||||
(vmap [escape] 'keyboard-quit)
|
||||
|
@ -223,6 +246,8 @@
|
|||
(emap (kbd "C-w l") 'evil-window-right)
|
||||
(emap (kbd "C-w j") 'evil-window-down)
|
||||
(emap (kbd "C-w k") 'evil-window-up)
|
||||
(emap (kbd "s-j") "5j")
|
||||
(emap (kbd "s-k") "5k")
|
||||
|
||||
;;
|
||||
(provide 'core-keymaps)
|
||||
|
|
|
@ -1,18 +1,27 @@
|
|||
;; OSX-specific functionality
|
||||
(if (is-osx) (progn
|
||||
(when (is-osx)
|
||||
|
||||
;; GNU Emacs won't respect the login shell's PATH on mac, it seems,
|
||||
;; this is necessary to fix the problem! (Thanks to lunaryorn @
|
||||
;; <https://github.com/flycheck/flycheck/issues/438#issuecomment-49543748>)
|
||||
(require-package 'exec-path-from-shell)
|
||||
(exec-path-from-shell-initialize)
|
||||
|
||||
;; Ignore .DS_Store files with ido mode
|
||||
(add-to-list 'ido-ignore-files ".DS_Store")
|
||||
|
||||
(if window-system (progn
|
||||
(setq ns-use-native-fullscreen nil)
|
||||
(global-set-key (kbd "s-<f12>") 'toggle-frame-fullscreen)
|
||||
;; Use a shared clipboard
|
||||
(add-hook 'before-make-frame-hook
|
||||
(lambda() (setq x-select-enable-clipboard t)))
|
||||
|
||||
(x-focus-frame nil)
|
||||
(when window-system
|
||||
;; Curse you Lion-esque fullscreen mode!
|
||||
(setq ns-use-native-fullscreen nil)
|
||||
(gmap (kbd "s-<f12>") 'toggle-frame-fullscreen)
|
||||
|
||||
;; Don't open files from the workspace in a new frame
|
||||
(setq ns-pop-up-frames nil)
|
||||
))
|
||||
)
|
||||
|
||||
;; Send current file to OSX apps
|
||||
(defun open-file-with (path &optional appName)
|
||||
|
@ -24,34 +33,11 @@
|
|||
(interactive)
|
||||
(open-file-with (buffer-file-name) appName))
|
||||
|
||||
(defun send-to-transmit () (open-with "Transmit"))
|
||||
(defun send-to-launchbar () (open-with "LaunchBar"))
|
||||
(defun send-dir-to-launchbar () (open-file-with default-directory "LaunchBar"))
|
||||
(defun send-dir-to-finder () (open-file-with default-directory "Finder"))
|
||||
;; (defun open-in-terminal () (ansi-term "/bin/zsh"))
|
||||
|
||||
(after 'evil
|
||||
(gmap (kbd "s-/") 'evilnc-comment-or-uncomment-lines)
|
||||
(gmap (kbd "s-w") 'kill-buffer)
|
||||
(gmap (kbd "s-w") 'kill-buffer-and-window)
|
||||
|
||||
;; Fast scrolling
|
||||
(nmap (kbd "s-j") "5j")
|
||||
(nmap (kbd "s-k") "5k")
|
||||
|
||||
;; Newlines from insert mode
|
||||
;; (imap (kbd "<s-return>") 'evil-open-below)
|
||||
(imap (kbd "<S-s-return>") 'evil-open-above)
|
||||
|
||||
;; Fix OSX text navigation shortcuts
|
||||
(imap (kbd "<s-left>") 'move-beginning-of-line)
|
||||
(imap (kbd "<s-right>") 'move-end-of-line)
|
||||
(imap (kbd "<s-backspace>") 'backward-kill-line)
|
||||
|
||||
;; Fixes delete
|
||||
(imap (kbd "<kp-delete>") 'delete-char)
|
||||
)
|
||||
))
|
||||
(defun send-to-transmit () (interactive) (open-with "Transmit"))
|
||||
(defun send-to-launchbar () (interactive) (open-with "LaunchBar"))
|
||||
(defun send-dir-to-launchbar () (interactive) (open-file-with default-directory "LaunchBar"))
|
||||
(defun send-dir-to-finder () (interactive) (open-file-with default-directory "Finder"))
|
||||
)
|
||||
|
||||
;;
|
||||
(provide 'core-osx)
|
||||
|
|
|
@ -47,14 +47,18 @@
|
|||
(env_mode_name (concat "env-" mode_name))
|
||||
(mode_path (expand-file-name (concat env_mode_name ".el") my-modules-dir)))
|
||||
|
||||
(unless only-load-env (require-package mode))
|
||||
(unless only-load-env (autoload mode mode_name))
|
||||
(if (file-exists-p mode_path)
|
||||
(require-package (intern env_mode_name))))
|
||||
(eval-after-load mode
|
||||
`(require (intern ,env_mode_name)))
|
||||
;; (autoload mode env_mode_name)
|
||||
;; (require-package (intern env_mode_name))
|
||||
))
|
||||
|
||||
(if (typep ext 'list)
|
||||
(dolist (e ext)
|
||||
(add-to-list 'auto-mode-alist `(,(format "\\%s\\'" e) . ,mode)))
|
||||
(add-to-list 'auto-mode-alist `(,(format "\\%s\\'" ext) . ,mode))))
|
||||
(add-to-list 'auto-mode-alist `(,e . ,mode)))
|
||||
(add-to-list 'auto-mode-alist `(,ext . ,mode))))
|
||||
|
||||
;;
|
||||
(provide 'core-packages)
|
||||
|
|
|
@ -7,8 +7,11 @@
|
|||
flx-ido ; enhances ido's flex matching
|
||||
ido-vertical-mode ; vertical listing for ido completion
|
||||
project-explorer ; sidebar for navigation project files
|
||||
dired+
|
||||
))
|
||||
|
||||
(diminish 'projectile-mode)
|
||||
|
||||
;;#dired
|
||||
(setq dired-recursive-deletes 'always
|
||||
dired-recursive-copies 'always
|
||||
|
@ -35,6 +38,7 @@
|
|||
(ido-vertical-mode 1)
|
||||
(ido-everywhere 1)
|
||||
(flx-ido-mode 1)
|
||||
(add-to-list 'ido-ignore-files "\\`.DS_Store\\'")
|
||||
(setq ido-use-faces nil
|
||||
ido-confirm-unique-completion t
|
||||
ido-case-fold t
|
||||
|
@ -49,9 +53,6 @@
|
|||
(setq projectile-completion-system 'grizzl
|
||||
projectile-enable-caching t)
|
||||
|
||||
(add-to-list 'ido-ignore-buffers "\\`\\*[^s].*\\*")
|
||||
(add-to-list 'ido-ignore-files "\\`.DS_Store\\'")
|
||||
|
||||
;;#project-explorer
|
||||
(setq pe/width 24)
|
||||
(evil-set-initial-state 'project-explorer-mode 'emacs)
|
||||
|
|
|
@ -7,19 +7,6 @@
|
|||
(fset 'yes-or-no-p 'y-or-n-p) ; y/n instead of yes/no
|
||||
(global-linum-mode t) ; line numbers for everybody!
|
||||
|
||||
;; Shrink mode-line
|
||||
(add-hook 'emacs-startup-hook
|
||||
(lambda()
|
||||
(diminish 'autopair-mode)
|
||||
(diminish 'anzu-mode)
|
||||
(diminish 'volatile-highlights-mode)
|
||||
(diminish 'undo-tree-mode)
|
||||
(diminish 'auto-complete-mode)
|
||||
(diminish 'flyspell-mode " ?")
|
||||
(diminish 'projectile-mode)
|
||||
(diminish 'yas-minor-mode)
|
||||
))
|
||||
|
||||
;; Sane scroll settings
|
||||
(setq scroll-margin 3
|
||||
scroll-conservatively 100000
|
||||
|
@ -44,6 +31,11 @@
|
|||
(setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
|
||||
|
||||
|
||||
;; Modeline settings
|
||||
|
||||
|
||||
|
||||
|
||||
;;;; GUI Settings ;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(add-to-list 'default-frame-alist `(font . ,my-font))
|
||||
|
@ -51,15 +43,13 @@
|
|||
(add-to-list 'default-frame-alist '(height . 75))
|
||||
(add-to-list 'default-frame-alist '(alpha 98 95)) ; *slightly* transparent window
|
||||
|
||||
(if window-system (progn
|
||||
(tool-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
;; 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))
|
||||
|
||||
; Use system clipboard
|
||||
(setq x-select-enable-clipboard t)
|
||||
; (setq-default line-spacing 1)
|
||||
(setq ring-bell-function 'ignore)
|
||||
) (menu-bar-mode -1))
|
||||
|
||||
;;
|
||||
(provide 'core-ui)
|
||||
|
|
32
init/core.el
32
init/core.el
|
@ -15,9 +15,35 @@
|
|||
;; Always revert buffers if the files were changed
|
||||
(global-auto-revert-mode 1)
|
||||
|
||||
; window layout undo/redo, keymaps in init-evil.el
|
||||
;; window layout undo/redo, keymaps in init-evil.el
|
||||
(when (fboundp 'winner-mode) (winner-mode 1))
|
||||
|
||||
(defun kill-other-buffers ()
|
||||
(interactive)
|
||||
(mapc 'kill-buffer (cdr (buffer-list (current-buffer)))))
|
||||
|
||||
(defun kill-all-buffers ()
|
||||
(interactive)
|
||||
(mapc 'kill-buffer (buffer-list)))
|
||||
|
||||
;;;; Advice ;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; I do it this way because hooking mc/keyboard-quit to insert mode's exit
|
||||
;; hook breaks multiple-cursors!
|
||||
(defadvice keyboard-quit (around mc-and-keyboard-quit activate)
|
||||
(mc/keyboard-quit)
|
||||
ad-do-it)
|
||||
|
||||
;; Make next/previous-buffer skip special buffers
|
||||
(defadvice next-buffer (after avoid-messages-buffer-in-next-buffer)
|
||||
"Advice around `next-buffer' to avoid going into the *Messages* buffer."
|
||||
(when (string= "*Messages*" (buffer-name))
|
||||
(next-buffer)))
|
||||
(defadvice previous-buffer (after avoid-messages-buffer-in-previous-buffer)
|
||||
"Advice around `previous-buffer' to avoid going into the *Messages* buffer."
|
||||
(when (string= "*Messages*" (buffer-name))
|
||||
(previous-buffer)))
|
||||
|
||||
;; Prevent prompts when trying to close window. If I'm closing the window,
|
||||
;; I likely want it to close!
|
||||
(defadvice save-buffers-kill-emacs (around no-y-or-n activate)
|
||||
|
@ -26,6 +52,7 @@
|
|||
ad-do-it))
|
||||
|
||||
|
||||
|
||||
;;;; My personal minor mode ;;;;;;;;
|
||||
|
||||
(defvar my-mode-map (make-sparse-keymap))
|
||||
|
@ -58,8 +85,7 @@
|
|||
(switch-to-buffer (get-buffer-create "*scratch*"))
|
||||
(text-mode))
|
||||
|
||||
|
||||
;; Open the modules/env-{major-mode-name}.el file
|
||||
;; Open the modules/env-{major-mode-name}.el file, if it exists
|
||||
(defun open-major-mode-conf ()
|
||||
(interactive)
|
||||
(let ((path (major-mode-module-path)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue