This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/shell-scripts/README.org

55 lines
2.3 KiB
Org Mode
Raw Normal View History

#+TITLE: Shell Scripts layer
2015-06-10 16:44:30 +00:00
[[file:img/fish.png]]
2018-09-19 03:54:47 +00:00
* Table of Contents :TOC_4_gh:noexport:
2017-05-22 14:16:12 +00:00
- [[#description][Description]]
2017-08-28 21:58:10 +00:00
- [[#features][Features:]]
2017-05-22 14:16:12 +00:00
- [[#install][Install]]
- [[#linting][Linting]]
- [[#style-checking][Style checking]]
- [[#key-bindings][Key bindings]]
2015-06-10 16:44:30 +00:00
* Description
This simple layer adds support for shell scripting.
Supported scripting files:
- =.sh=
2015-06-10 16:44:30 +00:00
- =.fish=: [[https://github.com/fish-shell/fish-shell][fish shell]]
*Note:* For Windows scripting see the layer =windows-scripts=
2015-06-10 16:44:30 +00:00
2017-08-28 21:58:10 +00:00
** Features:
- Auto-completion using [[https://github.com/Alexander-Miller/company-shell][company-shell]]
- =Sh= scripts linting using [[https://www.shellcheck.net/][shellcheck]]
- =Sh= scripts style checking using [[https://github.com/openstack-dev/bashate][bashate]]
2015-06-10 16:44:30 +00:00
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =shell-scripts= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-06-10 16:44:30 +00:00
** Linting
In order to enable =sh= scripts linting, install [[https://www.shellcheck.net/][shellcheck]].
** Style checking
In order to enable =sh= scripts style checking, install [[https://github.com/openstack-dev/bashate][bashate]].
* Key bindings
2015-06-10 16:44:30 +00:00
| Key binding | Description |
2016-01-08 14:37:39 +00:00
|-------------+-----------------------------------------------------------|
| ~SPC m \~ | insert end-of-line backslashes to the lines in the region |
| ~SPC i !~ | insert shebang in a script file |
| ~SPC m i !~ | insert shebang in a script file |
| ~SPC m i c~ | insert switch case statement if supported by shell |
| ~SPC m i i~ | insert if statement if supported by shell |
| ~SPC m i f~ | insert function definition if supported by shell |
| ~SPC m i o~ | insert for loop if supported by shell |
| ~SPC m i e~ | insert an indexed for loop if supported by shell |
| ~SPC m i w~ | insert while loop if supported by shell |
| ~SPC m i r~ | insert repeat loop if supported by shell |
| ~SPC m i s~ | insert select loop if supported by shell |
| ~SPC m i u~ | insert until loop if supported by shell |
| ~SPC m i g~ | insert a getopts while loop if supported by shell |