This commit is contained in:
Henrik Lissner 2015-11-21 16:22:40 -05:00
parent d44d1ab0d0
commit 8537361e50
14 changed files with 58 additions and 58 deletions

View file

@ -201,14 +201,14 @@ enable multiple minor modes for the same regexp.")
t))
(sp-local-pair 'web-mode "<" nil :when '(sp-web-mode-is-code-context))))
(use-package smex
:commands (smex smex-major-mode-commands smex-initialize smex-update)
:init (setq smex-save-file (concat narf-temp-dir "smex-items"))
:config (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))
;; (use-package smex
;; :commands (smex smex-major-mode-commands smex-initialize smex-update)
;; :init (setq smex-save-file (concat narf-temp-dir "smex-items"))
;; :config (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))
(use-package help-fns+ ; Improved help commands
:commands (describe-buffer describe-command describe-file

View file

@ -198,6 +198,7 @@
:functions (iedit-current-occurrence-string iedit-restrict-region)
:commands (evil-iedit-state evil-iedit-state/iedit-mode)
:config
(define-key evil-iedit-state-map (kbd "<escape>") 'evil-iedit-state/quit-iedit-mode)
(define-key evil-visual-state-map (kbd "SPC") 'narf:iedit-restrict-to-region)
(let ((map evil-iedit-state-map))
;; Don't interfere with evil-snipe

View file

@ -10,16 +10,15 @@
flycheck-check-syntax-automatically '(save mode-enabled)
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
:config
(bind! :map flycheck-error-list-mode-map
(evil-initial-state 'flycheck-error-list-mode 'emacs)
(bind! (:map flycheck-error-list-mode-map
:n [escape] 'kill-this-buffer
:n "q" 'kill-this-buffer
:n "C-n" 'flycheck-error-list-next-error
:n "C-p" 'flycheck-error-list-previous-error
:n "j" 'flycheck-error-list-next-error
:n "k" 'flycheck-error-list-previous-error
:n "RET" 'flycheck-error-list-goto-error)
(evil-initial-state 'flycheck-error-list-mode 'emacs)
:n "RET" 'flycheck-error-list-goto-error))
;; Check buffer when normal mode is entered
(add-hook! evil-normal-state-entry 'narf*flycheck-buffer)

View file

@ -45,10 +45,11 @@
(bind! (:map (helm-map helm-generic-files-map helm-find-files-map helm-swoop-map helm-projectile-find-file-map)
"C-w" 'backward-kill-word
"C-r" 'evil-ex-paste-from-register ; Evil registers in helm! Glorious!
"<escape>" 'helm-keyboard-quit
[escape] 'helm-keyboard-quit)
(:map helm-find-files-map
"C-w" 'helm-find-files-up-one-level
"TAB" 'helm-execute-persistent-action
;; "TAB" 'helm-execute-persistent-action
"/" 'helm-execute-persistent-action)
(:map helm-ag-map
"<backtab>" 'helm-ag-edit)
@ -56,11 +57,13 @@
"<escape>" 'helm-ag--edit-abort
:n "zx" 'helm-ag--edit-abort)
(:map helm-map
"C-S-n" 'helm-next-source
"C-S-p" 'helm-previous-source
"C-u" 'helm-delete-minibuffer-contents))
;;; Helm hacks
(defun narf*helm-toggle-header-line ()
(if (= (length helm-sources) 1)
(defun narf*helm-hide-source-header-maybe ()
(if (<= (length helm-sources) 1)
(set-face-attribute 'helm-source-header nil :height 0.1)
(set-face-attribute 'helm-source-header nil :height 1.0)))
@ -74,7 +77,8 @@
(setcar (nthcdr 2 plist) helm-global-prompt))
plist)
(add-hook 'helm-before-initialize-hook 'narf*helm-toggle-header-line)
;; Shrink source headers if there is only one source
(add-hook 'helm-before-initialize-hook 'narf*helm-hide-source-header-maybe)
;; A simpler prompt: see `helm-global-prompt'
(advice-add 'helm :filter-args 'narf*helm-replace-prompt)
;; Hide mode-line in helm windows
@ -102,8 +106,6 @@
(projectile-global-mode +1)
;; (advice-add 'projectile-prepend-project-name :override 'narf*projectile-replace-prompt)
(require 'helm-projectile))
(use-package helm-ag

View file

@ -14,7 +14,7 @@
mouse-wheel-scroll-amount '(6 ((shift) . 2)) ;; one line at a time
mouse-wheel-progressive-speed nil ;; don't accelerate scrolling
;;; NOTE These mean nothing to railwaycat's emacs-mac build on OSX
;;; NOTE Meaningless to railwaycat's emacs-mac build
;; Curse Lion and its sudden but inevitable fullscreen mode!
ns-use-native-fullscreen nil
;; Don't open files from the workspace in a new frame
@ -73,11 +73,9 @@
(defun narf-switch-to-iterm-and-cd ()
(interactive)
(narf:tmux-chdir nil t)
(narf:send-to-tmux (format "cd %s" (shell-quote-argument default-directory)))
(narf-switch-to-iterm))
;;;
(defun narf-org-init-for-osx ()
;; Reveal files in finder
(defvar org-file-apps '(("\\.org$" . emacs)

View file

@ -16,7 +16,7 @@
("*Backtrace*" :position bottom :height 15 :stick t)
("*Flycheck errors*" :position bottom :height 15 :stick t)
("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 0.2)
("^\\*Org-Babel.*\\*$" :regexp t :position bottom :height 15)
("^\\*Org-Babel.*\\*$" :regexp t :position bottom :height 15 :tail t)
;; ("^\\*Org .*\\*$" :regexp t :position bottom :height 15 :stick t)
("*Agenda Commands*" :position bottom :height 0.5)
("*Org todo*" :position bottom :height 5)
@ -47,7 +47,7 @@
(with-current-buffer buf
(evil-resize-window 5)
(funcall cb)
(yascroll-bar-mode +1)
;; (yascroll-bar-mode +1)
(setq mode-line-format nil)))
(defun narf/quickrun-after-run ()

View file

@ -119,7 +119,7 @@
persistent-soft-flush
persistent-soft-location-readable
persistent-soft-location-destroy)
:config (setq pcache-directory (concat narf-temp-dir "pcache/")))
:init (defvar pcache-directory (concat narf-temp-dir "pcache/")))
(use-package async
:commands (async-start
@ -147,9 +147,11 @@
'wg-current-workgroup-p
'wg-previous-workgroup-p)))
(wg-workgroup-list)) "")))
(message ">>> Loaded in %s. %s" (emacs-init-time) wg-list))))
(message "> Loaded in %s. %s" (emacs-init-time) wg-list))))
(add-hook 'after-init-hook 'server-start t))
(require 'server)
(unless (server-running-p)
(server-start)))
(provide 'core)
;;; core.el ends here

View file

@ -1,9 +1,15 @@
;;; defuns-flycheck.el
;; for ../core-flycheck.el
;;;###autoload
(defun narf|flycheck-enable-maybe ()
(unless (or (bound-and-true-p org-src-mode)
(eq major-mode 'org-mode))
(flycheck-mode +1)))
;;;###autoload
(defun narf*flycheck-buffer ()
(when (and (featurep 'flycheck) flycheck-mode)
(when (bound-and-true-p flycheck-mode)
(flycheck-buffer)))
;;;###autoload

View file

@ -6,17 +6,6 @@
(when (narf/project-p)
(projectile-invalidate-cache nil)))
;;;###autoload
(defun narf*projectile-replace-prompt (&optional string)
"Don't show the project name in the prompts; I already know."
helm-global-prompt)
;;;###autoload
(defun narf*helm-hide-modeline (source &optional force)
"No persistent header."
(setq mode-line-format nil)
(setq header-line-format nil))
;;;###autoload
(defun narf/helm-get-org-candidates-in-file (filename min-depth max-depth &optional fontify nofname)
(with-current-buffer (pcase filename
@ -70,8 +59,7 @@
(helm :sources (if search helm-ag-source '(helm-source-do-ag))
:buffer "*helm-ag*"
:keymap helm-ag-map
:input input
:prompt helm-global-prompt)))
:input input)))
;;;###autoload (autoload 'narf:helm-regex-search "defuns-helm" nil t)
(evil-define-operator narf:helm-regex-search (beg end &optional search bang)

View file

@ -108,5 +108,15 @@
(wg-switch-to-workgroup-at-index index)
(narf:workgroup-display))))
;;;###autoload
(defun narf/undo-window-change ()
(interactive)
(call-interactively (if (wg-current-workgroup t) 'wg-undo-wconfig-change 'winner-undo)))
;;;###autoload
(defun narf/redo-window-change ()
(interactive)
(call-interactively (if (wg-current-workgroup t) 'wg-redo-wconfig-change 'winner-redo)))
(provide 'defuns-workgroup)
;;; defuns-workgroup.el ends here

View file

@ -1,14 +1,5 @@
;;; defuns-ruby.el
;;;###autoload
(defun narf|enable-robe-maybe ()
(let ((file (buffer-file-name)))
;; Don't run in gemfiles, capfiles or vagrantfiles
(unless (or (member (f-filename file) '("Gemfile" "Capfile" "Vagrantfile"))
(f-ext? file "org")) ;; or org-mode
(robe-mode 1)
(narf|ruby-load-file file))))
;;;###autoload
(defun narf|ruby-load-file (&optional file)
(let ((file (or file buffer-file-name)))

View file

@ -28,6 +28,7 @@
"in!"
"define-company-backend!"
"define-text-object!"
"define-builder!"
)))
(font-lock-add-keywords 'emacs-lisp-mode
`((,(concat "(\\s-*" (regexp-opt keywords 'paren) "\\_>")

View file

@ -4,11 +4,13 @@
:mode "\\.go$"
:interpreter "go"
:init
(add-hook! go-mode '(emr-initialize flycheck-mode narf|enable-tabs narf|enable-tab-width-4))
(add-hook! go-mode '(emr-initialize
narf|flycheck-enable-maybe
narf|enable-tabs
narf|enable-tab-width-4))
:config
(define-builder! go-mode "go build")
;; emr support
(after! emr
(mapc (lambda (x)
(let ((command-name (car x))

View file

@ -5,7 +5,7 @@
:interpreter ("python" . python-mode)
:commands python-mode
:init
(add-hook! python-mode '(narf|enable-tab-width-4 emr-initialize flycheck-mode))
(add-hook! python-mode '(narf|enable-tab-width-4 emr-initialize narf|flycheck-enable-maybe))
(setq-default
python-indent-offset 4
python-environment-directory narf-temp-dir