General cleanup
This commit is contained in:
parent
eb9defe2e7
commit
42e6b0913d
18 changed files with 164 additions and 162 deletions
|
@ -53,9 +53,7 @@
|
|||
;; A simpler prompt: see `helm-global-prompt'
|
||||
(advice-add 'helm :filter-args 'doom*helm-replace-prompt)
|
||||
;; Hide mode-line in helm windows
|
||||
(advice-add 'helm-display-mode-line :override 'doom*helm-hide-header)
|
||||
|
||||
(after! yasnippet (push 'helm-alive-p yas-dont-activate)))
|
||||
(advice-add 'helm-display-mode-line :override 'doom*helm-hide-header))
|
||||
|
||||
(use-package helm-mode
|
||||
:after helm
|
||||
|
@ -123,7 +121,7 @@
|
|||
(setq helm-css-scss-split-direction 'split-window-vertically
|
||||
helm-css-scss-split-with-multiple-windows t))
|
||||
|
||||
(use-package helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
|
||||
(use-package helm-swoop ; https://github.com/ShingoFukuyama/helm-swoop
|
||||
:defines (helm-swoop-last-prefix-number)
|
||||
:commands (helm-swoop helm-multi-swoop helm-multi-swoop-all)
|
||||
:config
|
||||
|
|
|
@ -8,15 +8,13 @@
|
|||
;; Prefixes: Command = M, Alt = A
|
||||
mac-command-modifier 'meta
|
||||
mac-option-modifier 'alt
|
||||
|
||||
;; sane trackpad/mouse scroll settings
|
||||
mac-redisplay-dont-reset-vscroll t
|
||||
mac-mouse-wheel-smooth-scroll nil
|
||||
mouse-wheel-scroll-amount '(5 ((shift) . 2)) ; one line at a time
|
||||
mouse-wheel-progressive-speed nil ; don't accelerate scrolling
|
||||
|
||||
;;; NOTE Meaningless to railwaycat's emacs-mac build
|
||||
;; Curse Lion and its sudden but inevitable fullscreen mode!
|
||||
;; NOTE Meaningless to railwaycat's emacs-mac build
|
||||
ns-use-native-fullscreen nil
|
||||
;; Don't open files from the workspace in a new frame
|
||||
ns-pop-up-frames nil)
|
||||
|
@ -55,6 +53,14 @@
|
|||
(defmacro def-docset! (mode docset)
|
||||
`(add-hook! ,mode (setq-local dash-at-point-docset ,docset))))
|
||||
|
||||
(use-package applescript-mode :mode "\\.applescript$")
|
||||
|
||||
(def-project-type! lb6 "lb6"
|
||||
:match "\\.lb\\(action\\|ext\\)/.+$"
|
||||
:build (lambda ()
|
||||
(awhen (f-traverse-upwards (lambda (f) (f-ext? f "lbaction")))
|
||||
(shell-command (format "open '%s'" it)))))
|
||||
|
||||
(after! evil
|
||||
;; On OSX, stop copying each visual state move to the clipboard:
|
||||
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
|
||||
|
|
54
core/core-vars.el
Normal file
54
core/core-vars.el
Normal file
|
@ -0,0 +1,54 @@
|
|||
;;; core-vars.el
|
||||
|
||||
(defcustom doom-unreal-buffers
|
||||
'("^ ?\\*.+" image-mode dired-mode reb-mode messages-buffer-mode
|
||||
tabulated-list-mode comint-mode magit-mode)
|
||||
"A list of regexps or modes whose buffers are considered unreal, and will be
|
||||
ignored when using `doom:next-real-buffer' and `doom:previous-real-buffer' (or
|
||||
killed by `doom/kill-unreal-buffers', or after `doom/kill-real-buffer')."
|
||||
:group 'doom
|
||||
:type '(repeat (choice (regexp :tag "Buffer name regexps")
|
||||
(symbol :tag "Major mode"))))
|
||||
|
||||
(defcustom doom-ignore-buffers
|
||||
'("*Completions*" "*Compile-Log*" "*inferior-lisp*" "*Fuzzy Completions*"
|
||||
"*Apropos*" "*Help*" "*cvs*" "*Buffer List*" "*Ibuffer*" "*NeoTree*"
|
||||
"*NeoTree*" "*esh command on file*" "*WoMan-Log*" "*compilation*"
|
||||
"*use-package*" "*quickrun*" "*eclim: problems*" "*Flycheck errors*"
|
||||
"*popwin-dummy*"
|
||||
;; Helm
|
||||
"*helm*" "*helm recentf*" "*helm projectile*" "*helm imenu*"
|
||||
"*helm company*" "*helm buffers*" "*Helm Css SCSS*" "*helm-ag*"
|
||||
"*helm-ag-edit*" "*Helm Swoop*" "*helm M-x*" "*helm mini*"
|
||||
"*Helm Completions*" "*Helm Find Files*" "*helm mu*" "*helm mu contacts*"
|
||||
"*helm-mode-describe-variable*" "*helm-mode-describe-function*"
|
||||
;; Org
|
||||
"*Org todo*" "*Org Links*" "*Agenda Commands*")
|
||||
"List of buffer names to ignore when using `winner-undo', or `winner-redo'"
|
||||
:group 'doom
|
||||
:type '(repeat string))
|
||||
|
||||
(defcustom doom-cleanup-processes-alist
|
||||
'(("pry" . ruby-mode)
|
||||
("irb" . ruby-mode)
|
||||
("ipython" . python-mode))
|
||||
"An alist of (process-name . major-mode), that `doom:cleanup-processes' checks
|
||||
before killing processes. If there are no buffers with matching major-modes, it
|
||||
gets killed."
|
||||
:group 'doom
|
||||
:type '(repeat (cons (string :tag "Process name")
|
||||
(symbol :tag "Associated major mode"))))
|
||||
|
||||
(defcustom doom-project-root-files
|
||||
'(".git" ".hg" ".svn" ".project" "local.properties" "project.properties"
|
||||
"rebar.config" "project.clj" "SConstruct" "pom.xml" "build.sbt"
|
||||
"build.gradle" "Gemfile" "requirements.txt" "tox.ini" "package.json"
|
||||
"gulpfile.js" "Gruntfile.js" "bower.json" "composer.json" "Cargo.toml"
|
||||
"mix.exs")
|
||||
"A list of files that count as 'project files', which determine whether a
|
||||
folder is the root of a project or not."
|
||||
:group 'doom
|
||||
:type '(repeat string))
|
||||
|
||||
(provide 'core-vars)
|
||||
;;; core-vars.el ends here
|
|
@ -43,7 +43,9 @@
|
|||
;; Strip out whitespace before a line selection
|
||||
(add-hook 'yas-before-expand-snippet-hook 'doom|yas-before-expand)
|
||||
;; Fix previous hook persisting yas-selected-text between expansions
|
||||
(add-hook 'yas-after-exit-snippet-hook 'doom|yas-after-expand))
|
||||
(add-hook 'yas-after-exit-snippet-hook 'doom|yas-after-expand)
|
||||
;; Suppress yasnippet with helm
|
||||
(after! helm (push 'helm-alive-p yas-dont-activate)))
|
||||
|
||||
(use-package auto-yasnippet
|
||||
:commands (aya-create aya-expand aya-open-line aya-persist-snippet)
|
||||
|
|
78
core/core.el
78
core/core.el
|
@ -14,12 +14,12 @@
|
|||
;;; Autoloaded functions are in {core,modules}/defuns/defuns-*.el
|
||||
|
||||
;; UTF-8 please
|
||||
(set-charset-priority 'unicode)
|
||||
(setq locale-coding-system 'utf-8) ; pretty
|
||||
(set-terminal-coding-system 'utf-8) ; pretty
|
||||
(set-keyboard-coding-system 'utf-8) ; pretty
|
||||
(set-selection-coding-system 'utf-8) ; please
|
||||
(prefer-coding-system 'utf-8) ; with sugar on top
|
||||
(set-charset-priority 'unicode)
|
||||
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
|
||||
|
||||
(setq-default major-mode 'text-mode)
|
||||
|
@ -43,7 +43,6 @@
|
|||
ediff-window-setup-function 'ediff-setup-windows-plain ; no extra frames
|
||||
enable-recursive-minibuffers nil ; no minibufferception
|
||||
idle-update-delay 2 ; update a little less often
|
||||
inhibit-startup-echo-area-message "hlissner" ; username shuts up emacs
|
||||
ring-bell-function 'ignore ; silence of the bells!
|
||||
save-interprogram-paste-before-kill nil
|
||||
sentence-end-double-space nil
|
||||
|
@ -67,63 +66,25 @@
|
|||
undo-tree-history-directory-alist `(("." . ,(concat doom-temp-dir "/undo/"))))
|
||||
|
||||
|
||||
;;
|
||||
;; Variables
|
||||
;;
|
||||
|
||||
(defvar doom-unreal-buffers
|
||||
'("^ ?\\*.+\\*" image-mode dired-mode reb-mode messages-buffer-mode)
|
||||
"A list of regexps or modes whose buffers are considered unreal, and will be
|
||||
ignored when using `doom:next-real-buffer' and `doom:previous-real-buffer' (or
|
||||
killed by `doom/kill-unreal-buffers', or after `doom/kill-real-buffer').")
|
||||
|
||||
(defvar doom-ignore-buffers
|
||||
'("*Completions*" "*Compile-Log*" "*inferior-lisp*" "*Fuzzy Completions*"
|
||||
"*Apropos*" "*Help*" "*cvs*" "*Buffer List*" "*Ibuffer*" "*NeoTree*"
|
||||
"*NeoTree*" "*esh command on file*" "*WoMan-Log*" "*compilation*"
|
||||
"*use-package*" "*quickrun*" "*eclim: problems*" "*Flycheck errors*"
|
||||
"*popwin-dummy*"
|
||||
;; Helm
|
||||
"*helm*" "*helm recentf*" "*helm projectile*" "*helm imenu*"
|
||||
"*helm company*" "*helm buffers*" "*Helm Css SCSS*" "*helm-ag*"
|
||||
"*helm-ag-edit*" "*Helm Swoop*" "*helm M-x*" "*helm mini*"
|
||||
"*Helm Completions*" "*Helm Find Files*" "*helm mu*" "*helm mu contacts*"
|
||||
"*helm-mode-describe-variable*" "*helm-mode-describe-function*"
|
||||
;; Org
|
||||
"*Org todo*" "*Org Links*" "*Agenda Commands*")
|
||||
"List of buffer names to ignore when using `winner-undo', or `winner-redo'")
|
||||
|
||||
(defvar doom-cleanup-processes-alist
|
||||
'(("pry" . ruby-mode)
|
||||
("irb" . ruby-mode)
|
||||
("ipython" . python-mode))
|
||||
"An alist of (process-name . major-mode), that `doom:cleanup-processes' checks
|
||||
before killing processes. If there are no buffers with matching major-modes, it
|
||||
gets killed.")
|
||||
|
||||
(defvar doom-project-root-files
|
||||
'(".git" ".hg" ".svn" ".project" "local.properties" "project.properties"
|
||||
"rebar.config" "project.clj" "SConstruct" "pom.xml" "build.sbt"
|
||||
"build.gradle" "Gemfile" "requirements.txt" "tox.ini" "package.json"
|
||||
"gulpfile.js" "Gruntfile.js" "bower.json" "composer.json" "Cargo.toml"
|
||||
"mix.exs")
|
||||
"A list of files that count as 'project files', which determine whether a
|
||||
folder is the root of a project or not.")
|
||||
|
||||
|
||||
;;
|
||||
;; Libraries
|
||||
;;
|
||||
|
||||
(require 'f)
|
||||
(require 'dash)
|
||||
(require 's)
|
||||
(defgroup doom nil
|
||||
"Emacs for the stubborn martian vimmer."
|
||||
:prefix "doom")
|
||||
|
||||
(require 'core-defuns)
|
||||
(unless (require 'autoloads nil t)
|
||||
(doom-reload-autoloads)
|
||||
(eval-and-compile
|
||||
(require 'f)
|
||||
(require 'dash)
|
||||
(require 's)
|
||||
|
||||
(require 'core-vars)
|
||||
(require 'core-defuns)
|
||||
(unless (require 'autoloads nil t)
|
||||
(error "Autoloads couldn't be loaded or generated!")))
|
||||
(doom-reload-autoloads)
|
||||
(unless (require 'autoloads nil t)
|
||||
(error "Autoloads couldn't be loaded or generated!"))))
|
||||
|
||||
(autoload 'use-package "use-package" "" nil 'macro)
|
||||
|
||||
|
@ -182,17 +143,12 @@ enable multiple minor modes for the same regexp.")
|
|||
|
||||
(add-hook 'find-file-hook 'doom|enable-minor-mode-maybe)
|
||||
|
||||
(add-hook! after-init
|
||||
;;
|
||||
(add-hook! emacs-startup
|
||||
;; We add this to `after-init-hook' to allow errors to stop it
|
||||
(defadvice save-buffers-kill-emacs (around no-query-kill-emacs activate)
|
||||
"Prevent annoying \"Active processes exist\" query when you quit Emacs."
|
||||
(cl-flet ((process-list ())) ad-do-it))
|
||||
|
||||
;; Prevent any auto-displayed text...
|
||||
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
||||
(setq emacs-end-time (float-time (time-subtract (current-time) emacs-start-time)))
|
||||
(doom-mode-init)
|
||||
(message ""))
|
||||
(cl-flet ((process-list ())) ad-do-it)))
|
||||
|
||||
(provide 'core)
|
||||
;;; core.el ends here
|
||||
|
|
|
@ -171,7 +171,7 @@ left, create a scratch buffer."
|
|||
(if (or (= realc 0)
|
||||
(and (= realc 1) (eq (car real-buffers) (current-buffer))))
|
||||
(progn
|
||||
(doom|update-scratch-buffer-cwd)
|
||||
(doom|update-scratch-buffer)
|
||||
(switch-to-buffer doom-buffer-name)
|
||||
(message "Nowhere to go"))
|
||||
(funcall move-func)
|
||||
|
@ -179,7 +179,7 @@ left, create a scratch buffer."
|
|||
(let ((current-buffer (current-buffer)))
|
||||
(cond ((or (eq current-buffer start-buffer)
|
||||
(>= i max))
|
||||
(doom|update-scratch-buffer-cwd)
|
||||
(doom|update-scratch-buffer)
|
||||
(switch-to-buffer doom-buffer-name)
|
||||
(setq continue nil))
|
||||
((not (memq current-buffer real-buffers))
|
||||
|
@ -251,9 +251,9 @@ buffers regardless of project."
|
|||
(interactive "<!><a>")
|
||||
(doom-kill-buffers (doom/get-matching-buffers pattern (doom/get-buffers (not bang)))))
|
||||
|
||||
;;;###autoload (autoload 'doom:send-to-scratch-or-org "defuns-buffers" nil t)
|
||||
(evil-define-operator doom:send-to-scratch-or-org (&optional beg end bang)
|
||||
"Send a selection to the scratch buffer. If BANG, then send it to org-capture instead."
|
||||
;;;###autoload (autoload 'doom:scratch-or-org "defuns-buffers" nil t)
|
||||
(evil-define-operator doom:scratch-or-org (&optional beg end bang)
|
||||
"Send a selection to the scratch buffer. If BANG, use org-capture instead."
|
||||
:move-point nil
|
||||
:type inclusive
|
||||
(interactive "<r><!>")
|
||||
|
@ -267,11 +267,10 @@ buffers regardless of project."
|
|||
(buffer-name doom-buffer-name))
|
||||
(doom/popup-buffer buffer-name)
|
||||
(with-current-buffer buffer-name
|
||||
(when project-dir
|
||||
(cd project-dir))
|
||||
(erase-buffer)
|
||||
(doom|update-scratch-buffer)
|
||||
(if text (insert text))
|
||||
(funcall mode))
|
||||
))))
|
||||
(funcall mode))))))
|
||||
|
||||
;;;###autoload (autoload 'doom:cd "defuns-buffers" nil t)
|
||||
(evil-define-command doom:cd (dir)
|
||||
|
@ -284,7 +283,7 @@ buffers regardless of project."
|
|||
(defun doom/kill-all-buffers-do-not-remember ()
|
||||
"Kill all buffers so that workgroups2 will wipe its current session."
|
||||
(interactive)
|
||||
(let ((confirm-kill-emacs nil))
|
||||
(let (confirm-kill-emacs)
|
||||
(mapc 'kill-buffer (doom/get-buffers))
|
||||
(kill-this-buffer)
|
||||
(delete-other-windows)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;;; defuns-git.el
|
||||
|
||||
;;;### (autoload 'doom:git-remote-browse "defuns-git" nil t)
|
||||
;;;###autoload (autoload 'doom:git-remote-browse "defuns-git" nil t)
|
||||
(evil-define-command doom:git-remote-browse (&optional bang)
|
||||
"Open the website for the current (or specified) version controlled FILE. If BANG,
|
||||
then use hub to do it."
|
||||
"Open the website for the current (or specified) version controlled FILE. If
|
||||
BANG, then use hub to do it."
|
||||
(interactive "<!>")
|
||||
(let (url)
|
||||
(condition-case err
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
(defun doom/wg-projectile-switch-project ()
|
||||
(let ((project-root (doom/project-root)))
|
||||
(doom:workgroup-new nil (file-name-nondirectory (directory-file-name project-root)) t)
|
||||
(doom|update-scratch-buffer-cwd project-root)
|
||||
(doom|update-scratch-buffer project-root)
|
||||
(when (featurep 'neotree)
|
||||
(neotree-projectile-action))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue