Questions tagged [filetype-sh]
Questions about the sh file type
7
questions
9
votes
2
answers
1k
views
Syntax highlighting for shell scripts broken
Since recently my syntax highlighting for ft=sh (also syn=sh is set) is broken:
Why is that? How can I fix it?
Edit:
I'm using Vim 9.0 with patches 1-1302.
I add here the code from the screenshot. ...
0
votes
0
answers
119
views
Don’t start in insert mode when opening a shell script
How can I prevent vi from starting in insert mode when opening a "test.sh"-like file with the vi-plugin "bash-support" v4.3 ?
When I vim test.sh it opens in insert mode
When I vim .vimrc it opens in ...
6
votes
2
answers
1k
views
Highlighting another syntax in a shell heredoc
I edited my original question and title to broaden its scope to any syntax - with SQL used as just an example. You can adapt the examples and the answer to other languages.
By adding suitable ...
4
votes
1
answer
370
views
Modify `iskeyword` for keyword-local completion only
Context
Some time ago, I added the following line to ~/.vim/after/ftplugin/sh.vim to make working with parameter expansions easier:
setlocal iskeyword+=$
This is nice to be able to e.g. ysiw" via ...
1
vote
0
answers
145
views
indentation different on different computers
If I indent the following script with gg=G:
#!/usr/bin/env bash
while true; do
case "${1}" in
-h) usage; exit 0;;
-b) branch="${2}"; shift 2;;
-t) build="${2}"; shift 2;;
...
2
votes
1
answer
514
views
Vim highlights valid shell parameter expansion syntax as an error
#!/bin/bash
echo ${2:-"-l -p"}
Having some bash parameter-substitution fun and (Neo) Vim complains about it, while the code is perfectly fine.
I know I can suppress errors totally by doing sort of ...
2
votes
1
answer
128
views
Modify sh.vim to accept (@)_ as part of a variable name for Bash highlighting
I have Bash file in which I have constructs that include (@)_ as part of the variable name. For example:
(@)_VariableName
${(@)_VariableName[@]}
${#(@)_VariableName[@]}
${!(@)_VariableName[@]}
The ...