I have the following in my .vimrc on both machines:

filetype plugin indent on
syntax on

And yet, for some reason I only see the expected behavior on my Mac, and not on the other computer (which is a Windows 7 box running MobaXterm).

The auto-unindenting after I type } is really quite nice, and I'd like it to work in both places.

Is this an issue with a missing "filetype plugin?" I can't find any directory where "filetype plugins" are stored and I never installed any myself; how does that work, anyway?

The language I was using at the time I noticed the discrepancy was awk, and Vim chose the correct syntax highlighting on both machines (based on the .awk file extension), but failed to handle the autoindent the way I expected on Windows.

I have installed no plugins at all on either machine. The .vimrc is practically empty in each case. MobaXterm has Vim 7.3.646; the Mac just says 7.3.

  • 4
    Are you running the same .vimrc on both machines? Are both machines running the same version of Vim? Do you have the same plugins on both machines?
    – moopet
    Jan 26 '16 at 16:59
  • 2
    See vi.stackexchange.com/a/6145/205 - perhaps it will help you understand what's going on.
    – muru
    Jan 26 '16 at 18:12
  • 1
    @muru, that does seem relevant—the Mac has a file awk.vim in /usr/share/vim/vim73/indent and the MobaXterm seems to have no such file (and a lot fewer syntax files in general). But how can I fix this? (I've never installed any plugins at all, just using Vim "out of the box".)
    – Wildcard
    Jan 26 '16 at 18:19
  • 2
    Files in $VIMRUNTIME (/usr/share/vim/vim73 in the Mac) aren't plugins in the usual sense, they come with Vim, depending on compilation flags, I think. I have never used MobaXterm, but it seems to have GVim available (it's listed in mobaxterm.mobatek.net/plugins.html) - maybe try that. Or you can just create ~/.vim/indent/awk.vim containing setlocal autoindent.
    – muru
    Jan 26 '16 at 18:36

Your Answer

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

Browse other questions tagged or ask your own question.