Clean up
This commit is contained in:
parent
d44d1ab0d0
commit
8537361e50
14 changed files with 58 additions and 58 deletions
|
@ -201,14 +201,14 @@ enable multiple minor modes for the same regexp.")
|
||||||
t))
|
t))
|
||||||
(sp-local-pair 'web-mode "<" nil :when '(sp-web-mode-is-code-context))))
|
(sp-local-pair 'web-mode "<" nil :when '(sp-web-mode-is-code-context))))
|
||||||
|
|
||||||
(use-package smex
|
;; (use-package smex
|
||||||
:commands (smex smex-major-mode-commands smex-initialize smex-update)
|
;; :commands (smex smex-major-mode-commands smex-initialize smex-update)
|
||||||
:init (setq smex-save-file (concat narf-temp-dir "smex-items"))
|
;; :init (setq smex-save-file (concat narf-temp-dir "smex-items"))
|
||||||
:config (smex-initialize)
|
;; :config (smex-initialize)
|
||||||
;; Hook up smex to auto-update, rather than update on every run
|
;; ;; Hook up smex to auto-update, rather than update on every run
|
||||||
(defun smex-update-after-load (unused)
|
;; (defun smex-update-after-load (unused)
|
||||||
(when (boundp 'smex-cache) (smex-update)))
|
;; (when (boundp 'smex-cache) (smex-update)))
|
||||||
(add-hook 'after-load-functions 'smex-update-after-load))
|
;; (add-hook 'after-load-functions 'smex-update-after-load))
|
||||||
|
|
||||||
(use-package help-fns+ ; Improved help commands
|
(use-package help-fns+ ; Improved help commands
|
||||||
:commands (describe-buffer describe-command describe-file
|
:commands (describe-buffer describe-command describe-file
|
||||||
|
|
|
@ -198,6 +198,7 @@
|
||||||
:functions (iedit-current-occurrence-string iedit-restrict-region)
|
:functions (iedit-current-occurrence-string iedit-restrict-region)
|
||||||
:commands (evil-iedit-state evil-iedit-state/iedit-mode)
|
:commands (evil-iedit-state evil-iedit-state/iedit-mode)
|
||||||
:config
|
: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)
|
(define-key evil-visual-state-map (kbd "SPC") 'narf:iedit-restrict-to-region)
|
||||||
(let ((map evil-iedit-state-map))
|
(let ((map evil-iedit-state-map))
|
||||||
;; Don't interfere with evil-snipe
|
;; Don't interfere with evil-snipe
|
||||||
|
|
|
@ -10,16 +10,15 @@
|
||||||
flycheck-check-syntax-automatically '(save mode-enabled)
|
flycheck-check-syntax-automatically '(save mode-enabled)
|
||||||
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
|
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
|
||||||
:config
|
: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 [escape] 'kill-this-buffer
|
||||||
:n "q" 'kill-this-buffer
|
:n "q" 'kill-this-buffer
|
||||||
:n "C-n" 'flycheck-error-list-next-error
|
:n "C-n" 'flycheck-error-list-next-error
|
||||||
:n "C-p" 'flycheck-error-list-previous-error
|
:n "C-p" 'flycheck-error-list-previous-error
|
||||||
:n "j" 'flycheck-error-list-next-error
|
:n "j" 'flycheck-error-list-next-error
|
||||||
:n "k" 'flycheck-error-list-previous-error
|
:n "k" 'flycheck-error-list-previous-error
|
||||||
:n "RET" 'flycheck-error-list-goto-error)
|
:n "RET" 'flycheck-error-list-goto-error))
|
||||||
|
|
||||||
(evil-initial-state 'flycheck-error-list-mode 'emacs)
|
|
||||||
|
|
||||||
;; Check buffer when normal mode is entered
|
;; Check buffer when normal mode is entered
|
||||||
(add-hook! evil-normal-state-entry 'narf*flycheck-buffer)
|
(add-hook! evil-normal-state-entry 'narf*flycheck-buffer)
|
||||||
|
|
|
@ -45,10 +45,11 @@
|
||||||
(bind! (:map (helm-map helm-generic-files-map helm-find-files-map helm-swoop-map helm-projectile-find-file-map)
|
(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-w" 'backward-kill-word
|
||||||
"C-r" 'evil-ex-paste-from-register ; Evil registers in helm! Glorious!
|
"C-r" 'evil-ex-paste-from-register ; Evil registers in helm! Glorious!
|
||||||
|
"<escape>" 'helm-keyboard-quit
|
||||||
[escape] 'helm-keyboard-quit)
|
[escape] 'helm-keyboard-quit)
|
||||||
(:map helm-find-files-map
|
(:map helm-find-files-map
|
||||||
"C-w" 'helm-find-files-up-one-level
|
"C-w" 'helm-find-files-up-one-level
|
||||||
"TAB" 'helm-execute-persistent-action
|
;; "TAB" 'helm-execute-persistent-action
|
||||||
"/" 'helm-execute-persistent-action)
|
"/" 'helm-execute-persistent-action)
|
||||||
(:map helm-ag-map
|
(:map helm-ag-map
|
||||||
"<backtab>" 'helm-ag-edit)
|
"<backtab>" 'helm-ag-edit)
|
||||||
|
@ -56,11 +57,13 @@
|
||||||
"<escape>" 'helm-ag--edit-abort
|
"<escape>" 'helm-ag--edit-abort
|
||||||
:n "zx" 'helm-ag--edit-abort)
|
:n "zx" 'helm-ag--edit-abort)
|
||||||
(:map helm-map
|
(:map helm-map
|
||||||
|
"C-S-n" 'helm-next-source
|
||||||
|
"C-S-p" 'helm-previous-source
|
||||||
"C-u" 'helm-delete-minibuffer-contents))
|
"C-u" 'helm-delete-minibuffer-contents))
|
||||||
|
|
||||||
;;; Helm hacks
|
;;; Helm hacks
|
||||||
(defun narf*helm-toggle-header-line ()
|
(defun narf*helm-hide-source-header-maybe ()
|
||||||
(if (= (length helm-sources) 1)
|
(if (<= (length helm-sources) 1)
|
||||||
(set-face-attribute 'helm-source-header nil :height 0.1)
|
(set-face-attribute 'helm-source-header nil :height 0.1)
|
||||||
(set-face-attribute 'helm-source-header nil :height 1.0)))
|
(set-face-attribute 'helm-source-header nil :height 1.0)))
|
||||||
|
|
||||||
|
@ -74,7 +77,8 @@
|
||||||
(setcar (nthcdr 2 plist) helm-global-prompt))
|
(setcar (nthcdr 2 plist) helm-global-prompt))
|
||||||
plist)
|
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'
|
;; A simpler prompt: see `helm-global-prompt'
|
||||||
(advice-add 'helm :filter-args 'narf*helm-replace-prompt)
|
(advice-add 'helm :filter-args 'narf*helm-replace-prompt)
|
||||||
;; Hide mode-line in helm windows
|
;; Hide mode-line in helm windows
|
||||||
|
@ -102,8 +106,6 @@
|
||||||
|
|
||||||
(projectile-global-mode +1)
|
(projectile-global-mode +1)
|
||||||
|
|
||||||
;; (advice-add 'projectile-prepend-project-name :override 'narf*projectile-replace-prompt)
|
|
||||||
|
|
||||||
(require 'helm-projectile))
|
(require 'helm-projectile))
|
||||||
|
|
||||||
(use-package helm-ag
|
(use-package helm-ag
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
mouse-wheel-scroll-amount '(6 ((shift) . 2)) ;; one line at a time
|
mouse-wheel-scroll-amount '(6 ((shift) . 2)) ;; one line at a time
|
||||||
mouse-wheel-progressive-speed nil ;; don't accelerate scrolling
|
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!
|
;; Curse Lion and its sudden but inevitable fullscreen mode!
|
||||||
ns-use-native-fullscreen nil
|
ns-use-native-fullscreen nil
|
||||||
;; Don't open files from the workspace in a new frame
|
;; Don't open files from the workspace in a new frame
|
||||||
|
@ -73,11 +73,9 @@
|
||||||
|
|
||||||
(defun narf-switch-to-iterm-and-cd ()
|
(defun narf-switch-to-iterm-and-cd ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(narf:tmux-chdir nil t)
|
(narf:send-to-tmux (format "cd %s" (shell-quote-argument default-directory)))
|
||||||
(narf-switch-to-iterm))
|
(narf-switch-to-iterm))
|
||||||
|
|
||||||
;;;
|
|
||||||
|
|
||||||
(defun narf-org-init-for-osx ()
|
(defun narf-org-init-for-osx ()
|
||||||
;; Reveal files in finder
|
;; Reveal files in finder
|
||||||
(defvar org-file-apps '(("\\.org$" . emacs)
|
(defvar org-file-apps '(("\\.org$" . emacs)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
("*Backtrace*" :position bottom :height 15 :stick t)
|
("*Backtrace*" :position bottom :height 15 :stick t)
|
||||||
("*Flycheck errors*" :position bottom :height 15 :stick t)
|
("*Flycheck errors*" :position bottom :height 15 :stick t)
|
||||||
("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 0.2)
|
("^\\*[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)
|
;; ("^\\*Org .*\\*$" :regexp t :position bottom :height 15 :stick t)
|
||||||
("*Agenda Commands*" :position bottom :height 0.5)
|
("*Agenda Commands*" :position bottom :height 0.5)
|
||||||
("*Org todo*" :position bottom :height 5)
|
("*Org todo*" :position bottom :height 5)
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
(evil-resize-window 5)
|
(evil-resize-window 5)
|
||||||
(funcall cb)
|
(funcall cb)
|
||||||
(yascroll-bar-mode +1)
|
;; (yascroll-bar-mode +1)
|
||||||
(setq mode-line-format nil)))
|
(setq mode-line-format nil)))
|
||||||
|
|
||||||
(defun narf/quickrun-after-run ()
|
(defun narf/quickrun-after-run ()
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
persistent-soft-flush
|
persistent-soft-flush
|
||||||
persistent-soft-location-readable
|
persistent-soft-location-readable
|
||||||
persistent-soft-location-destroy)
|
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
|
(use-package async
|
||||||
:commands (async-start
|
:commands (async-start
|
||||||
|
@ -147,9 +147,11 @@
|
||||||
'wg-current-workgroup-p
|
'wg-current-workgroup-p
|
||||||
'wg-previous-workgroup-p)))
|
'wg-previous-workgroup-p)))
|
||||||
(wg-workgroup-list)) "")))
|
(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)
|
(provide 'core)
|
||||||
;;; core.el ends here
|
;;; core.el ends here
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
;;; defuns-flycheck.el
|
;;; defuns-flycheck.el
|
||||||
;; for ../core-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
|
;;;###autoload
|
||||||
(defun narf*flycheck-buffer ()
|
(defun narf*flycheck-buffer ()
|
||||||
(when (and (featurep 'flycheck) flycheck-mode)
|
(when (bound-and-true-p flycheck-mode)
|
||||||
(flycheck-buffer)))
|
(flycheck-buffer)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -6,17 +6,6 @@
|
||||||
(when (narf/project-p)
|
(when (narf/project-p)
|
||||||
(projectile-invalidate-cache nil)))
|
(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
|
;;;###autoload
|
||||||
(defun narf/helm-get-org-candidates-in-file (filename min-depth max-depth &optional fontify nofname)
|
(defun narf/helm-get-org-candidates-in-file (filename min-depth max-depth &optional fontify nofname)
|
||||||
(with-current-buffer (pcase filename
|
(with-current-buffer (pcase filename
|
||||||
|
@ -70,8 +59,7 @@
|
||||||
(helm :sources (if search helm-ag-source '(helm-source-do-ag))
|
(helm :sources (if search helm-ag-source '(helm-source-do-ag))
|
||||||
:buffer "*helm-ag*"
|
:buffer "*helm-ag*"
|
||||||
:keymap helm-ag-map
|
:keymap helm-ag-map
|
||||||
:input input
|
:input input)))
|
||||||
:prompt helm-global-prompt)))
|
|
||||||
|
|
||||||
;;;###autoload (autoload 'narf:helm-regex-search "defuns-helm" nil t)
|
;;;###autoload (autoload 'narf:helm-regex-search "defuns-helm" nil t)
|
||||||
(evil-define-operator narf:helm-regex-search (beg end &optional search bang)
|
(evil-define-operator narf:helm-regex-search (beg end &optional search bang)
|
||||||
|
|
|
@ -108,5 +108,15 @@
|
||||||
(wg-switch-to-workgroup-at-index index)
|
(wg-switch-to-workgroup-at-index index)
|
||||||
(narf:workgroup-display))))
|
(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)
|
(provide 'defuns-workgroup)
|
||||||
;;; defuns-workgroup.el ends here
|
;;; defuns-workgroup.el ends here
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
;;; defuns-ruby.el
|
;;; 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
|
;;;###autoload
|
||||||
(defun narf|ruby-load-file (&optional file)
|
(defun narf|ruby-load-file (&optional file)
|
||||||
(let ((file (or file buffer-file-name)))
|
(let ((file (or file buffer-file-name)))
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
"in!"
|
"in!"
|
||||||
"define-company-backend!"
|
"define-company-backend!"
|
||||||
"define-text-object!"
|
"define-text-object!"
|
||||||
|
"define-builder!"
|
||||||
)))
|
)))
|
||||||
(font-lock-add-keywords 'emacs-lisp-mode
|
(font-lock-add-keywords 'emacs-lisp-mode
|
||||||
`((,(concat "(\\s-*" (regexp-opt keywords 'paren) "\\_>")
|
`((,(concat "(\\s-*" (regexp-opt keywords 'paren) "\\_>")
|
||||||
|
|
|
@ -4,11 +4,13 @@
|
||||||
:mode "\\.go$"
|
:mode "\\.go$"
|
||||||
:interpreter "go"
|
:interpreter "go"
|
||||||
:init
|
: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
|
:config
|
||||||
(define-builder! go-mode "go build")
|
(define-builder! go-mode "go build")
|
||||||
|
|
||||||
;; emr support
|
|
||||||
(after! emr
|
(after! emr
|
||||||
(mapc (lambda (x)
|
(mapc (lambda (x)
|
||||||
(let ((command-name (car x))
|
(let ((command-name (car x))
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
:interpreter ("python" . python-mode)
|
:interpreter ("python" . python-mode)
|
||||||
:commands python-mode
|
:commands python-mode
|
||||||
:init
|
: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
|
(setq-default
|
||||||
python-indent-offset 4
|
python-indent-offset 4
|
||||||
python-environment-directory narf-temp-dir
|
python-environment-directory narf-temp-dir
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue