Výsledky 1 až 2 z 2

Téma: ViM - pridava na konec souboru znak 0A

  1. #1
    Senior Member mince Avatar uživatele KtK
    Založen
    16.10.2002
    Bydliště
    Behind fuc*ing WorkTable Device (Praha zapad)
    Příspěvky
    1 709
    Vliv
    298

    Standardní ViM - pridava na konec souboru znak 0A

    zedituju soubor, ulozim, a kdyz ho otevru v libovolnem jinem editoru, tak je videt, zena konci je znak 0A (LineFeed). Sam Vim pritom dela, ze nic nevidi, tj posledni radek je se znaky, a pak uz vlnovky, jakoze dal uz neni nic.. Je lhostejne, jestli je soubor s dosovskymi crlf, nebo unixovymi lf oddelovaci radku.

    je to ViM 6.3, cygwin, a pro jistotu pridavam .vimrc (stazene odnekud z webu a jen velmi mirne upravene - ty imapy-abych mel dostupnou diakritiku):

    Kód:
    " File:        .vimrc
    " Author&#58;      Gustavo Picon <tabo@slashcore.com>
    " Last Change&#58; 2004 Feb 10 &#40;Vim 6.2.72&#41;
    " Download&#58;    http&#58;//slashcore.com/tabo/code/vimrc
    " License&#58;     This file is placed in the publid domain
    " Disclaimer&#58;  Published as-is, no support, no warranty
    
    
    set nocompatible               " VIM extensions, not very VI compatible;
                                   "   this setting must be set because when vim
                                   "   finds a .vimrc on startup, it will set
                                   "   itself as "compatible" with vi
    
    "
    " User Interface
    "
    
    imap <A-2> &#236;
    imap <A-3> &#185;
    imap <A-4> &#232;
    imap <A-5> &#248;
    imap <A-6> &#190;
    imap <A-7> ý
    imap <A-8> á
    imap <A-9> í
    
    "imap <C-2> &#204;
    "imap <C-3> ©
    "imap <C-4> &#200;
    "imap <C-5> &#216;
    "imap <C-6> ®
    "imap <C-7> Ý
    "imap <C-8> Á
    "imap <C-9> Í
    
    
    " Syntax highlighting, only if the feature is available and the terminal can
    " display colors
    " &#40;tabo@20040210&#41; had to fix this because t_Co doesn't work in gvim@win32
    if has&#40;'syntax'&#41; && &#40;&t_Co > 2 || has&#40;'win32'&#41;&#41;
        syntax on                  " enable syntax highlighting
        colorscheme default        " load a colorscheme, it's redundant to use
                                   "   'default', but this setting is here to be
                                   "   modified
    endif
    
    set backspace=indent,eol,start " backspace for dummys
    set showmatch                  " show matching brackets/parenthesis
    set wildmode=list&#58;longest,full " comand <Tab> completion, list matches and
                                   "   complete the longest common part, then,
                                   "   cycle through the matches
    set shortmess+=filmnrxoOtT     " abbrev. of messages &#40;avoids 'hit enter'&#41;
    set showmode                   " display the current mode
    
    if has&#40;'cmdline_info'&#41;
        set ruler                  " show the ruler
        " a ruler on steroids
        set rulerformat=%30&#40;%=\&#58;b%n%y%m%r%w\ %l,%c%V\ %P%&#41;
        set showcmd                " show partial commands in status line and
                                   " selected characters/lines in visual mode
    endif
    
    if has&#40;'statusline'&#41;
        set laststatus=1           " show statusline only if there are > 1 windows
        " a statusline, also on steroids
        set statusline=%<%f\ %=\&#58;\b%n%y%m%r%w\ %l,%c%V\ %P
    endif
    
    "
    " Editing
    "
    
    filetype on                    " enable filetype detection
    set wrap                       " wrap long lines
    set autoindent                 " indent at the same level of the previous line
    set shiftwidth=4               " use indents of 4 spaces
    "set textwidth=0           " the text width - sere me zalamovani tam kde o to nestojim
    set formatoptions+=tcq         " basic formatting of text and comments
    set matchpairs+=<&#58;>            " match, to be used with % 
    
    autocmd FileType c,cpp call <SID>cstuff&#40;&#41;
    function <SID>cstuff&#40;&#41;
        set cindent
        set formatoptions+=croql
        set formatoptions-=t
    endfunction
    
    "
    " gvim- &#40;here instead of .gvimrc&#41;
    "
    
    if has&#40;'gui_running'&#41; 
        set guioptions-=T          " remove the toolbar &#40;a toolbar in vi? please,
                                   "   what's next? document tabs and mdi?&#41;
        set lines=40               " 40 lines of text instead of 24,
                                   "   perfect for 1024x768
    endif
    
    "
    " misc, there is _always_ a misc section
    "
    
    "set nobackup " real men _never_ _ever_ do backups, but I do.dfkgjk
    set backup
    " to please the gods
    iabbrev cthuf Ia! Ia! Cthulhu fhtagn! Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn! Cthulhu fhtagn! Cthulhu fhtagn!
    
    
    set ts=2 tw=0
    
    " vim&#58; set sw=4 ts=8 sts=0 et tw=78 nofen fdm=indent ft=vim &#58;
    Parasite lost, AKA the Girlfriend Mission:The Socka Project sleeps, lets use (her :) Durex! 1GHz in some soltek stuff, Ati rage 128, etc.. (it\'s noisy)
    IMB Thinkpad R31: celer 1.2GHz, 384M RAM, 60GB 5400rpm hitachi, i810 8MB onboard (na praci to staci ;)
    [pro archivni ucely] janina overclockerska poradna (.tar.gz, 1.1MB, otevrete si index.html v browseru podporujicim javascript a frames)

  2. #2
    Senior Member mince Avatar uživatele KtK
    Založen
    16.10.2002
    Bydliště
    Behind fuc*ing WorkTable Device (Praha zapad)
    Příspěvky
    1 709
    Vliv
    298

    Standardní

    tak je tu jisty postup..

    existuje option "endofline", resp "noendofline". -ta tohle ovlivnuje, defaultne je on, tj dava na konec ten break, jenze se na ni hledi pouze v pripade, ze je nastaveno i "binary" coz se mi nevyhovuje.. Viz uryvek z helpu: (resp podle mych predstav se to chova a vypada, pokud si nastavim ty dve optiony za behu, ne z vimrc, coz je na houby.)

    Kód:
                            *'endofline'* *'eol'* *'noendofline'* *'noeol'*
    'endofline' 'eol'       boolean &#40;default on&#41;
                            local to buffer
                            &#123;not in Vi&#125;
            When writing a file and this option is off and the 'binary' option
            is on, no <EOL> will be written for the last line in the file.  This
            option is automatically set when starting to edit a new file, unless
            the file does not have an <EOL> for the last line in the file, in
            which case it is reset.  Normally you don't have to set or reset this
            option.  When 'binary' is off the value is not used when writing the
            file.  When 'binary' is on it is used to remember the presence of a
            <EOL> for the last line in the file, so that when you write the file
            the situation from the original file can be kept.  But you can change
            it if you want to.
    Parasite lost, AKA the Girlfriend Mission:The Socka Project sleeps, lets use (her :) Durex! 1GHz in some soltek stuff, Ati rage 128, etc.. (it\'s noisy)
    IMB Thinkpad R31: celer 1.2GHz, 384M RAM, 60GB 5400rpm hitachi, i810 8MB onboard (na praci to staci ;)
    [pro archivni ucely] janina overclockerska poradna (.tar.gz, 1.1MB, otevrete si index.html v browseru podporujicim javascript a frames)

Informace o tématu

Users Browsing this Thread

Toto téma si právě prohlíží 1 uživatelů. (0 registrovaných a 1 anonymních)

Pravidla přispívání

  • Nemůžete zakládat nová témata
  • Nemůžete zasílat odpovědi
  • Nemůžete přikládat přílohy
  • Nemůžete upravovat své příspěvky
  •