2015-01-14 04:12:56 +00:00
|
|
|
;;; packages.el --- Windows Scripts Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2015-01-14 04:12:56 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq windows-scripts-packages
|
2014-12-13 05:31:01 +00:00
|
|
|
'(
|
2016-01-18 03:06:04 +00:00
|
|
|
(dos :location local)
|
2016-04-05 04:08:34 +00:00
|
|
|
ggtags
|
2017-08-26 21:18:09 +00:00
|
|
|
counsel-gtags
|
2016-04-05 04:08:34 +00:00
|
|
|
helm-gtags
|
2014-12-13 05:31:01 +00:00
|
|
|
powershell
|
2015-04-19 03:40:24 +00:00
|
|
|
))
|
2014-12-13 05:31:01 +00:00
|
|
|
|
2016-01-18 03:06:04 +00:00
|
|
|
(defun windows-scripts/init-dos ()
|
|
|
|
(use-package dos
|
|
|
|
:commands dos-mode
|
2016-05-13 06:36:24 +00:00
|
|
|
:mode (("\\.bat\\'" . dos-mode)
|
|
|
|
("\\.cmd\\'" . dos-mode))
|
2016-01-18 03:06:04 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(defun windows-scripts/dos-outline-hook ()
|
|
|
|
(defun outline-mouse-select ()
|
|
|
|
"Select position and return to `dos-mode'."
|
|
|
|
(interactive)
|
|
|
|
(dos-mode)
|
|
|
|
(beginning-of-line)))
|
|
|
|
(defun windows-scripts/dos-outline ()
|
|
|
|
"Set a local binding to be able to return easily in dos-mode."
|
|
|
|
(interactive)
|
|
|
|
(dos-outline)
|
|
|
|
(define-key evil-normal-state-local-map (kbd "SPC m z") 'dos-mode))
|
|
|
|
(add-hook 'outline-mode-hook 'windows-scripts/dos-outline-hook))
|
|
|
|
:config
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'dos-mode
|
|
|
|
"hD" 'dos-help-cmd
|
|
|
|
"eb" 'dos-run
|
|
|
|
"eB" 'dos-run-args
|
|
|
|
"s" 'dos-sep
|
|
|
|
"t" 'dos-template-mini
|
|
|
|
"T" 'dos-template
|
|
|
|
"z" 'windows-scripts/dos-outline)))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun windows-scripts/post-init-ggtags ()
|
2016-08-15 19:24:44 +00:00
|
|
|
(add-hook 'dos-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
2017-08-26 21:18:09 +00:00
|
|
|
(defun windows-scripts/post-init-counsel-gtags ()
|
|
|
|
(spacemacs/counsel-gtags-define-keys-for-mode 'dos-mode))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun windows-scripts/post-init-helm-gtags ()
|
|
|
|
(spacemacs/helm-gtags-define-keys-for-mode 'dos-mode))
|
|
|
|
|
2014-12-13 05:31:01 +00:00
|
|
|
(defun windows-scripts/init-powershell ()
|
|
|
|
(use-package powershell
|
2016-05-13 06:36:24 +00:00
|
|
|
:mode (("\\.ps1\\'" . powershell-mode)
|
|
|
|
("\\.psm1\\'" . powershell-mode))
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-05-31 00:11:55 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(defun powershell/define-text-objects ()
|
|
|
|
(spacemacs|define-text-object "$" "dollarparen" "$(" ")")
|
|
|
|
)
|
|
|
|
(add-hook 'powershell-mode-hook 'powershell/define-text-objects)
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2015-05-31 00:11:55 +00:00
|
|
|
"asp" 'powershell)
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'powershell-mode
|
|
|
|
"rr" 'powershell-regexp-to-regex)
|
2015-05-31 00:11:55 +00:00
|
|
|
|
|
|
|
;; TODO
|
|
|
|
;; - split out powershell
|
|
|
|
;; - get help output with mgg (Get-Help) or Get-Help -online
|
2016-11-21 23:32:00 +00:00
|
|
|
;; -
|
2015-05-31 00:11:55 +00:00
|
|
|
)))
|