Questions tagged [sh-mode]

Major mode for editing shell scripts.

Filter by
Sorted by
Tagged with
3
votes
1answer
116 views

sh-mode: Scan error: “Containing expression ends prematurely”,

Generate a file with this: (echo '#!/bin/bash' echo 'myfunc() {' echo "cat <<'z'" seq 135 echo zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz echo z echo '}') >out Open it in Emacs. When ...
2
votes
1answer
95 views

How to automatically select *interpretation* buffer window

When I am writing a shell script in sh-mode and decide to run it, I hit C-cC-x (executable-interpret). An *interpretation* buffer is displayed, showing the script's output. Is there a robust way to ...
3
votes
0answers
36 views

Highlight variables without $ inside (( )) when in sh-mode?

Is there a way to modify sh-mode to highlight variables inside a double parentheses construct when not using the dollar sign prefix? For example I want the i to be highlighted in ((i++)) without the ...
2
votes
1answer
123 views

zsh expansion modifiers are treated as comments

zsh has a ton of syntax. In particular, the # character serves a bunch of different roles. Here are two that are problematic: Prefix globbing flags (#b)(*).c This finds all files that end in .c and ...
1
vote
1answer
131 views

How to make a file variable buffer local?

I have customized the variable sh-indentation with 4, but in one file I would like to use a different value. So I defined a file variable: # -*- mode: sh; sh-indentation: 2; -*- But the result is ...