Loading ...
Sorry, an error occurred while loading the content.

HTML auto indentation not working in vim

Expand Messages
  • Arup Rakshit
    Hi, I am using vim in my recent started Ruby project. I found auto-indentation is not working when I am writing any .rhtml/.html file. My ~/.vimrc file -
    Message 1 of 6 , Mar 16, 2014
    • 0 Attachment
      Hi,

      I am using vim in my recent started Ruby project. I found auto-indentation is not working when I am writing any .rhtml/.html file.

      My ~/.vimrc file -

      =================================
      set nocompatible " We're running Vim, not Vi!
      syntax on " Enable syntax highlighting
      filetype on " Enable filetype detection
      filetype indent on " Enable filetype-specific indenting
      filetype plugin on " Enable filetype-specific plugins
      colorscheme zellner

      set number
      set expandtab
      set tabstop=2 shiftwidth=2 softtabstop=2
      set autoindent

      autocmd FileType ruby nmap <F5> :!ruby %<cr>

      " Autoclose pipe in Ruby
      autocmd FileType ruby let b:AutoClosePairs = AutoClose#DefaultPairsModified("|", "")

      set rtp+=~/.vim/bundle/vundle/
      call vundle#rc()

      " let Vundle manage Vundle
      " required!

      set shell=/bin/bash\ -i

      Bundle 't9md/vim-ruby-xmpfilter'
      Bundle 'Townk/vim-autoclose'
      Bundle 'vim-ruby/vim-ruby'
      Bundle 'gmarik/vundle'
      Bundle 'scrooloose/nerdtree'
      Bundle 'tpope/vim-endwise'
      Bundle 'tpope/vim-rvm'
      Bundle 'vim-scripts/Conque-Shell'
      Bundle 'hdima/python-syntax'


      autocmd FileType ruby nmap <buffer> <M-c> <Plug>(xmpfilter-mark)
      autocmd FileType ruby xmap <buffer> <M-c> <Plug>(xmpfilter-mark)
      autocmd FileType ruby imap <buffer> <M-c> <Plug>(xmpfilter-mark)

      autocmd FileType ruby nmap <buffer> <M-z> <Plug>(xmpfilter-run)
      autocmd FileType ruby xmap <buffer> <M-z> <Plug>(xmpfilter-run)
      autocmd FileType ruby imap <buffer> <M-z> <Plug>(xmpfilter-run)
      ============================================================

      How to set html auto indentation?

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Christian Brabandt
      ... [...] ... What do you mean by auto indentation? Best, Christian -- Man könnte in einer besonderen Wissenschaft die niedrigeren Stufen so wohl als die
      Message 2 of 6 , Mar 19, 2014
      • 0 Attachment
        On So, 16 Mär 2014, Arup Rakshit wrote:

        > Hi,
        >
        > I am using vim in my recent started Ruby project. I found auto-indentation is not working when I am writing any .rhtml/.html file.
        >
        > My ~/.vimrc file -
        [...]
        > How to set html auto indentation?

        What do you mean by auto indentation?

        Best,
        Christian
        --
        Man könnte in einer besonderen Wissenschaft die niedrigeren Stufen so
        wohl als die höheren der Dinge betrachten, wie sie jetzo sind, und das
        Größte und kleinste darinnen bestimmen.
        -- Georg Christoph Lichtenberg

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Arup Rakshit
        ... I mean, when I am writing the below is coming for e.g. : instead of -- -- You received this
        Message 3 of 6 , Mar 19, 2014
        • 0 Attachment
          > What do you mean by auto indentation?
          >
          >
          >
          > Best,
          >

          I mean, when I am writing the below is coming for e.g. :

          <html>
          <head> </head>
          </html>

          instead of

          <html>
          <head> </head>
          </html>

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Christian Brabandt
          ... That is, because by default the html indent script does not indent any of those tags. You might want to customize what will be indented by Vim. To do so, I
          Message 4 of 6 , Mar 20, 2014
          • 0 Attachment
            Am 2014-03-20 07:41, schrieb Arup Rakshit:
            > I mean, when I am writing the below is coming for e.g. :
            >
            > <html>
            > <head> </head>
            > </html>
            >
            > instead of
            >
            > <html>
            > <head> </head>
            > </html>

            That is, because by default the html indent script does not indent any
            of those tags.
            You might want to customize what will be indented by Vim. To do so, I
            suggest you read
            :h html-indent

            There you'll see how you can let Vim indent the <html> and <head> tags.

            Best,
            Christian

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • Arup Rakshit
            ... Thanks you, I definitely look into the same. -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text
            Message 5 of 6 , Mar 20, 2014
            • 0 Attachment
              > That is, because by default the html indent script does not indent any
              >
              > of those tags.
              >
              > You might want to customize what will be indented by Vim. To do so, I
              >
              > suggest you read
              >
              > :h html-indent
              >
              >
              >
              > There you'll see how you can let Vim indent the <html> and <head> tags.

              Thanks you, I definitely look into the same.

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Arup Rakshit
              Thanks! It worked. -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more
              Message 6 of 6 , Mar 21, 2014
              • 0 Attachment
                Thanks! It worked.

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              Your message has been successfully submitted and would be delivered to recipients shortly.