Vim이 내 코드를 래핑하는 것을 막을 수없는 이유는 무엇입니까? 들어가면 그래도

vim이 Python 코드를 래핑하는 것을 막을 수 없습니다. 내가 :set nowrap챔피언처럼 들어가면 그래도 랩핑.

J분할 된 코드 라인을 통합하기 위해 치면 실제 캐리지 리턴이 삽입 된 것처럼 보입니다. 나는 그것을 막는 이유와 방법을 이해할 수 없습니다.



답변

'textwidth' 'tw'        number  (default 0)
                        local to buffer
                        {not in Vi}
        Maximum width of text that is being inserted.  A longer line will be
        broken after white space to get this width.  A zero value disables
        this.  'textwidth' is set to 0 when the 'paste' option is set.  When
        'textwidth' is zero, 'wrapmargin' may be used.  See also
        'formatoptions' and |ins-textwidth|.
        When 'formatexpr' is set it will be used to break the line.
        NOTE: This option is set to 0 when 'compatible' is set.


'wrapmargin' 'wm'       number  (default 0)
                        local to buffer
        Number of characters from the right window border where wrapping
        starts.  When typing text beyond this limit, an <EOL> will be inserted
        and inserting continues on the next line.
        Options that add a margin, such as 'number' and 'foldcolumn', cause
        the text width to be further reduced.  This is Vi compatible.
        When 'textwidth' is non-zero, this option is not used.
        See also 'formatoptions' and |ins-textwidth|.  {Vi: works differently
        and less usefully}

긴 줄 자동 줄 바꿈을 참조하면 다음 줄로 보내십시오.

:set textwidth=0
:set wrapmargin=0


답변

다른 답변 중 어느 것도 나를 위해 일하지 않았습니다 (IDK 이유).

:set wrap! 나를 위해 트릭을 수행했습니다 (Windows 용 GVim 사용).


답변

set formatoptions-=t 트릭을해야합니다. set formatoptions+=t자동 줄 바꿈을 다시 켭니다.

로 할 수있는 작업에 대한 자세한 내용 은 문서를formatoptions 참조하십시오 .


답변

vim이 긴 줄을 감싸는 것을 방지하기 위해 다음 두 줄을 사용합니다 .vimrc.

set nowrap           " do not automatically wrap on load
set formatoptions-=t " do not automatically wrap text when typing


답변

줄 바꿈을 비활성화하려면
:set wrap!이 명령을 ~/.vimrc.


답변

설정 한 텍스트 너비 일 수 있으며, 특정 길이에 도달하면 자동으로 줄을 끊습니다.

:set tw=0

그것이 실패하면 예를 들어

:set wrap linebreak textwidth=0

:set virtualedit=insert


답변

Vim은 vi 호환 모드 여야 합니다 .