사용자 도구

사이트 도구


application:vim:fileformat

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
application:vim:fileformat [2007/09/24 13:31]
starlits 새로 만듬
application:vim:fileformat [2009/12/28 23:30] (현재)
starlits
줄 1: 줄 1:
 ====== File Format ====== ====== File Format ======
 +
  
 ===== 개요 ===== ===== 개요 =====
줄 7: 줄 8:
  
 ^ OS ^ Format ^ 키 or ASCII ^ ^ OS ^ Format ^ 키 or ASCII ^
-^ Unix | <LF> (line feed) | <code>^J or 0x0A</code> +^ Unix | <LF> (line feed) | ''%%^J or 0x0A%%'' 
-^ Mac  | <CR> (carriage return) | <code>^M or 0x0D</code> |  +^ Mac  | <CR> (carriage return) | ''%%^M or 0x0D%%'' |  
-^ Dos  | <CR><LF><code>^M^J or 0x0D0A</code> |+^ Dos  | <CR><LF>''%%^M^J or 0x0D0A%%'' |
  
  
줄 40: 줄 41:
     - The true fileformat is not found in 'fileformats', \\ eg a Mac file on a Unix platform using the defaults      - The true fileformat is not found in 'fileformats', \\ eg a Mac file on a Unix platform using the defaults 
     - There is a mix of line-ending sequences. \\ This can happen when mixing tools made for different platforms.      - There is a mix of line-ending sequences. \\ This can happen when mixing tools made for different platforms. 
 +
 +
  
  
줄 47: 줄 50:
  
 | File contents | Line 1 \\ Line 2 | | File contents | Line 1 \\ Line 2 |
-| unix line-ends, ff=mac | <code>Line 1^JLine 2^J</code> |+| unix line-ends, ff=mac | ''%%Line 1^JLine 2^J%%'' |
 | unix line-ends, ff=dos | Line 1 \\ Line 2 | | unix line-ends, ff=dos | Line 1 \\ Line 2 |
-| dos line-ends, ff=unix | <code>Line 1^M  +| dos line-ends, ff=unix | ''%%Line 1^M%%'' \\ ''%%Line 2^M%%'' 
-Line 2^M</code> +| dos line-ends, ff=mac | ''%%Line 1%%'' \\ ''%%^JLine 2%%'' \\ ''%%^J%%'' 
-| dos line-ends, ff=mac | <code>Line 1  +| mac line-ends, ff=unix | ''%%Line 1^MLine 2^M%%'' 
-^JLine 2  +| mac line-ends, ff=dos ''%%Line 1^MLine 2^M%%'' |
-^J</code> +
-| mac line-ends, ff=unix | <code>Line 1^MLine 2^M</code> +
-| mac line-ends, ff=dos <code>Line 1^MLine 2^M</code> |+
    
  
줄 67: 줄 67:
  
 ===== Fixing Inconsistent Line Endings ===== ===== Fixing Inconsistent Line Endings =====
-  - If you have extra leading or trailing characters (^M in unix or ^J in mac), use **:%s/\r//** to remove them. +  - If you have extra leading or trailing characters (^M in unix or ^J in mac), use **:%s/\r/''/''** to remove them. 
   - If you have long lines (mac line-ends with ff=dos or unix, unix line ends with ff=mac), use **:%s/\r/\r/g** to replace the wrong line-ends with the correct line-ends.    - If you have long lines (mac line-ends with ff=dos or unix, unix line ends with ff=mac), use **:%s/\r/\r/g** to replace the wrong line-ends with the correct line-ends. 
   - If you are curious, the reasoning behind this methodology appears below.   - If you are curious, the reasoning behind this methodology appears below.
 +
  
 ===== The Nitty-Gritty (핵심) ===== ===== The Nitty-Gritty (핵심) =====
application/vim/fileformat.1190608284.txt.gz · 마지막으로 수정됨: 2007/09/24 13:31 저자 starlits