Whenever I open my ~/.bash_profile on my Mac, I start getting these lines:

"~/.bash_profile" 534L, 20509C
Error detected while processing /Users/abdullah/.vim/syntax/sh.vim:
line  242:
E402: Garbage after pattern: "\<done\>"contains=@shLoopList
E475: Invalid argument: shDo   transparent     matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>"contains=@shLoopList
line  569:
E394: Didn't find region item for shDo
E475: Invalid argument: shDoSync grouphere       shDo    "\<do\>"
line  570:
E394: Didn't find region item for shDo
E475: Invalid argument: shDoSync groupthere      shDo    "\<done\>"
line  725:
E488: Trailing characters: #In my bash files I don't like wrapping

I just copied and pasted the contents of of that sh.vim file verbatim from here.

What should I do to suppress or fix those warnings?

This is my vim version (from vi --version):

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 14 2017 18:28:18)
MacOS X (unix) version
Included patches: 1-1100
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminal
++builtin_terms  +fork()          +multi_lang      +terminfo
+byte_offset     -gettext         -mzscheme        +termresponse
+channel         -hangul_input    +netbeans_intg   +textobjects
+cindent         +iconv           +num64           +timers
-clientserver    +insert_expand   +packages        +title
+clipboard       +job             +path_extra      -toolbar
+cmdline_compl   +jumplist        +perl            +user_commands
+cmdline_hist    +keymap          +persistent_undo +vertsplit
+cmdline_info    +lambda          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      +startuptime     -xpm
+eval            +mouse_dec       +statusline      -xsmp
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_clipboard
+extra_search    -mouse_jsbterm   +syntax          -xterm_save
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework Cocoa   -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.26.0/lib/perl5/5.26.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/opt/python/Frameworks -framework Python   -lruby.2.4.2 -lobjc
  • vim comes by default with an syntax file for sh. You probably want to simply delete the file /Users/abdullah/.vim/syntax/sh.vim – Naumann Dec 9 '17 at 12:50
  • @abbood in order to get help, you should add your vim version. Also it seems like you did change the file: the string #In my bash files I don't like wrapping does not exist in the original file on line 725. Could you run a diff between ~/.vim/syntax/sh.vim and the syntax file from github. Compare also to the one shipped with your vim (e.g. open $ vim ~/.vim/syntax/sh.vim and enter :vert diff $VIMRUNTIME/syntax/sh.vim). – Hotschke Dec 9 '17 at 13:59
  • @Hotschke updated answer with my vi version – abbood Dec 9 '17 at 15:39
  • @Hotschke running your command i get E488: Trailing characters – abbood Dec 9 '17 at 15:41
  • @Naumann deleting the file did it for me.. tx! – abbood Dec 9 '17 at 15:42

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.