File: sh-script.el.html
Major mode for editing shell scripts. Bourne, C and rc shells as well as various derivatives are supported and easily derived from. Structured statements can be inserted with one command or abbrev. Completion is available for filenames, variables known from the script, the shell and the environment as well as commands.
A Flymake backend using the "shellcheck" program is provided. See https://www.shellcheck.net/ for installation instructions.
Defined variables (77)
bash-ts-mode-abbrev-table | Abbrev table for ‘bash-ts-mode’. |
bash-ts-mode-hook | Hook run after entering ‘bash-ts-mode’. |
bash-ts-mode-map | Keymap for ‘bash-ts-mode’. |
sh-alias-alist | Alist for transforming shell names to what they really are. |
sh-ancestor-alist | Alist showing the direct ancestor of various shells. |
sh-assignment-regexp | Regexp for the variable name and what may follow in an assignment. |
sh-backslash-align | If non-nil, ‘sh-backslash-region’ will align backslashes. |
sh-backslash-column | Column in which ‘sh-backslash-region’ inserts backslashes. |
sh-base-mode-abbrev-table | Abbrev table for ‘sh-base-mode’. |
sh-base-mode-hook | Hook run after entering ‘sh-base-mode’. |
sh-base-mode-map | Keymap for ‘sh-base-mode’. |
sh-base-mode-syntax-table | Syntax table for ‘sh-base-mode’. |
sh-basic-offset | The default indentation increment. |
sh-beginning-of-command | Regexp to determine the beginning of a shell command. |
sh-builtins | List of all shell builtins for completing read and fontification. |
sh-debug | Enable lots of debug messages - if function ‘sh-debug’ is enabled. |
sh-dynamic-complete-functions | Functions for doing TAB dynamic completion. |
sh-electric-here-document-mode | Non-nil if Sh-Electric-Here-Document mode is enabled. |
sh-electric-here-document-mode-hook | Hook run after entering or leaving ‘sh-electric-here-document-mode’. |
sh-end-of-command | Regexp to determine the end of a shell command. |
sh-font-lock-keywords-var | Default expressions to highlight in Shell Script modes. See ‘sh-feature’. |
sh-font-lock-keywords-var-1 | Subdued level highlighting for Shell Script modes. |
sh-font-lock-keywords-var-2 | Gaudy level highlighting for Shell Script modes. |
sh-header-marker | When non-nil is the end of header for prepending by M-x sh-execute-region. |
sh-here-document-word | Word to delimit here documents. |
sh-imenu-generic-expression | Alist of regular expressions for recognizing shell function definitions. |
sh-indent-after-case | How much to indent a statement relative to the ‘case’ statement. |
sh-indent-after-continuation | If non-nil, indent relative to the continued line’s beginning. |
sh-indent-after-do | How much to indent a line after a ‘do’ statement. |
sh-indent-after-done | How much to indent a statement after a ‘done’ keyword. |
sh-indent-after-else | How much to indent a statement after an ‘else’ statement. |
sh-indent-after-function | How much to indent after a function line. |
sh-indent-after-if | How much to indent a statement after an ‘if’ statement. |
sh-indent-after-loop-construct | How much to indent a statement after a loop construct. |
sh-indent-after-open | How much to indent after a line with an opening parenthesis or brace. |
sh-indent-after-switch | How much to indent a ‘case’ statement relative to the ‘switch’ statement. |
sh-indent-for-case-alt | How much to indent statements after the case label. |
sh-indent-for-case-label | How much to indent a case label statement. |
sh-indent-for-continuation | How much to indent for a continuation statement. |
sh-indent-for-do | How much to indent a ‘do’ statement. |
sh-indent-for-done | How much to indent a ‘done’ relative to its matching stmt. Usually 0. |
sh-indent-for-fi | How much to indent a ‘fi’ relative to its ‘if’. Usually 0. |
sh-indent-for-then | How much to indent a ‘then’ relative to its ‘if’. |
sh-indent-statement-after-and | How to indent statements following && in Shell-Script mode. |
sh-indent-supported | Indentation rule set to use for each shell type. |
sh-indent-supported-here | Non-nil if we support indentation for the current buffer’s shell type. |
sh-indentation | The default indentation increment. |
sh-kws-for-done | Which keywords can match the word ‘done’ in this shell. |
sh-leading-keywords | List of keywords that may be immediately followed by a builtin or keyword. |
sh-make-vars-local | Controls whether indentation variables are local to the buffer. |
sh-mode--treesit-declaration-commands | Keywords in declaration commands. |
sh-mode--treesit-keywords | Minimal list of keywords that belong to tree-sitter-bash’s grammar. |
sh-mode--treesit-operators | A list of ‘sh-mode’ operators to fontify. |
sh-mode--treesit-settings | Tree-sitter font-lock settings for ‘sh-mode’. |
sh-mode-abbrev-table | Abbrev table for ‘sh-mode’. |
sh-mode-hook | Hook run by ‘sh-mode’. |
sh-mode-map | Keymap used in Shell-Script mode. |
sh-mode-menu | Menu for Shell-Script mode. |
sh-mode-syntax-table | The syntax table to use for Shell-Script mode. |
sh-mode-syntax-table-input | Syntax-table used in Shell-Script mode. See ‘sh-feature’. |
sh-other-keywords | List of keywords not in ‘sh-leading-keywords’. |
sh-regexp-for-done | A buffer-local regexp to match opening keyword for done. |
sh-remember-variable-min | Don’t remember variables less than this length for completing reads. |
sh-set-shell-hook | Hook run by ‘sh-set-shell’. |
sh-shell | The shell being programmed. This is set by M-x sh-set-shell. |
sh-shell-arg | Single argument string for the magic number. See ‘sh-feature’. |
sh-shell-file | The executable file name for the shell being programmed. |
sh-shell-process | The inferior shell process for interaction. |
sh-shell-variables | Alist of shell variable names that should be included in completion. |
sh-shell-variables-initialized | Non-nil if ‘sh-shell-variables’ is initialized. |
sh-shellcheck-arguments | Additional arguments to the shellcheck program. |
sh-shellcheck-program | Name of the shellcheck executable. |
sh-skeleton-pair-default-alist | Value to use for ‘skeleton-pair-default-alist’ in Shell-Script mode. |
sh-styles-alist | A list of all known shell indentation styles. |
sh-test | Initial input in Bourne if, while and until skeletons. See ‘sh-feature’. |
sh-var-list | A list of variables used by script mode to control indentation. |
sh-variables | List of all shell variables available for completing read. |
Defined functions (79)
Defined faces (3)
sh-escaped-newline | Face used for (non-escaped) backslash at end of a line in Shell-script mode. |
sh-heredoc | Face to show a here-document. |
sh-quoted-exec | Face to show quoted execs like `blabla`. |