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

Re: fortran indentation

Expand Messages
  • rudra
    ... Hi, use fortran code complete. This will solve your problem -- You received this message from the vim_use maillist. Do not top-post! Type your reply
    Message 1 of 8 , Jan 5, 2013
    • 0 Attachment
      On Friday, January 4, 2013 1:22:49 PM UTC, Peng Yu wrote:
      > Hi,
      >
      >
      >
      > I have the following f90 program indented as such in vim.
      >
      >
      >
      > program hello
      >
      > print *, "Hello World!"
      >
      > end program hello
      >
      >
      >
      > However, it might be better to have the code indented like the
      >
      > following (notice the "print" line). Does anybody know if there is a
      >
      > plugin for it in vim? Thanks!
      >
      >
      >
      > program hello
      >
      > print *, "Hello World!"
      >
      > end program hello
      >
      >
      >
      >
      >
      > Regards,
      >
      > Peng

      Hi,
      use fortran code complete.
      This will solve your problem

      --
      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
    • Peng Yu
      ... Hi, I don t understand what you mean by fortran code complete . Would you please help elaborate a little more? Thanks! -- Regards, Peng -- You received
      Message 2 of 8 , Jan 5, 2013
      • 0 Attachment
        > use fortran code complete.
        > This will solve your problem

        Hi,

        I don't understand what you mean by "fortran code complete". Would you
        please help elaborate a little more? Thanks!

        --
        Regards,
        Peng

        --
        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
      • stosss
        ... I think he means a plugin for Vim called fortran code complete . -- You received this message from the vim_use maillist. Do not top-post! Type your
        Message 3 of 8 , Jan 5, 2013
        • 0 Attachment
          On Sat, Jan 5, 2013 at 1:40 PM, Peng Yu <pengyu.ut@...> wrote:
          >> use fortran code complete.
          >> This will solve your problem
          >
          > Hi,
          >
          > I don't understand what you mean by "fortran code complete". Would you
          > please help elaborate a little more? Thanks!
          >

          I think he means a plugin for Vim called "fortran code complete".

          --
          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
        • Joe Gain
          Hi Peng, if you google vim fortran codecomplete you should find a few links, such as: http://www.vim.org/scripts/script.php?script_id=2487 This script
          Message 4 of 8 , Jan 5, 2013
          • 0 Attachment
            Hi Peng, if you google "vim fortran codecomplete" you should find a few links, such as:


            "This script allows you to complete Fortran 90 structures by pressing <F7>. 

            The plugin in written in python, so you need to have your vim compiled with python support in order to use it. 

            The intention is to complete “program”, “type”, “interface”, “module”, “subroutine”, “function”, “do”, and “select” constructs. You write the first line of such a construct (e.g. “subroutine foo(a, b)”, then press <F7>, and the script will add the closing line “end subroutine foo” and put the cursor between the two lines, _indented_ by one level.
            ..."


            On Sat, Jan 5, 2013 at 7:40 PM, Peng Yu <pengyu.ut@...> wrote:
            > use fortran code complete.
            > This will solve your problem

            Hi,

            I don't understand what you mean by "fortran code complete". Would you
            please help elaborate a little more? Thanks!

            --
            Regards,
            Peng

            --
            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



            --
            joe gain

            jacob-burckhardt-str. 16
            78464 konstanz
            germany

            +49 (0)7531 60389

            (...otherwise in ???)

            --
            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
          • Peng Yu
            ... is already taken on my vim. I use the following for indentation. Is there a way to change the shortcut from to --. Also, I disabled my
            Message 5 of 8 , Jan 5, 2013
            • 0 Attachment
              On Sat, Jan 5, 2013 at 12:55 PM, Joe Gain <joe.gain@...> wrote:
              > Hi Peng, if you google "vim fortran codecomplete" you should find a few
              > links, such as:
              >
              > http://www.vim.org/scripts/script.php?script_id=2487
              >
              > "This script allows you to complete Fortran 90 structures by pressing <F7>.
              >
              > The plugin in written in python, so you need to have your vim compiled with
              > python support in order to use it.
              >
              > The intention is to complete “program”, “type”, “interface”, “module”,
              > “subroutine”, “function”, “do”, and “select” constructs. You write the first
              > line of such a construct (e.g. “subroutine foo(a, b)”, then press <F7>, and
              > the script will add the closing line “end subroutine foo” and put the cursor
              > between the two lines, _indented_ by one level.
              > ..."


              <F7> is already taken on my vim. I use the following for indentation.
              Is there a way to change the shortcut from <F7> to --.

              Also, I disabled my <F7> definition in ~/.vimrc, but I don't see <F7>
              can indent the code block. Does <F7> work for you? Thanks!

              187 "full file indent
              188 fun BenIndent()
              189 let oldLine=line('.')
              190 normal gg=G
              191 execute ':' . oldLine
              192 endfun
              193 "map -- :call BenIndent()<Bar>normal zz<CR>
              194 map -- :call BenIndent()<CR>

              --
              Regards,
              Peng

              --
              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
            • rudra
              with code complete completes the blocks. But, if you do not want to complete the block and want to write all, i.e. disabling , still for me, it
              Message 6 of 8 , Jan 5, 2013
              • 0 Attachment
                <F7> with code complete completes the blocks.
                But, if you do not want to complete the block and want to write all, i.e. disabling <F7>, still for me, it indents do-end do etc.
                This is my f90 specific directives in vimrc
                " Fortran stuff
                :let fortran_do_enddo=1
                :let fortran_more_precise=1
                :let fortran_free_source=1
                :let fortran_have_tabs=1
                filetype on
                filetype plugin on
                filetype indent on

                --
                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
              • Peng Yu
                ... program hello print *, Hello World! end program hello indeed can complete a block. But it won t indent the above code like the following. program
                Message 7 of 8 , Jan 5, 2013
                • 0 Attachment
                  On Sat, Jan 5, 2013 at 2:51 PM, rudra <bnrj.rudra@...> wrote:
                  > <F7> with code complete completes the blocks.
                  > But, if you do not want to complete the block and want to write all, i.e. disabling <F7>, still for me, it indents do-end do etc.
                  > This is my f90 specific directives in vimrc
                  > " Fortran stuff
                  > :let fortran_do_enddo=1
                  > :let fortran_more_precise=1
                  > :let fortran_free_source=1
                  > :let fortran_have_tabs=1
                  > filetype on
                  > filetype plugin on
                  > filetype indent on

                  program hello
                  print *, "Hello World!"
                  end program hello

                  <F7> indeed can complete a block. But it won't indent the above code
                  like the following.

                  program hello
                  print *, "Hello World!"
                  end program hello

                  --
                  Regards,
                  Peng

                  --
                  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
                Your message has been successfully submitted and would be delivered to recipients shortly.