General cleanup
This commit is contained in:
parent
9a5f3cad10
commit
53879f2528
11 changed files with 96 additions and 101 deletions
|
@ -191,6 +191,14 @@ enable multiple minor modes for the same regexp.")
|
||||||
;; Plugins
|
;; Plugins
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(use-package editorconfig
|
||||||
|
:config
|
||||||
|
;; Don't affect lisp indentation (only `tab-width')
|
||||||
|
(setq editorconfig-indentation-alist
|
||||||
|
(delq (assq 'emacs-lisp-mode editorconfig-indentation-alist)
|
||||||
|
editorconfig-indentation-alist))
|
||||||
|
(editorconfig-mode +1))
|
||||||
|
|
||||||
(use-package ace-window
|
(use-package ace-window
|
||||||
:commands ace-window
|
:commands ace-window
|
||||||
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
:config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
|
||||||
|
@ -202,12 +210,6 @@ enable multiple minor modes for the same regexp.")
|
||||||
:config (setq avy-all-windows nil
|
:config (setq avy-all-windows nil
|
||||||
avy-background t))
|
avy-background t))
|
||||||
|
|
||||||
(use-package editorconfig
|
|
||||||
:config
|
|
||||||
;; Don't affect lisp indentation (just `tab-width')
|
|
||||||
(setq editorconfig-indentation-alist (delq (assq 'emacs-lisp-mode editorconfig-indentation-alist) editorconfig-indentation-alist))
|
|
||||||
(editorconfig-mode +1))
|
|
||||||
|
|
||||||
(use-package emr
|
(use-package emr
|
||||||
:commands (emr-initialize emr-show-refactor-menu emr-declare-command)
|
:commands (emr-initialize emr-show-refactor-menu emr-declare-command)
|
||||||
:config (define-key popup-menu-keymap [escape] 'keyboard-quit))
|
:config (define-key popup-menu-keymap [escape] 'keyboard-quit))
|
||||||
|
@ -215,8 +217,7 @@ enable multiple minor modes for the same regexp.")
|
||||||
(use-package expand-region
|
(use-package expand-region
|
||||||
:commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
:commands (er/expand-region er/contract-region er/mark-symbol er/mark-word))
|
||||||
|
|
||||||
(use-package goto-last-change
|
(use-package goto-last-change :commands goto-last-change)
|
||||||
:commands goto-last-change)
|
|
||||||
|
|
||||||
(use-package hideshow
|
(use-package hideshow
|
||||||
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
|
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
|
||||||
|
@ -300,13 +301,14 @@ enable multiple minor modes for the same regexp.")
|
||||||
|
|
||||||
(use-package re-builder
|
(use-package re-builder
|
||||||
:commands (re-builder reb-mode-buffer-p)
|
:commands (re-builder reb-mode-buffer-p)
|
||||||
:init (add-hook! reb-mode 'narf|reb-cleanup)
|
:init
|
||||||
|
(add-hook 'reb-mode-hook 'narf|reb-cleanup)
|
||||||
|
(evil-set-initial-state 'reb-mode 'insert)
|
||||||
:config
|
:config
|
||||||
(setq reb-re-syntax 'string)
|
(setq reb-re-syntax 'string)
|
||||||
(evil-set-initial-state 'reb-mode 'insert)
|
(map! :map rxt-help-mode-map
|
||||||
|
:n [escape] 'kill-buffer-and-window
|
||||||
(map! :map rxt-help-mode-map :n [escape] 'kill-buffer-and-window)
|
:map reb-mode-map
|
||||||
(map! :map reb-mode-map
|
|
||||||
:n "C-g" 'reb-quit
|
:n "C-g" 'reb-quit
|
||||||
:n [escape] 'reb-quit
|
:n [escape] 'reb-quit
|
||||||
:n [backtab] 'reb-change-syntax))
|
:n [backtab] 'reb-change-syntax))
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
;; code to make a permanent frame header to display these some day)
|
;; code to make a permanent frame header to display these some day)
|
||||||
;; 2. Session persistence
|
;; 2. Session persistence
|
||||||
|
|
||||||
|
(defvar narf-wg-frames '()
|
||||||
|
"A list of all the frames opened as separate workgroups. See
|
||||||
|
defuns/defuns-workgroups.el.")
|
||||||
|
|
||||||
|
(defvar narf-wg-names '()
|
||||||
|
"A list of fixed names for workgroups. If a name is set, workgroup names aren't
|
||||||
|
automatically renamed to the project name.")
|
||||||
|
|
||||||
(use-package workgroups2
|
(use-package workgroups2
|
||||||
:when (display-graphic-p)
|
:when (display-graphic-p)
|
||||||
:init
|
:init
|
||||||
|
@ -36,18 +44,11 @@
|
||||||
wg-list-display-decor-previous-left ""
|
wg-list-display-decor-previous-left ""
|
||||||
wg-list-display-decor-previous-right "")
|
wg-list-display-decor-previous-right "")
|
||||||
|
|
||||||
(add-hook! emacs-startup (workgroups-mode +1))
|
(add-hook 'emacs-startup-hook 'workgroups-mode)
|
||||||
:config
|
:config
|
||||||
(unless (file-exists-p wg-workgroup-directory)
|
(unless (file-exists-p wg-workgroup-directory)
|
||||||
(mkdir wg-workgroup-directory))
|
(mkdir wg-workgroup-directory))
|
||||||
|
|
||||||
(defvar narf-wg-frames '()
|
|
||||||
"A list of all the frames opened as separate workgroups. See
|
|
||||||
defuns/defuns-workgroups.el.")
|
|
||||||
(defvar narf-wg-names '()
|
|
||||||
"A list of fixed names for workgroups. If a name is set, workgroup names aren't
|
|
||||||
automatically renamed to the project name.")
|
|
||||||
|
|
||||||
;; Remember the set names in between sessions
|
;; Remember the set names in between sessions
|
||||||
(add-to-list 'savehist-additional-variables 'narf-wg-names)
|
(add-to-list 'savehist-additional-variables 'narf-wg-names)
|
||||||
|
|
||||||
|
@ -55,14 +56,11 @@ automatically renamed to the project name.")
|
||||||
;; Create a new workgroup on switch-project
|
;; Create a new workgroup on switch-project
|
||||||
(setq projectile-switch-project-action 'narf/wg-projectile-switch-project))
|
(setq projectile-switch-project-action 'narf/wg-projectile-switch-project))
|
||||||
|
|
||||||
;; Seriously, don't mess with the modeline! `wg-mode-line-display-on' isn't enough
|
;; `wg-mode-line-display-on' wasn't enough
|
||||||
(advice-add 'wg-change-modeline :override 'ignore)
|
(advice-add 'wg-change-modeline :override 'ignore)
|
||||||
|
|
||||||
;; Don't remember popup and neotree windows
|
;; Don't remember popup and neotree windows
|
||||||
(add-hook! kill-emacs
|
(add-hook 'kill-emacs-hook 'narf|wg-cleanup)
|
||||||
(narf/popup-close-all)
|
|
||||||
(when (and (featurep 'neotree) (neo-global--window-exists-p))
|
|
||||||
(neotree-hide)))
|
|
||||||
|
|
||||||
;; This helps abstract some of the underlying functions away, just in case I want to
|
;; This helps abstract some of the underlying functions away, just in case I want to
|
||||||
;; switch to a different package in the future, like persp-mode, eyebrowse or wconf.
|
;; switch to a different package in the future, like persp-mode, eyebrowse or wconf.
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
;;; defuns-workgroup.el
|
;;; defuns-workgroup.el
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun narf|wg-cleanup ()
|
||||||
|
(narf/popup-close-all)
|
||||||
|
(when (and (featurep 'neotree) (neo-global--window-exists-p))
|
||||||
|
(neotree-hide)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun narf/wg-projectile-switch-project ()
|
(defun narf/wg-projectile-switch-project ()
|
||||||
(narf:workgroup-new nil (file-name-nondirectory (directory-file-name (narf/project-root))) t))
|
(narf:workgroup-new nil (file-name-nondirectory (directory-file-name (narf/project-root))) t))
|
||||||
|
@ -9,6 +15,7 @@
|
||||||
(interactive "<!><a>")
|
(interactive "<!><a>")
|
||||||
(unless (wg-workgroup-list)
|
(unless (wg-workgroup-list)
|
||||||
(wg-create-workgroup wg-first-wg-name))
|
(wg-create-workgroup wg-first-wg-name))
|
||||||
|
(narf|wg-cleanup)
|
||||||
(wg-save-session-as (if session-name
|
(wg-save-session-as (if session-name
|
||||||
(concat wg-workgroup-directory session-name)
|
(concat wg-workgroup-directory session-name)
|
||||||
(if bang
|
(if bang
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
(define-repl! haskell-mode switch-to-haskell)
|
(define-repl! haskell-mode switch-to-haskell)
|
||||||
(add-hook! haskell-mode '(interactive-haskell-mode flycheck-mode))
|
(add-hook! haskell-mode '(interactive-haskell-mode flycheck-mode))
|
||||||
:config
|
:config
|
||||||
(add-to-list 'completion-ignored-extensions ".hi"))
|
(push ".hi" completion-ignored-extensions))
|
||||||
|
|
||||||
(use-package inf-haskell
|
(use-package inf-haskell
|
||||||
:commands (inferior-haskell-mode inf-haskell-mode switch-to-haskell)
|
:commands (inferior-haskell-mode inf-haskell-mode switch-to-haskell)
|
||||||
:init (evil-set-initial-state 'inferior-haskell-mode 'emacs)
|
:init (evil-set-initial-state 'inferior-haskell-mode 'emacs)
|
||||||
:config
|
:config
|
||||||
(define-key inf-haskell-mode-map (kbd "ESC ESC") 'narf/popup-close))
|
(map! :map inf-haskell-mode-map "ESC ESC" 'narf/popup-close))
|
||||||
|
|
||||||
(provide 'module-haskell)
|
(provide 'module-haskell)
|
||||||
;;; module-haskell.el ends here
|
;;; module-haskell.el ends here
|
||||||
|
|
|
@ -4,13 +4,16 @@
|
||||||
:mode "\\.js$"
|
:mode "\\.js$"
|
||||||
:interpreter "node"
|
:interpreter "node"
|
||||||
:init
|
:init
|
||||||
|
(add-hook 'js2-mode-hook '(tern-mode emr-initialize))
|
||||||
(define-repl! js2-mode nodejs-repl)
|
(define-repl! js2-mode nodejs-repl)
|
||||||
(define-docset! js2-mode "js,javascript,nodejs,angularjs,express,jquery,mongoose")
|
(define-docset! js2-mode "js,javascript,nodejs,angularjs,express,jquery,mongoose")
|
||||||
|
(define-company-backend! js2-mode (tern))
|
||||||
|
|
||||||
(add-hook! js2-mode
|
(add-hook! js2-mode
|
||||||
(electric-indent-local-mode +1)
|
(electric-indent-local-mode +1)
|
||||||
(setq electric-indent-chars '(?} ?\) ?.)
|
(setq electric-indent-chars '(?} ?\) ?.)
|
||||||
narf-electric-indent-words '("||" "&&")))
|
narf-electric-indent-words '("||" "&&")))
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(setq-default
|
(setq-default
|
||||||
js2-skip-preprocessor-directives t
|
js2-skip-preprocessor-directives t
|
||||||
|
@ -22,27 +25,16 @@
|
||||||
;; Launchbar API
|
;; Launchbar API
|
||||||
"LaunchBar" "File" "Action" "HTTP" "include" "Lib"))
|
"LaunchBar" "File" "Action" "HTTP" "include" "Lib"))
|
||||||
|
|
||||||
|
(require 'tern)
|
||||||
|
(require 'company-tern)
|
||||||
|
|
||||||
;; [pedantry intensifies]
|
;; [pedantry intensifies]
|
||||||
(defadvice js2-mode (after js2-mode-rename-modeline activate)
|
(defadvice js2-mode (after js2-mode-rename-modeline activate)
|
||||||
(setq mode-name "JS2"))
|
(setq mode-name "JS2"))
|
||||||
|
|
||||||
(map! :map js2-mode-map
|
(map! :map js2-mode-map (:localleader :nv ";" 'narf/append-semicolon))
|
||||||
(:localleader :nv ";" 'narf/append-semicolon))
|
|
||||||
|
|
||||||
(after! web-beautify
|
(require 'js2-refactor)
|
||||||
(add-hook! js2-mode (setenv "jsbeautify_indent_size" (int-to-string js2-basic-offset)))
|
|
||||||
(map! :map js2-mode-map :m "gQ" 'web-beautify-js))
|
|
||||||
|
|
||||||
(use-package tern
|
|
||||||
:commands tern-mode
|
|
||||||
:init (add-hook 'js2-mode-hook 'tern-mode)
|
|
||||||
:config
|
|
||||||
(require 'company-tern)
|
|
||||||
(define-company-backend! js2-mode (tern)))
|
|
||||||
|
|
||||||
(use-package js2-refactor
|
|
||||||
:init (add-hook 'js2-mode-hook 'emr-initialize)
|
|
||||||
:config
|
|
||||||
(require 'emr)
|
(require 'emr)
|
||||||
(mapc (lambda (x)
|
(mapc (lambda (x)
|
||||||
(let ((command-name (car x))
|
(let ((command-name (car x))
|
||||||
|
@ -81,7 +73,7 @@
|
||||||
(log-this "log this" 'both)
|
(log-this "log this" 'both)
|
||||||
(debug-this "debug this" 'both)
|
(debug-this "debug this" 'both)
|
||||||
(forward-slurp "forward slurp" nil)
|
(forward-slurp "forward slurp" nil)
|
||||||
(forward-barf "forward barf" nil)))))
|
(forward-barf "forward barf" nil))))
|
||||||
|
|
||||||
(use-package jsx-mode :mode "\\.jsx$")
|
(use-package jsx-mode :mode "\\.jsx$")
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
:init
|
:init
|
||||||
(define-repl! julia-mode narf/julia-repl)
|
(define-repl! julia-mode narf/julia-repl)
|
||||||
(evil-set-initial-state 'inferior-julia-mode 'emacs)
|
(evil-set-initial-state 'inferior-julia-mode 'emacs)
|
||||||
(add-to-list 'editorconfig-indentation-alist '(julia-mode julia-indent-offset)))
|
(push '(julia-mode julia-indent-offset) editorconfig-indentation-alist))
|
||||||
|
|
||||||
(provide 'module-julia)
|
(provide 'module-julia)
|
||||||
;;; module-julia.el ends here
|
;;; module-julia.el ends here
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
(use-package php-refactor-mode
|
(use-package php-refactor-mode
|
||||||
:init (add-hook! php-mode '(turn-on-eldoc-mode emr-initialize php-refactor-mode))
|
:init (add-hook! php-mode '(turn-on-eldoc-mode emr-initialize php-refactor-mode))
|
||||||
:config
|
:config
|
||||||
(require 'emr)
|
|
||||||
(mapc (lambda (x)
|
(mapc (lambda (x)
|
||||||
(let ((command-name (car x))
|
(let ((command-name (car x))
|
||||||
(title (cadr x))
|
(title (cadr x))
|
||||||
|
|
|
@ -4,13 +4,16 @@
|
||||||
:when IS-MAC
|
:when IS-MAC
|
||||||
:commands (processing-mode processing-find-sketch)
|
:commands (processing-mode processing-find-sketch)
|
||||||
:mode "\\.pde$"
|
:mode "\\.pde$"
|
||||||
|
:init
|
||||||
|
(define-builder! processing-mode processing-sketch-build)
|
||||||
|
(add-hook 'processing-compilation-mode-hook 'narf|hide-mode-line)
|
||||||
|
|
||||||
:config
|
:config
|
||||||
(setq processing-location "/usr/local/bin/processing-java"
|
(setq processing-location "/usr/local/bin/processing-java"
|
||||||
processing-application-dir "/Applications/Processing.app"
|
processing-application-dir "/Applications/Processing.app"
|
||||||
processing-sketchbook-dir "~/Dropbox/work/pde"
|
processing-sketchbook-dir "~/Dropbox/work/pde"
|
||||||
processing-output-dir "/tmp")
|
processing-output-dir "/tmp")
|
||||||
|
|
||||||
(define-builder! processing-mode processing-sketch-build)
|
|
||||||
(after! quickrun
|
(after! quickrun
|
||||||
(quickrun-add-command
|
(quickrun-add-command
|
||||||
"processing" `((:command . ,processing-location)
|
"processing" `((:command . ,processing-location)
|
||||||
|
@ -21,7 +24,7 @@
|
||||||
|
|
||||||
(map! :map processing-mode-map
|
(map! :map processing-mode-map
|
||||||
:nv "M-r" 'processing-sketch-run
|
:nv "M-r" 'processing-sketch-run
|
||||||
:m "gD" 'processing-find-in-reference
|
:m "gd" 'processing-find-in-reference
|
||||||
:m "gF" 'processing-find-sketch
|
:m "gF" 'processing-find-sketch
|
||||||
(:localleader
|
(:localleader
|
||||||
"e" 'processing-export-application
|
"e" 'processing-export-application
|
||||||
|
@ -29,7 +32,6 @@
|
||||||
"e" 'processing-open-examples
|
"e" 'processing-open-examples
|
||||||
"o" 'processing-open-sketchbook))
|
"o" 'processing-open-sketchbook))
|
||||||
|
|
||||||
(add-hook 'processing-compilation-mode-hook 'narf|hide-mode-line)
|
|
||||||
(add-hook! processing-mode
|
(add-hook! processing-mode
|
||||||
(setq-local company-backends '((company-keywords
|
(setq-local company-backends '((company-keywords
|
||||||
:with
|
:with
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
(define-builder! rust-mode "cargo run" "Cargo.toml")
|
(define-builder! rust-mode "cargo run" "Cargo.toml")
|
||||||
(define-builder! toml-mode "cargo run" "Cargo.toml")
|
(define-builder! toml-mode "cargo run" "Cargo.toml")
|
||||||
|
|
||||||
(use-package flycheck-rust
|
(require 'flycheck-rust)
|
||||||
:config (add-hook 'rust-mode-hook 'flycheck-mode))
|
(add-hook 'rust-mode-hook 'flycheck-mode)
|
||||||
|
|
||||||
(use-package racer
|
(use-package racer
|
||||||
:preface
|
:preface
|
||||||
|
@ -15,12 +15,12 @@
|
||||||
racer-rust-src-path (concat narf-ext-dir "/rust/src/"))
|
racer-rust-src-path (concat narf-ext-dir "/rust/src/"))
|
||||||
:when (file-exists-p racer-cmd)
|
:when (file-exists-p racer-cmd)
|
||||||
:config
|
:config
|
||||||
|
(define-company-backend! rust-mode (racer))
|
||||||
(map! :map rust-mode-map :m "gd" 'racer-find-definition)
|
(map! :map rust-mode-map :m "gd" 'racer-find-definition)
|
||||||
|
|
||||||
;; TODO Unit test keybinds
|
;; TODO Unit test keybinds
|
||||||
|
|
||||||
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
|
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))))
|
||||||
(define-company-backend! rust-mode (racer))))
|
|
||||||
|
|
||||||
(provide 'module-rust)
|
(provide 'module-rust)
|
||||||
;;; module-rust.el ends here
|
;;; module-rust.el ends here
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
|
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
:mode ("\\.md$" "/README$")
|
:mode ("\\.md$" "/README$")
|
||||||
:functions (markdown-use-region-p
|
|
||||||
markdown-unwrap-things-in-region
|
|
||||||
markdown-wrap-or-insert
|
|
||||||
markdown-unwrap-thing-at-point)
|
|
||||||
:init
|
:init
|
||||||
(add-hook 'markdown-mode-hook 'turn-on-auto-fill)
|
(add-hook 'markdown-mode-hook 'turn-on-auto-fill)
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -80,11 +80,10 @@
|
||||||
(use-package web-beautify
|
(use-package web-beautify
|
||||||
:commands (web-beautify-js web-beautify-css web-beautify-html)
|
:commands (web-beautify-js web-beautify-css web-beautify-html)
|
||||||
:init
|
:init
|
||||||
(add-hook! (web-mode css-mode) (setenv "jsbeautify_indent_size" tab-width))
|
(add-hook! (web-mode css-mode js2-mode) (setenv "jsbeautify_indent_size" (int-to-string tab-width)))
|
||||||
(after! web-mode
|
(map! (:after web-mode :map web-mode-map :m "gQ" 'web-beautify-html)
|
||||||
(map! :map web-mode-map
|
(:after css-mode :map css-mode-map :m "gQ" 'web-beautify-css)
|
||||||
(:after web-mode :m "gQ" 'web-beautify-html)
|
(:after js2-mode :map js2-mode-map :m "gQ" 'web-beautify-js)))
|
||||||
(:after css-mode :m "gQ" 'web-beautify-css))))
|
|
||||||
|
|
||||||
(use-package emmet-mode
|
(use-package emmet-mode
|
||||||
:commands (emmet-mode)
|
:commands (emmet-mode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue