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

Line break while modifying an existed file

Expand Messages
  • wenjia
    Hi, I set textwidth=75, so that when I write a file for the first time, line breaks automatically when it is full. However, when I MODIFY a file by inserting
    Message 1 of 3 , Oct 12, 2009
    • 0 Attachment
      Hi,

      I set textwidth=75, so that when I write a file for the first time,
      line breaks automatically when it is full.

      However, when I MODIFY a file by inserting words in a line, it never
      breaks even though the length is over 75. (On the screen the cursor
      moves to the "next line on scree", but as in a file the cursor is
      still in the original line). How to make the lines break automatically
      even when I am modifying the file?

      Thanks a lot.

      Best,
      Wenjia
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Niklas Lindström
      Hi! On Tue, Oct 13, 2009 at 5:57 AM, wenjia wrote: [...] ... You need to set formatoptions to your wishes. Something like: set
      Message 2 of 3 , Oct 13, 2009
      • 0 Attachment
        Hi!

        On Tue, Oct 13, 2009 at 5:57 AM, wenjia <wenjia.2136@...> wrote:
        [...]
        > However, when I MODIFY a file by inserting words in a line, it never
        > breaks even though the length is over 75. (On the screen the cursor
        > moves to the "next line on scree", but as in a file the cursor is
        > still in the original line). How to make the lines break automatically
        > even when I am modifying the file?

        You need to set 'formatoptions' to your wishes. Something like:

        set formatoptions=tcqwan2

        may do the trick for you. See:

        :help 'formatoptions'
        :help fo-table

        Best regards,
        Niklas

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • wenjia
        Thanks a lot, Niklas! Best regards, Wenjia ... --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_mac maillist. For
        Message 3 of 3 , Oct 13, 2009
        • 0 Attachment
          Thanks a lot, Niklas!

          Best regards,
          Wenjia
          On Oct 13, 5:58 am, Niklas Lindström <lindstr...@...> wrote:
          > Hi!
          >
          > On Tue, Oct 13, 2009 at 5:57 AM, wenjia <wenjia.2...@...> wrote:
          >
          > [...]
          >
          > > However, when I MODIFY a file by inserting words in a line, it never
          > > breaks even though the length is over 75. (On the screen the cursor
          > > moves to the "next line on scree", but as in a file the cursor is
          > > still in the original line). How to make the lines break automatically
          > > even when I am modifying the file?
          >
          > You need to set 'formatoptions' to your wishes. Something like:
          >
          >     set formatoptions=tcqwan2
          >
          > may do the trick for you. See:
          >
          >     :help 'formatoptions'
          >     :help fo-table
          >
          > Best regards,
          > Niklas
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        Your message has been successfully submitted and would be delivered to recipients shortly.