diff --git a/core/core-auto-insert.el b/core/core-auto-insert.el index adc883fc2..389d29336 100644 --- a/core/core-auto-insert.el +++ b/core/core-auto-insert.el @@ -55,9 +55,9 @@ ("\\.md$" "__" markdown-mode) ;; Org - (,(format "%s.+\\.org$" org-directory-contacts) "__contact.org" org-mode) - (,(format "%s.+\\.org$" org-directory-projects) "__projects.org" org-mode) - (,(format "%s.+\\.org$" org-directory-invoices) "__invoices.org" org-mode) + (,(format "%s.+\\.org$" (f-relative org-directory-contacts org-directory)) "__contact.org" org-mode) + (,(format "%s.+\\.org$" (f-relative org-directory-projects org-directory)) "__projects.org" org-mode) + (,(format "%s.+\\.org$" (f-relative org-directory-invoices org-directory)) "__invoices.org" org-mode) ;; PHP ("\\.class\\.php$" "__.class.php" php-mode) diff --git a/core/core-editor.el b/core/core-editor.el index 1bb2a86c6..98960bec1 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -9,11 +9,11 @@ tab-width 4 require-final-newline t delete-trailing-lines nil - fill-column 80 - word-wrap t + fill-column 90 + line-spacing 0 + word-wrap t truncate-lines t truncate-partial-width-windows 50 - line-spacing 0 ;; Sane scroll settings scroll-margin 0 @@ -66,20 +66,18 @@ enable multiple minor modes for the same regexp.") ;; Modes 'n hooks ;;;;;;;;;;;;;;;;;;; -(associate! sh-mode :match "/\\.?z\\(profile\\|login\\|logout\\|shrc\\|shenv\\)?$") -(associate! sh-mode :match "/\\.?zsh/") +(associate! sh-mode :match "/\\.?z\\(sh/?\\|profile\\|login\\|logout\\|shrc\\|shenv\\)$") (associate! applescript-mode :match "\\.applescript$") -(associate! emacs-lisp-mode :match "Cask$") -(associate! emacs-lisp-mode :match "\\.el\\.gz$") +(associate! emacs-lisp-mode :match "\\(/Cask\\|\\.\\(el\\|gz\\)\\)$") (associate! makefile-gmake-mode :match "/Makefile$") (associate! nxml-mode :match "\\.plist$") (add-hook! help-mode 'visual-line-mode) -(add-hook! python-mode 'electric-indent-local-mode) (add-hook! makefile-mode 'narf|enable-tabs) ; Use normal tabs in makefiles -(add-hook! before-save 'delete-trailing-whitespace) (add-hook! prog-mode 'narf|enable-comment-hard-wrap) (add-hook! special-mode (setq truncate-lines nil)) +(add-hook! before-save 'delete-trailing-whitespace) +(add-hook! python-mode 'electric-indent-local-mode) (add-hook! change-major-mode-hook (when indent-tabs-mode (whitespace-mode +1))) diff --git a/core/core-evil.el b/core/core-evil.el index ff2640ebc..e4d987746 100644 --- a/core/core-evil.el +++ b/core/core-evil.el @@ -51,12 +51,6 @@ (evil-define-key 'normal evil-command-window-mode-map [escape] 'kill-buffer-and-window) - ;; Monkey-patch an error triggered randomly during column-selection; is caused - ;; by `evil-move-to-column' receiving a float. - (defun narf*evil-move-to-column-fix (args) - (mapcar (lambda (i) (if (numberp i) (truncate i) i)) args)) - (advice-add 'evil-move-to-column :filter-args 'narf*evil-move-to-column-fix) - ;; modes to map to different default states (dolist (mode-map '((cider-repl-mode . emacs) (comint-mode . emacs) @@ -92,11 +86,11 @@ (narf-minibuffer-quit))) ;; Monkey-patch an error triggered randomly during column-selection caused - ;; by `extract-rectangle-line' receiving a float: + ;; by `evil-move-to-column' receiving a float: ;; evil-move-to-column: Wrong type argument: wholenump, 12.0 - (defun narf*evil-extract-rectangle-line-fix (args) + (defun narf*evil-move-to-column-fix (args) (mapcar (lambda (i) (if (numberp i) (truncate i) i)) args)) - (advice-add 'extract-rectangle-line :filter-args 'narf*evil-extract-rectangle-line-fix) + (advice-add 'evil-move-to-column :filter-args 'narf*evil-move-to-column-fix) ;; buffer-local ex commands, thanks to: ;; http://emacs.stackexchange.com/questions/13186 diff --git a/core/core-popup.el b/core/core-popup.el index 500d81b2b..627b7f0ff 100644 --- a/core/core-popup.el +++ b/core/core-popup.el @@ -7,19 +7,17 @@ (mapc (lambda (rule) (push rule popwin:special-display-config)) '(("*Help*" :position bottom :height 0.25 :stick t) (debugger-mode :position bottom :height 15) - (org-src-mode :position bottom :height 0.5 :stick t) - (org-agenda-mode :position bottom :height 0.4 :stick t) ("*evil-registers*" :position bottom :height 0.3 :stick t) ("*scratch*" :position bottom :height 20 :stick t) ("*Apropos*" :position bottom :height 40 :stick t) ("*Backtrace*" :position bottom :height 15 :stick t) - ("^\\*CPU-Profiler-Report .+\\*$" :regexp t :position bottom :height 0.35) ("*Flycheck errors*" :position bottom :height 15 :stick t) ("*quickrun*" :position bottom :height 15 :stick t) ("*minor-modes*" :position bottom :height 0.5 :stick t) + ("^\\*CPU-Profiler-Report .+\\*$" :regexp t :position bottom :height 0.35) ;; vcs - ("\\*git-gutter.+\\*" :regexp t :position bottom :height 30 :stick t) + ("\\*git-gutter.+\\*" :regexp t :position bottom :height 30 :stick t) ;; Helm ("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 0.2) @@ -27,9 +25,11 @@ ("*helm-mode-ffap*" :position bottom :height 10) ;; Org + (org-src-mode :position bottom :height 0.5 :stick t) + (org-agenda-mode :position bottom :height 0.4 :stick t) ("^\\*Org-Babel.*\\*$" :regexp t :position bottom :height 15 :tail t) ("*Agenda Commands*" :position bottom :height 0.5) - (" *Org todo*" :position bottom :height 5) + (" *Org todo*" :position bottom :height 5) ("*Org Links*" :position bottom :height 2) ;; REPLs diff --git a/core/core-ui.el b/core/core-ui.el index 25c0c4ecf..68a4c85b9 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -173,7 +173,7 @@ (narf|nlinum-unhl-line)) (add-hook! - (markdown-mode prog-mode scss-mode web-mode) + (markdown-mode prog-mode scss-mode web-mode conf-mode) 'narf|nlinum-enable) :config (defun narf|nlinum-unhl-line () diff --git a/core/core-vcs.el b/core/core-vcs.el index 096dcab1b..23500e699 100644 --- a/core/core-vcs.el +++ b/core/core-vcs.el @@ -2,7 +2,7 @@ (use-package gitconfig-mode :mode ("/\\.?git/?config$" "/\\.gitmodules$") - :init (add-hook 'gitconfig-mode-hook 'flyspell-mode)) + :init (add-hook! gitconfig-mode 'flyspell-mode)) (use-package gitignore-mode :mode ("/\\.gitignore$" diff --git a/core/lib/defuns-helm.el b/core/lib/defuns-helm.el index 724552847..0e5a5116e 100644 --- a/core/lib/defuns-helm.el +++ b/core/lib/defuns-helm.el @@ -69,10 +69,15 @@ (if bang (helm-multi-swoop-all search) (helm-swoop :$query search))) ;;;###autoload -(defun narf/helm-projectile-in-emacsd () +(defun narf/helm-find-in-emacsd () (interactive) (in! narf-emacs-dir (helm-projectile-find-file))) +;;;###autoload +(defun narf/helm-find-in-dotfiles () + (interactive) + (in! (expand-file-name ".dotfiles" "~") (helm-projectile-find-file))) + ;;;###autoload (defun narf/helm-buffers-dwim (&optional all-p) "Displays open buffers in current project. If ALL-P, then show all open diff --git a/modules/module-writing.el b/modules/module-writing.el index 04dbfa6d4..f74b56c6f 100644 --- a/modules/module-writing.el +++ b/modules/module-writing.el @@ -1,7 +1,8 @@ ;;; module-writing.el ;; From -(advice-add 'split-window :around #'visual-fill-column--disable-on-split-window) +(after! visual-fill-column + (advice-add 'split-window :around #'visual-fill-column--disable-on-split-window)) (defun visual-fill-column--disable-on-split-window (fn window &rest args) "Undo the effects of `visual-fill-column-mode' for splitting window." (if (and (or (not window) (window-live-p window)) @@ -61,6 +62,7 @@ (add-hook! latex-mode 'turn-on-auto-fill) (add-hook! LaTeX-mode 'turn-on-auto-fill) +(defvar biblio-directory (concat narf-dropbox-dir "docs/biblio/") "docstring") (use-package reftex :config (add-hook 'latex-mode-hook 'turn-on-reftex) @@ -75,7 +77,6 @@ ;; NOTE: http://bibdesk.sourceforge.net/ -(defvar biblio-directory (concat narf-dropbox-dir "docs/biblio/") "docstring") (use-package helm-bibtex :defer t :config diff --git a/private/my-bindings.el b/private/my-bindings.el index 003e9abe9..8a27b7cd8 100644 --- a/private/my-bindings.el +++ b/private/my-bindings.el @@ -106,7 +106,6 @@ :nv ":" 'helm-imenu-in-all-buffers :nv "]" 'helm-etags-select :nv "a" 'helm-projectile-find-other-file - :nv "E" 'narf/helm-projectile-in-emacsd :nv "m" 'helm-recentf :nv "M" 'helm-projectile-recentf ; recent PROJECT files :nv "P" 'helm-projectile-switch-project @@ -131,6 +130,9 @@ :nv "qq" 'evil-save-and-quit :nv "QQ" 'narf/kill-all-buffers-do-not-remember + :nv "E" 'narf/helm-find-in-emacsd + :nv "\\" 'narf/helm-find-in-dotfiles + ;; Tmux (:prefix "t" :n "." 'narf/tmux-cd-to-here