diff options
-rwxr-xr-x | build | 47 | ||||
-rw-r--r-- | indent/julia.vim | 2 | ||||
-rw-r--r-- | syntax/vifm.vim | 13 |
3 files changed, 37 insertions, 25 deletions
@@ -3,41 +3,44 @@ set -E DIRS="syntax indent compiler autoload ftplugin after/syntax after/indent after/ftplugin" +# shellcheck disable=SC2034 DIRS_BASIC="syntax compiler indent after/syntax after/indent" +# shellcheck disable=SC2034 DIRS_ALL="syntax indent compiler autoload ftplugin after" +# shellcheck disable=SC2034 DIRS_SYNTAX="syntax indent after/syntax after/indent" DIRS_JAVASCRIPT="${DIRS} extras" -DIRS_RM="$DIRS_JAVASCRIPT" +read -r -a DIRS_RM <<<"$DIRS_JAVASCRIPT" OUTPUT="" output() { OUTPUT="$OUTPUT$1" - printf -- "$1" + echo -n "$1" } download() { for pack in $1; do - path="$(printf "$pack" | cut -d ':' -f 2)" - dir="tmp/$(printf "$path" | cut -d '/' -f 2)" + path="$(cut -d ':' -f 2 <<<"$pack")" + dir="tmp/$(cut -d '/' -f 2 <<<"$path")" rm -rf "$dir" - (mkdir -p "$dir" && curl --silent -L https://codeload.github.com/$path/tar.gz/master | tar -zx -C "$dir" --strip 1 && printf '.') & + (mkdir -p "$dir" && curl --silent -L "https://codeload.github.com/$path/tar.gz/master" | tar -zx -C "$dir" --strip 1 && printf '.') & done wait } extract() { - printf "\n" + echo cat config.vim >> tmp/polyglot.vim for pack in $1; do - name="$(printf "$pack" | cut -d ':' -f 1)" - path="$(printf "$pack" | cut -d ':' -f 2)" - dir="tmp/$(printf "$path" | cut -d '/' -f 2)" - directories="DIRS$(printf "$pack" | cut -d ':' -f 3)" - subtree="$(printf "$pack" | cut -d ':' -f 4)" + name="$(cut -d ':' -f 1 <<<"$pack")" + path="$(cut -d ':' -f 2 <<<"$pack")" + dir="tmp/$(cut -d '/' -f 2 <<<"$path")" + directories="DIRS$(cut -d ':' -f 3 <<<"$pack")" + subtree="$(cut -d ':' -f 4 <<<"$pack")" output "- [$name](https://github.com/$path) (" subdirs="" @@ -58,10 +61,10 @@ extract() { copy_file "${dir}${subtree}" "${dir}${subtree}/autoload/go/config.vim" "${name}" fi - output "${subdirs##, })\n" + output "${subdirs##, })"$'\n' - if (echo "julia coffee-script elixir fish git plantuml scala swift" | fgrep -q "$name"); then - echo "Skipping ftdetect installation of $name" + if (echo "julia coffee-script elixir fish git plantuml scala swift" | grep -qF "$name"); then + echo "Skipping ftdetect installation of $name" >&2 continue fi @@ -82,19 +85,19 @@ EOF mv tmp/polyglot.vim ftdetect/ for pack in $1; do - name="$(printf "$pack" | cut -d ':' -f 1)" - path="$(printf "$pack" | cut -d ':' -f 2)" - dir="tmp/$(printf "$path" | cut -d '/' -f 2)" - subtree="$(printf "$pack" | cut -d ':' -f 4)" + name="$(cut -d ':' -f 1 <<<"$pack")" + path="$(cut -d ':' -f 2 <<<"$pack")" + dir="tmp/$(cut -d '/' -f 2 <<<"$path")" + subtree="$(cut -d ':' -f 4 <<<"$pack")" if [ -d "$dir${subtree:-/}plugin" ]; then - printf "Possible error (plugin directory exists): $path\n" + echo "Possible error (plugin directory exists): $path" >&2 fi done } copy_dir() { - for file in $(find "$1/$2" -name '*.vim' -o -name '*.vital'); do + find "$1/$2" \( -name '*.vim' -o -name '*.vital' \) -print0 | while read -r -d $'\0' file; do copy_file "$1" "$file" "$3" done } @@ -129,7 +132,7 @@ update_readme() { +2kb /## 'b,-2c -$(printf -- "$OUTPUT" | sort) +$(echo -n "$OUTPUT" | sort) . w q @@ -253,7 +256,7 @@ PACKS=" " rm -rf tmp -rm -rf $DIRS_RM +rm -rf "${DIRS_RM[@]}" mkdir tmp printf "Downloading packs..." diff --git a/indent/julia.vim b/indent/julia.vim index 88e90e57..6382ec2e 100644 --- a/indent/julia.vim +++ b/indent/julia.vim @@ -21,7 +21,7 @@ if exists("*GetJuliaIndent") finish endif -let s:skipPatterns = '\<julia\%(Comprehension\%(For\|If\)\|RangeEnd\|CommentL\|\%([bsv]\|ip\|big\|MIME\|Shell\|Printf\|Doc\)\=String\|RegEx\|SymbolS\?\)\>' +let s:skipPatterns = '\<julia\%(Comprehension\%(For\|If\)\|RangeEnd\|Comment[LM]\|\%([bsv]\|ip\|big\|MIME\|Shell\|Printf\|Doc\)\=String\|RegEx\|SymbolS\?\)\>' function JuliaMatch(lnum, str, regex, st, ...) let s = a:st diff --git a/syntax/vifm.vim b/syntax/vifm.vim index 9eae9a92..8843d1ac 100644 --- a/syntax/vifm.vim +++ b/syntax/vifm.vim @@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1 " vifm syntax file " Maintainer: xaizek <xaizek@posteo.net> -" Last Change: April 18, 2018 +" Last Change: April 30, 2018 " Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr. if exists('b:current_syntax') @@ -176,7 +176,7 @@ syntax region vifmStatementC start='\(\s\|:\)*' \,vifmComment,vifmInlineComment,vifmNotComment,vifmExprCommandSt,vifmNormalCommandSt \,vifmCdCommandSt,vifmSet,vifmArgument,vifmSoCommand,vifmSoCommandSt \,vifmInvertCommand,vifmInvertCommandSt,vifmPrefixCommands - \,vifmAutocmdCommand,vifmAutoEvent,vifmPatternCommands + \,vifmAutocmdCommand,vifmAutoEvent,vifmPatternCommands,vifmLetC,vifmUnletC syntax region vifmCmdCommandSt start='^\(\s\|:\)*com\%[mand]\>' \ skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' keepend \ contains=vifmCmdCommand,vifmComment,vifmInlineComment,vifmNotComment @@ -353,10 +353,19 @@ syntax region vifmLet \ keepend \ contains=vifmLetCommand,vifmEnvVar,vifmString,vifmStringInExpr,vifmComment \,vifmInlineComment,vifmNotComment +syntax region vifmLetC + \ start='\<let\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$\||' + \ keepend + \ contains=vifmLetCommand,vifmEnvVar,vifmString,vifmStringInExpr,vifmComment + \,vifmInlineComment,vifmNotComment,vifmBuiltinFunction syntax region vifmUnlet \ start='^\(\s\|:\)*\<unl\%[et]\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$' \ keepend \ contains=vifmUnletCommand,vifmEnvVar,vifmComment,vifmInlineComment,vifmNotComment +syntax region vifmUnletC + \ start='\<unl\%[et]\>' skip='\(\n\s*\\\)\|\(\n\s*".*$\)' end='$\||' + \ keepend + \ contains=vifmUnletCommand,vifmEnvVar,vifmComment,vifmInlineComment,vifmNotComment syntax region vifmString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ syntax region vifmString contained start=+='+hs=s+1 skip=+\\\\\|\\'+ end=+'+ syntax region vifmStringInExpr contained start=+=\@<="+hs=s+1 skip=+\\\\\|\\"+ |