IDE / Emacs mode for Shell scripting in Bash/Sh, etc

15,443

Solution 1

Well, there's a built-in shell mode that does syntax highlighting, if it's not already turned on, M-x shell-script-mode will do it for you.

Regarding a tool to make scripting easier. There's a bash shell debugger, so if you program in bash, that would help quite a bit.

Of course there's eshell, a shell written in Emacs lisp, so you can get all the syntax highlighting you'd expect from lisp, the auto-completion, and the emacs lisp debugger.

Solution 2

I know it is old post, but i will like to share my settings.

I had the same issue and now I use the code below in my .emacs file for sh/bash code autocompletion.

(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)

The syntax highlighting should already work if you use a recent version of Emacs.

Solution 3

Another IDE for the VIM world:

Plugin bash-support.vim

screen shots

Help file on-line

Solution 4

I don't think there is any mode for code completion for shell-scripts, at least not in Emacs. (I've actually never felt the need.) However, there is support in bash for completion when running interactively (the package is called "bash-completion", or something similar). This provides tab-completion for many shell-commands.

Share:
15,443
Joe Meyer
Author by

Joe Meyer

Programmer. My personal website: http://fernandobriano.com

Updated on June 06, 2022

Comments

  • Joe Meyer
    Joe Meyer almost 2 years

    I use Emacs for shell scripts. I know I read somewhere there's some mode to make it easier (code completion, autocomplete, bracket matching, syntax highligting, check syntax) to write Shell scripts on Emacs but haven't been able to find it. In short, I would like to turn Emacs into a Bash IDE.

    Also, is there any other tool/IDE to make scripting easier on the GNU/Linux Shell?

  • 4ae1e1
    4ae1e1 almost 10 years
    This comment is late, but in Emacs, auto-complete-mode (a minor mode) can be used in addition to sh-mode (the major mode for shell scripting) to provide auto-completion in shell scripts.
  • vfalcao
    vfalcao over 4 years
    This kind of answer always sounds strange to me. "How do I accomplish A using tool B?" --- "it's easy, don't use your intended tool B, use this other one C instead". It really doesn't answer the original question at all.
  • Alex Ding
    Alex Ding over 4 years
    Also, is there any other tool/IDE to make scripting easier on the GNU/Linux Shell? Did you read the question? I think I provided a better solution!
  • vfalcao
    vfalcao over 4 years
    I stand corrected. The original question said "Also, is there any other tool/IDE to make scripting easier on the GNU/Linux Shell?". I sort of vented my frustration about all the answers that don't respond the original question, and sidestep suggesting a new approach.... sorry for that.