Variable: bash-ts-mode-hook

bash-ts-mode-hook is a variable defined in sh-script.el.gz.

Value

nil

Documentation

Hook run after entering Bash mode.

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/sh-script.el.gz
;;;###autoload
(define-derived-mode bash-ts-mode sh-base-mode "Bash"
  "Major mode for editing Bash shell scripts.
This mode automatically falls back to `sh-mode' if the buffer is
not written in Bash or sh."
  :syntax-table sh-mode-syntax-table
  (when (treesit-ready-p 'bash)
    (sh-set-shell "bash" nil nil)
    (add-hook 'flymake-diagnostic-functions #'sh-shellcheck-flymake nil t)
    (add-hook 'hack-local-variables-hook
              #'sh-after-hack-local-variables nil t)
    (treesit-parser-create 'bash)
    (setq-local treesit-font-lock-feature-list
                '(( comment function)
                  ( command declaration-command keyword string)
                  ( builtin-variable constant heredoc number
                    string-interpolation variable)
                  ( bracket delimiter misc-punctuation operator)))
    (setq-local treesit-font-lock-settings
                sh-mode--treesit-settings)
    (setq-local treesit-defun-type-regexp "function_definition")
    (treesit-major-mode-setup)))