Skip to main content

Questions tagged [filetype-sh]

Questions about the sh file type

Filter by
Sorted by
Tagged with
10 votes
3 answers

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. ...
pfnuesel's user avatar
  • 744
6 votes
2 answers

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 ...
stepse's user avatar
  • 201
4 votes
1 answer

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 ...
D. Ben Knoble's user avatar
  • 26.6k
2 votes
1 answer

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 ...
Al.G.'s user avatar
  • 377
2 votes
1 answer

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 ...
Steve Amerige's user avatar
1 vote
0 answers

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;; ...
pfnuesel's user avatar
  • 744
0 votes
0 answers

Don’t start in insert mode when opening a shell script

How can I prevent vi from starting in insert mode when opening a ""-like file with the vi-plugin "bash-support" v4.3 ? When I vim it opens in insert mode When I vim .vimrc it opens in ...
McErroneous's user avatar