On 09/11/09 08:54, Rene de Zwart wrote:
>
> I wrote a plugin for assisting in (x)(ht)(x)ml editing.
> However when
>     filetype indent on
> is specified it messes up some actions in my plugin
> e.g.
> \t\t<html>
> becomes
> <html>
> \t\t|
> </html>
> AND I Expect it to become
> \t\t<html>
> \t\t\t
> \t\t<html>
>
> I used filetype indent off in my plugin. Which is global and not localized
> to the buffer. It works but the side effects are to much.
>
> Has someone a solution?
>
> Thanks Rene

To set indentation off on only a few filetypes

Add to your plugin a script containing

        setlocal indentexpr= nocindent nolisp

and copy it to (or source it from) xml.vim, xhtml.vim and html.vim in 
the directory ~/.vim/after/indent/ (on Unix) or ~/vimfiles/after/indent/ 
(on Windows). Of course, if these directories don't exist yet, create them.

Usually only one of the three is significant for any given filetype, but 
putting them all three makes it applicable to any filetype where you 
want to disable filetype-related indenting.

'autoindent' and/or 'smartindent' should probably be handled globally in 
your vimrc anyway.


Best regards,
Tony.
-- 
The government [is] extremely fond of amassing great quantities of
statistics.  These are raised to the nth degree, the cube roots are
extracted, and the results are arranged into elaborate and impressive
displays.  What must be kept ever in mind, however, is that in every
case, the figures are first put down by a village watchman, and he puts
down anything he damn well pleases.
                -- Sir Josiah Stamp

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

Reply via email to