Add windows-scripts layer for poweshell and dos
This commit is contained in:
parent
f5a200e66a
commit
e2634674a9
7 changed files with 93 additions and 10 deletions
55
contrib/lang/windows-scripts/README.md
Normal file
55
contrib/lang/windows-scripts/README.md
Normal file
|
@ -0,0 +1,55 @@
|
|||
# Windows Scripting contribution layer for Spacemacs
|
||||
|
||||
![logo](ps.png)
|
||||
|
||||
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
|
||||
**Table of Contents**
|
||||
|
||||
- [Windows Scripting contribution layer for Spacemacs](#windows-scripting-contribution-layer-for-spacemacs)
|
||||
- [Description](#description)
|
||||
- [Install](#install)
|
||||
- [Key Bindings](#key-bindings)
|
||||
- [Powershell](#powershell)
|
||||
- [Batch (dos.el)](#batch-dosel)
|
||||
|
||||
<!-- markdown-toc end -->
|
||||
|
||||
## Description
|
||||
|
||||
This simple layer adds support for the Powershell scripting language as well
|
||||
as support for batch files.
|
||||
|
||||
Incuded packages for extensions:
|
||||
- `.ps1`: [powershell][]
|
||||
- `.bat`: [dos.el][]
|
||||
|
||||
## Install
|
||||
|
||||
To use this contribution add it to your `~/.spacemacs`
|
||||
|
||||
```elisp
|
||||
(setq-default dotspacemacs-configuration-layers '(windows-scripts)
|
||||
"List of contribution to load."
|
||||
)
|
||||
```
|
||||
|
||||
## Key Bindings
|
||||
|
||||
### Powershell
|
||||
|
||||
No useful bindings.
|
||||
|
||||
### Batch (dos.el)
|
||||
|
||||
Key Binding | Description
|
||||
----------------------|------------------------------------------------------------
|
||||
<kbd>SPC m D</kbd> | ask for a command and display help
|
||||
<kbd>SPC m e b</kbd> | evaluate buffer
|
||||
<kbd>SPC m e B</kbd> | evaluate buffer with args
|
||||
<kbd>SPC m s</kbd> | insert separator ` & `
|
||||
<kbd>SPC m t</kbd> | mini snippet to start a batch script
|
||||
<kbd>SPC m T</kbd> | big snippet to start a batch script
|
||||
<kbd>SPC m z</kbd> | toggle outline
|
||||
|
||||
[powershell]: https://github.com/jschaf/powershell.el
|
||||
[dos.el]: http://www.emacswiki.org/emacs/dos.el
|
28
contrib/lang/windows-scripts/extensions.el
Normal file
28
contrib/lang/windows-scripts/extensions.el
Normal file
|
@ -0,0 +1,28 @@
|
|||
;; Post extensions are loaded *after* the packages
|
||||
(defvar windows-scripts-post-extensions '(dos))
|
||||
|
||||
;; Initialize the extensions
|
||||
|
||||
(defun windows-scripts/init-dos ()
|
||||
(use-package dos
|
||||
:commands dos-mode
|
||||
:mode ("\\.bat$" . dos-mode)
|
||||
:init
|
||||
(progn
|
||||
(defun windows-scripts/dos-outline-hook ()
|
||||
(local-set-key (kbd "SPC m z") 'dos-mode)
|
||||
(defun outline-mouse-select ()
|
||||
"Select position and return to `dos-mode'."
|
||||
(interactive)
|
||||
(dos-mode)
|
||||
(beginning-of-line)))
|
||||
(add-hook 'outline-mode-hook 'windows-scripts/dos-outline-hook))
|
||||
:config
|
||||
(evil-leader/set-key-for-mode 'dos-mode
|
||||
"mD" 'dos-help-cmd
|
||||
"meb" 'dos-run
|
||||
"meB" 'dos-run-args
|
||||
"ms" 'dos-sep
|
||||
"mt" 'dos-template-mini
|
||||
"mT" 'dos-template
|
||||
"mz" 'dos-outline)))
|
10
contrib/lang/windows-scripts/packages.el
Normal file
10
contrib/lang/windows-scripts/packages.el
Normal file
|
@ -0,0 +1,10 @@
|
|||
(defvar windows-scripts-packages
|
||||
'(
|
||||
powershell
|
||||
)
|
||||
"List of all packages to install and/or initialize. Built-in packages
|
||||
which require an initialization must be listed explicitly in the list.")
|
||||
|
||||
(defun windows-scripts/init-powershell ()
|
||||
(use-package powershell
|
||||
:defer t))
|
BIN
contrib/lang/windows-scripts/ps.png
Normal file
BIN
contrib/lang/windows-scripts/ps.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
|
@ -10,7 +10,6 @@
|
|||
(defvar spacemacs-post-extensions
|
||||
'(
|
||||
centered-cursor
|
||||
dos
|
||||
emoji-cheat-sheet
|
||||
evil-plugins
|
||||
helm-rcirc
|
||||
|
@ -39,10 +38,6 @@
|
|||
evil-mouse-drag-region))))
|
||||
(spacemacs|diminish centered-cursor-mode " Ⓒ"))))
|
||||
|
||||
(defun spacemacs/init-dos ()
|
||||
(use-package dos
|
||||
:mode ("\\.bat$" . dos-mode)))
|
||||
|
||||
(defun spacemacs/init-emoji-cheat-sheet ()
|
||||
(use-package emoji-cheat-sheet
|
||||
:commands emoji-cheat-sheet))
|
||||
|
|
|
@ -91,7 +91,6 @@
|
|||
popup
|
||||
popwin
|
||||
powerline
|
||||
powershell
|
||||
projectile
|
||||
puppet-mode
|
||||
;; not working well for now
|
||||
|
@ -1839,10 +1838,6 @@ determine the state to enable when escaping from the insert state.")
|
|||
(powerline-render rhs))))))
|
||||
)))
|
||||
|
||||
(defun spacemacs/init-powershell ()
|
||||
(use-package powershell
|
||||
:defer t))
|
||||
|
||||
(defun spacemacs/init-projectile ()
|
||||
(use-package projectile
|
||||
:commands (projectile-ack
|
||||
|
|
Reference in a new issue