Bash – How to disable emacs here document completion

autocompletebashemacs

When editing a bash script file with emacs, and trying to enter <<<, at the second < emacs insert a template for a here document, like in the following example:

<<EOF

EOF

This is not the desired output, because I would enter a literal <<<.

For the moment I resort to entering < < <, and then deleting spaces, but I prefer to being allowed to enter it directly.

Best Answer

There is actually no need for Tom 's custom my-disable-here-document function rebinding the keys. This feature can be enabled and disabled with sh-electric-here-document-mode:

(add-hook 'sh-mode-hook
          (lambda ()
            (sh-electric-here-document-mode -1)))

(It can also be toggled for the active buffer via M-x sh-electric-here-document-mode.)