General cleanup
This commit is contained in:
parent
9a5f3cad10
commit
53879f2528
11 changed files with 96 additions and 101 deletions
|
@ -10,13 +10,13 @@
|
|||
(define-repl! haskell-mode switch-to-haskell)
|
||||
(add-hook! haskell-mode '(interactive-haskell-mode flycheck-mode))
|
||||
:config
|
||||
(add-to-list 'completion-ignored-extensions ".hi"))
|
||||
(push ".hi" completion-ignored-extensions))
|
||||
|
||||
(use-package inf-haskell
|
||||
:commands (inferior-haskell-mode inf-haskell-mode switch-to-haskell)
|
||||
:init (evil-set-initial-state 'inferior-haskell-mode 'emacs)
|
||||
: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)
|
||||
;;; module-haskell.el ends here
|
||||
|
|
|
@ -4,13 +4,16 @@
|
|||
:mode "\\.js$"
|
||||
:interpreter "node"
|
||||
:init
|
||||
(add-hook 'js2-mode-hook '(tern-mode emr-initialize))
|
||||
(define-repl! js2-mode nodejs-repl)
|
||||
(define-docset! js2-mode "js,javascript,nodejs,angularjs,express,jquery,mongoose")
|
||||
(define-company-backend! js2-mode (tern))
|
||||
|
||||
(add-hook! js2-mode
|
||||
(electric-indent-local-mode +1)
|
||||
(setq electric-indent-chars '(?} ?\) ?.)
|
||||
narf-electric-indent-words '("||" "&&")))
|
||||
|
||||
:config
|
||||
(setq-default
|
||||
js2-skip-preprocessor-directives t
|
||||
|
@ -22,66 +25,55 @@
|
|||
;; Launchbar API
|
||||
"LaunchBar" "File" "Action" "HTTP" "include" "Lib"))
|
||||
|
||||
(require 'tern)
|
||||
(require 'company-tern)
|
||||
|
||||
;; [pedantry intensifies]
|
||||
(defadvice js2-mode (after js2-mode-rename-modeline activate)
|
||||
(setq mode-name "JS2"))
|
||||
|
||||
(map! :map js2-mode-map
|
||||
(:localleader :nv ";" 'narf/append-semicolon))
|
||||
(map! :map js2-mode-map (:localleader :nv ";" 'narf/append-semicolon))
|
||||
|
||||
(after! web-beautify
|
||||
(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)
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
(region-p (caddr x))
|
||||
predicate)
|
||||
(setq predicate (cond ((eq region-p 'both) nil)
|
||||
(t (if region-p
|
||||
(lambda () (use-region-p))
|
||||
(lambda () (not (use-region-p)))))))
|
||||
(emr-declare-command
|
||||
(intern (format "js2r-%s" (symbol-name command-name)))
|
||||
:title title :modes 'js2-mode :predicate predicate)))
|
||||
'((extract-function "extract function" t)
|
||||
(extract-method "extract method" t)
|
||||
(introduce-parameter "introduce parameter" t)
|
||||
(localize-parameter "localize parameter" nil)
|
||||
(expand-object "expand object" nil)
|
||||
(contract-object "contract object" nil)
|
||||
(expand-function "expand function" nil)
|
||||
(contract-function "contract function" nil)
|
||||
(expand-array "expand array" nil)
|
||||
(contract-array "contract array" nil)
|
||||
(wrap-buffer-in-iife "wrap buffer in ii function" nil)
|
||||
(inject-global-in-iife "inject global in ii function" t)
|
||||
(add-to-globals-annotation "add to globals annotation" nil)
|
||||
(extract-var "extract variable" t)
|
||||
(inline-var "inline variable" t)
|
||||
(rename-var "rename variable" nil)
|
||||
(var-to-this "var to this" nil)
|
||||
(arguments-to-object "arguments to object" nil)
|
||||
(ternary-to-if "ternary to if" nil)
|
||||
(split-var-declaration "split var declaration" nil)
|
||||
(split-string "split string" nil)
|
||||
(unwrap "unwrap" t)
|
||||
(log-this "log this" 'both)
|
||||
(debug-this "debug this" 'both)
|
||||
(forward-slurp "forward slurp" nil)
|
||||
(forward-barf "forward barf" nil)))))
|
||||
(require 'js2-refactor)
|
||||
(require 'emr)
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
(region-p (caddr x))
|
||||
predicate)
|
||||
(setq predicate (cond ((eq region-p 'both) nil)
|
||||
(t (if region-p
|
||||
(lambda () (use-region-p))
|
||||
(lambda () (not (use-region-p)))))))
|
||||
(emr-declare-command
|
||||
(intern (format "js2r-%s" (symbol-name command-name)))
|
||||
:title title :modes 'js2-mode :predicate predicate)))
|
||||
'((extract-function "extract function" t)
|
||||
(extract-method "extract method" t)
|
||||
(introduce-parameter "introduce parameter" t)
|
||||
(localize-parameter "localize parameter" nil)
|
||||
(expand-object "expand object" nil)
|
||||
(contract-object "contract object" nil)
|
||||
(expand-function "expand function" nil)
|
||||
(contract-function "contract function" nil)
|
||||
(expand-array "expand array" nil)
|
||||
(contract-array "contract array" nil)
|
||||
(wrap-buffer-in-iife "wrap buffer in ii function" nil)
|
||||
(inject-global-in-iife "inject global in ii function" t)
|
||||
(add-to-globals-annotation "add to globals annotation" nil)
|
||||
(extract-var "extract variable" t)
|
||||
(inline-var "inline variable" t)
|
||||
(rename-var "rename variable" nil)
|
||||
(var-to-this "var to this" nil)
|
||||
(arguments-to-object "arguments to object" nil)
|
||||
(ternary-to-if "ternary to if" nil)
|
||||
(split-var-declaration "split var declaration" nil)
|
||||
(split-string "split string" nil)
|
||||
(unwrap "unwrap" t)
|
||||
(log-this "log this" 'both)
|
||||
(debug-this "debug this" 'both)
|
||||
(forward-slurp "forward slurp" nil)
|
||||
(forward-barf "forward barf" nil))))
|
||||
|
||||
(use-package jsx-mode :mode "\\.jsx$")
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
:init
|
||||
(define-repl! julia-mode narf/julia-repl)
|
||||
(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)
|
||||
;;; module-julia.el ends here
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
(use-package php-refactor-mode
|
||||
:init (add-hook! php-mode '(turn-on-eldoc-mode emr-initialize php-refactor-mode))
|
||||
:config
|
||||
(require 'emr)
|
||||
(mapc (lambda (x)
|
||||
(let ((command-name (car x))
|
||||
(title (cadr x))
|
||||
|
|
|
@ -4,13 +4,16 @@
|
|||
:when IS-MAC
|
||||
:commands (processing-mode processing-find-sketch)
|
||||
:mode "\\.pde$"
|
||||
:init
|
||||
(define-builder! processing-mode processing-sketch-build)
|
||||
(add-hook 'processing-compilation-mode-hook 'narf|hide-mode-line)
|
||||
|
||||
:config
|
||||
(setq processing-location "/usr/local/bin/processing-java"
|
||||
processing-application-dir "/Applications/Processing.app"
|
||||
processing-sketchbook-dir "~/Dropbox/work/pde"
|
||||
processing-output-dir "/tmp")
|
||||
|
||||
(define-builder! processing-mode processing-sketch-build)
|
||||
(after! quickrun
|
||||
(quickrun-add-command
|
||||
"processing" `((:command . ,processing-location)
|
||||
|
@ -21,7 +24,7 @@
|
|||
|
||||
(map! :map processing-mode-map
|
||||
:nv "M-r" 'processing-sketch-run
|
||||
:m "gD" 'processing-find-in-reference
|
||||
:m "gd" 'processing-find-in-reference
|
||||
:m "gF" 'processing-find-sketch
|
||||
(:localleader
|
||||
"e" 'processing-export-application
|
||||
|
@ -29,7 +32,6 @@
|
|||
"e" 'processing-open-examples
|
||||
"o" 'processing-open-sketchbook))
|
||||
|
||||
(add-hook 'processing-compilation-mode-hook 'narf|hide-mode-line)
|
||||
(add-hook! processing-mode
|
||||
(setq-local company-backends '((company-keywords
|
||||
:with
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
(define-builder! rust-mode "cargo run" "Cargo.toml")
|
||||
(define-builder! toml-mode "cargo run" "Cargo.toml")
|
||||
|
||||
(use-package flycheck-rust
|
||||
:config (add-hook 'rust-mode-hook 'flycheck-mode))
|
||||
(require 'flycheck-rust)
|
||||
(add-hook 'rust-mode-hook 'flycheck-mode)
|
||||
|
||||
(use-package racer
|
||||
:preface
|
||||
|
@ -15,12 +15,12 @@
|
|||
racer-rust-src-path (concat narf-ext-dir "/rust/src/"))
|
||||
:when (file-exists-p racer-cmd)
|
||||
:config
|
||||
(define-company-backend! rust-mode (racer))
|
||||
(map! :map rust-mode-map :m "gd" 'racer-find-definition)
|
||||
|
||||
;; TODO Unit test keybinds
|
||||
|
||||
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))
|
||||
(define-company-backend! rust-mode (racer))))
|
||||
(add-hook! rust-mode '(racer-mode eldoc-mode flycheck-rust-setup))))
|
||||
|
||||
(provide 'module-rust)
|
||||
;;; module-rust.el ends here
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
|
||||
(use-package markdown-mode
|
||||
:mode ("\\.md$" "/README$")
|
||||
:functions (markdown-use-region-p
|
||||
markdown-unwrap-things-in-region
|
||||
markdown-wrap-or-insert
|
||||
markdown-unwrap-thing-at-point)
|
||||
:init
|
||||
(add-hook 'markdown-mode-hook 'turn-on-auto-fill)
|
||||
:config
|
||||
|
|
|
@ -80,11 +80,10 @@
|
|||
(use-package web-beautify
|
||||
:commands (web-beautify-js web-beautify-css web-beautify-html)
|
||||
:init
|
||||
(add-hook! (web-mode css-mode) (setenv "jsbeautify_indent_size" tab-width))
|
||||
(after! web-mode
|
||||
(map! :map web-mode-map
|
||||
(:after web-mode :m "gQ" 'web-beautify-html)
|
||||
(:after css-mode :m "gQ" 'web-beautify-css))))
|
||||
(add-hook! (web-mode css-mode js2-mode) (setenv "jsbeautify_indent_size" (int-to-string tab-width)))
|
||||
(map! (:after web-mode :map web-mode-map :m "gQ" 'web-beautify-html)
|
||||
(:after css-mode :map css-mode-map :m "gQ" 'web-beautify-css)
|
||||
(:after js2-mode :map js2-mode-map :m "gQ" 'web-beautify-js)))
|
||||
|
||||
(use-package emmet-mode
|
||||
:commands (emmet-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue