Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown function HTMLIndent #94

Open
anandghegde opened this issue Feb 15, 2018 · 12 comments
Open

Unknown function HTMLIndent #94

anandghegde opened this issue Feb 15, 2018 · 12 comments

Comments

@anandghegde
Copy link

anandghegde commented Feb 15, 2018

I get this error when I try to edit a visualforce page

Error detected while processing /Users/ahegde/.yadr/vim/bundle/vim-force.com/indent/visualforce.vim:

E700: Unknown function: HtmlIndent

I have overridden my system vim with homebrew vim

This is the output of vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 14 2018 08:39:53) macOS version Included patches: 1-1500 Compiled by Homebrew Huge version without GUI. Features included (+) or not (-): +acl +farsi +mouse_sgr -tag_any_white +arabic +file_in_path -mouse_sysmouse -tcl +autocmd +find_in_path +mouse_urxvt +termguicolors -autoservername +float +mouse_xterm +terminal -balloon_eval +folding +multi_byte +terminfo +balloon_eval_term -footer +multi_lang +termresponse -browse +fork() -mzscheme +textobjects ++builtin_terms -gettext +netbeans_intg +timers +byte_offset -hangul_input +num64 +title +channel +iconv +packages -toolbar +cindent +insert_expand +path_extra +user_commands -clientserver +job +perl +vertsplit +clipboard +jumplist +persistent_undo +virtualedit +cmdline_compl +keymap +postscript +visual +cmdline_hist +lambda +printer +visualextra +cmdline_info +langmap +profile +viminfo +comments +libcall +python +vreplace +conceal +linebreak -python3 +wildignore +cryptv +lispindent +quickfix +wildmenu +cscope +listcmds +reltime +windows +cursorbind +localmap +rightleft +writebackup +cursorshape +lua +ruby -X11 +dialog_con +menu +scrollbind -xfontset +diff +mksession +signs -xim +digraphs +modify_fname +smartindent -xpm -dnd +mouse +startuptime -xsmp -ebcdic -mouseshape +statusline -xterm_clipboard +emacs_tags +mouse_dec -sun_workshop -xterm_save +eval -mouse_gpm +syntax +ex_extra -mouse_jsbterm +tag_binary +extra_search +mouse_netterm +tag_old_static 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 -DMACOS_X_DARWIN -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 AppKit -L/usr/local/lib -llua -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.26.1/lib/perl5/5.26.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/opt/python/Frameworks -framework Python -lruby.2.5.0 -lobjc

I have edited my ~/.zshrc to set the vim runtime to the homebrew version -

`$ echo $VIMRUNTIME

/usr/local/Cellar/vim/8.0.1500/share/vim/vim80/`

@neowit
Copy link
Owner

neowit commented Feb 15, 2018

Hello @anandghegde

Looks like something is not quite right with your vim installation or maybe zsh somehow uses runtime from built-in OSX vim.
HtmlIndent is a function in runtime/indent/html.vim file. This file is a part of standard vim distribution. So when vim is installed correctly calls to HtmlIndent should work out of the box.

@anandghegde
Copy link
Author

Anyway to set the runtime in one of the ~/.zshrc file? My homebrew vim is installed at /usr/local/Cellar/vim/8.0.1500/share/vim/vim80/

@neowit
Copy link
Owner

neowit commented Feb 16, 2018

Not a zsh user here, so I am not sure. You may have to "google" for a bit.

brew install vim -with-override-system-vim
or
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile && source ~/.bash_profile
usually do the trick for me when using bash.

@anandghegde
Copy link
Author

yes, I reinstalled vim with the --with-override-system-vi flag. Still getting the same error. My /usr/local/bin is ahead in the $PATH, so it is using the latest vim from the homebrew installation.

I want to understand this line -
runtime indent/html.vim

Which env. variable is it looking for? Is it $VIMRUNTIME? Do I need to set this in .zshrc or in vundle?

@neowit
Copy link
Owner

neowit commented Feb 16, 2018

see answers here: https://github.com/vim/vim/blob/master/runtime/doc/repeat.txt#L193
and here: https://github.com/vim/vim/blob/master/runtime/doc/options.txt#L6356

indent/html.vim by default resides in $VIMRUNTIME/indent/html.vim

check what your :echo $VIMRUNTIME returns when you run it from vim.

@anandghegde
Copy link
Author

:echo $VIMRUNTIME from inside vim gives me /usr/local/share/vim/vim80 and I see an indent/html.vim file in there.

@neowit
Copy link
Owner

neowit commented Feb 16, 2018

usually :echo $VIMRUNTIME ends with something like ...some path/runtime. Yours does not end with .../runtime for some reason.

for instance, here is the output of my config (I use MacVim not console vim)

/usr/local/Cellar/macvim/8.0-142/MacVim.app/Contents/Resources/vim/runtime

what happens if you run (inside vim)
:source $VIMRUNTIME/indent/html.vim

does it return any error?

If it does not then does this (inside vim) work?
:call HtmlIndent()

@anandghegde
Copy link
Author

:source $VIMRUNTIME/indent/html.vim doesnt return any error

:call HtmlIndent() returns unknown function.

@neowit
Copy link
Owner

neowit commented Feb 16, 2018

if you do :edit $VIMRUNTIME/indent/html.vim in vim what does the file header look like?
does it say

Last Change: 2017 Jun 13

the file must look exactly the same as this one.

@anandghegde
Copy link
Author

Yes, it looks exactly like that.

@neowit
Copy link
Owner

neowit commented Feb 16, 2018

in this case the issue may be either
A. you do not have filetype indent on in your .vimrc
what does :filetype return? it should return something like

filetype detection:ON plugin:ON indent:ON

OR
B. your vim config and/or other plugins you use somehow disable standard indent/html.vim.
html.vim makes various checks at the beginning of the file and depending on the current config may or may not proceed with full initialisation.

@anandghegde
Copy link
Author

Thanks a lot for the help in debugging this. It turned out to be because of the vim-polyglot plugin that comes bundled with YADR . I removed that plugin and it seems to be working fine.

neowit added a commit that referenced this issue Apr 16, 2018
…dent

Those may have been disabled by another plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants