On 21/07/09 01:33, Rahul wrote:
>
> Is syntax highlighting and auto indentation handled differently by
> vim? I know that for most languages my files are syntax highlighted as
> well as if I visual select and  press '=' then I can get a nice-
> looking indentation too.
>
> I just started editing a .json file and to start with it had neither
> highlighting nor indentation. I downloaded a suitable syntax file and
> now have syntax highlighting enabled but still cannot get it to indent
> in a smart way.
>
> Any suggestions?
>
> --
> Rahul

Yes, syntax highlighting and indenting are handled by different scripts. 
Syntax scripts are in the syntax/ subfolder of directories in 
'runtimepath', indent scripts are in the indent/ subfolder.

However, you should never change anything in $VIMRUNTIME or under it, 
because any upgrade may silently remove any changes you make there. Here 
are what the 'runtimepath' directory trees are meant for:

        ~/.vim/                 (Unix)
        ~/vimfiles/             (Windows)
user-private full-fledged scripts

        $VIM/vimfiles/          (all platforms)
system-wide scripts not distributed with Vim

        $VIMRUNTIME/            (all platforms)
ONLY what came together with Vim

        $VIM/vimfiles/after/    (all platforms)
system-wide small tweaks to any of the above

        ~/.vim/after/           (Unix)
        ~/vimfiles/after/       (Windows)
user-private small tweaks to any of the above

Most of these don't exist by default; they only need to exist when you 
need to put something in them. They all have the same structure.

Indent scripts are mostly used to set either the 'indentexpr' option or 
the 'cindent' and 'cinoptions' options. They should ALWAYS SET THEM 
BUFFER-LOCALLY using the ":setlocal" command, not the ":set" command 
(which could clobber the settings for other unrelated files). See 
$VIMRUNTIME/indent/*.vim for examples.


Best regards,
Tony.
-- 
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to