1

I have multiple indent rules for same file type. I'd like to try them separately. How do I see which one is active? :set filetype is correct.

I did manage to change the rules by disabling all other indent files manually, but there probably is a better way?

In this case I have >5 different Javascript indent versions I'd like to test. (Mac default, Pangloss, web-indent, etc.)

  • Can you provide an example of one or more of your indent rules? It's not clear what you are sking. – ap0 Oct 22 '15 at 14:59
  • Better? Rule being a indent file that (to my understanding) does the formatting when you indent lines. – mkpaa Oct 22 '15 at 19:45
1

Most indent files will either:

  • set indentexpr and indentkeys;
  • set cindent and cinoptions.

You can check the values by appending a question mark, and you can see where an option was set by prefixing it with :verbose. For example for JS:

:verbose set cindent?
  cindent
        Last set from /usr/share/vim/vim74/indent/javascript.vim
:verbose set indentexpr?
  indentexpr=

Or for Python:

:verbose set cindent? 
  nocindent
:verbose set indent
  indentexpr=GetPythonIndent(v:lnum)
        Last set from /usr/share/vim/vim74/indent/python.vim
  • :verbose answered my question! – mkpaa Mar 3 '16 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.