rm module-apple, add module-{db,swift}, disable module-org, update init.el
This commit is contained in:
parent
8bdb4d71d6
commit
1db2ccf504
4 changed files with 72 additions and 43 deletions
|
@ -1,33 +0,0 @@
|
|||
;;; module-apple.el
|
||||
|
||||
(use-package applescript-mode :mode "\\.applescript$")
|
||||
|
||||
|
||||
;;
|
||||
;; LaunchBar: https://www.obdev.at/products/launchbar
|
||||
;;
|
||||
|
||||
(def-project-type! lb6 "lb6"
|
||||
:match "\\.lb\\(action\\|ext\\)/.+$"
|
||||
:build (lambda ()
|
||||
(awhen (f-traverse-upwards (lambda (f) (f-ext? f "lbaction")))
|
||||
(shell-command (format "open '%s'" it)))))
|
||||
|
||||
|
||||
;;
|
||||
;; Swift
|
||||
;;
|
||||
|
||||
;; TODO Set up emacs task runners for fruitstrap
|
||||
(use-package swift-mode
|
||||
:mode "\\.swift$"
|
||||
:init (add-hook 'swift-mode-hook 'flycheck-mode)
|
||||
:config
|
||||
(def-company-backend! swift-mode (sourcekit yasnippet))
|
||||
(after! flycheck (push 'swift flycheck-checkers)))
|
||||
|
||||
(use-package company-sourcekit
|
||||
:after swift-mode)
|
||||
|
||||
(provide 'module-apple)
|
||||
;;; module-apple.el ends here
|
46
modules/module-db.el
Normal file
46
modules/module-db.el
Normal file
|
@ -0,0 +1,46 @@
|
|||
;;; module-db.el
|
||||
|
||||
(use-package sql-mode
|
||||
:mode "\\.sql$"
|
||||
:config
|
||||
(evil-set-initial-state 'sql-interactive-mode 'emacs)
|
||||
(push 'sql-interactive-mode doom-popup-protect-modes)
|
||||
;; For my local development environment
|
||||
(setq sql-pop-to-buffer-after-send-region nil
|
||||
sql-server "docker.dev"
|
||||
sql-user "root"
|
||||
sql-password ""))
|
||||
|
||||
(defvar db-commands
|
||||
'((mysql
|
||||
(:listdb )
|
||||
)))
|
||||
|
||||
(evil-define-command doom:db-select (product)
|
||||
(interactive "<a>")
|
||||
(sql-set-product (intern product))
|
||||
(message "sql-product set to %s" product))
|
||||
|
||||
(evil-define-operator doom:db (beg end &optional bang product)
|
||||
"Open a db connection, reopen an old one, or send the selected region to the
|
||||
open comint."
|
||||
:type inclusive
|
||||
(interactive "<r><!><a>")
|
||||
(let ((sql-buf (get-buffer sql-buffer)))
|
||||
(when (and bang sql-buf)
|
||||
(message "Restarting connection")
|
||||
(kill-buffer sql-buf))
|
||||
(if sql-buf
|
||||
(if (or (get-buffer-window sql-buf)
|
||||
(evil-visual-state-p))
|
||||
(sql-send-region beg end)
|
||||
(doom/popup-buffer sql-buf))
|
||||
(let ((product (if product (intern product) sql-product)))
|
||||
(unless product
|
||||
(user-error "No SQL product is set"))
|
||||
(sql-set-product product)
|
||||
(sql-product-interactive product 0)
|
||||
(message "Started new %s connection" product)))))
|
||||
|
||||
(provide 'module-db)
|
||||
;;; module-db.el ends here
|
16
modules/module-swift.el
Normal file
16
modules/module-swift.el
Normal file
|
@ -0,0 +1,16 @@
|
|||
;;; module-swift.el
|
||||
|
||||
;; TODO Set up emacs task runners for fruitstrap
|
||||
(use-package swift-mode
|
||||
:mode "\\.swift$"
|
||||
:init (add-hook 'swift-mode-hook 'flycheck-mode)
|
||||
:config
|
||||
(def-company-backend! swift-mode (sourcekit yasnippet))
|
||||
(def-repl! swift-mode swift-mode-run-repl)
|
||||
(after! flycheck (push 'swift flycheck-checkers)))
|
||||
|
||||
(use-package company-sourcekit
|
||||
:after swift-mode)
|
||||
|
||||
(provide 'module-swift)
|
||||
;;; module-swift.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue