Skip to main content
Module

x/ddc_vim/deps.ts>op.fileformats

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
variable op.fileformats
import { op } from "https://deno.land/x/ddc_vim@v2.3.0/deps.ts";
const { fileformats } = op;

This gives the end-of-line () formats that will be tried when starting to edit a new buffer and when reading a file into an existing buffer:

  • When empty, the format defined with 'fileformat' will be used always. It is not set automatically.
  • When set to one name, that format will be used whenever a new buffer is opened. 'fileformat' is set accordingly for that buffer. The 'fileformats' name will be used when a file is read into an existing buffer, no matter what 'fileformat' for that buffer is set to.
  • When more than one name is present, separated by commas, automatic detection will be done when reading a file. When starting to edit a file, a check is done for the :
    1. If all lines end in , and 'fileformats' includes "dos", 'fileformat' is set to "dos".
    2. If a is found and 'fileformats' includes "unix", 'fileformat' is set to "unix". Note that when a is found without a preceding , "unix" is preferred over "dos".
    3. If 'fileformat' has not yet been set, and if a is found, and if 'fileformats' includes "mac", 'fileformat' is set to "mac". This means that "mac" is only chosen when: "unix" is not present or no is found in the file, and "dos" is not present or no is found in the file. Except: if "unix" was chosen, but there is a before the first , and there appear to be more s than s in the first few lines, "mac" is used.
    4. If 'fileformat' is still not set, the first name from 'fileformats' is used. When reading a file into an existing buffer, the same is done, but this happens like 'fileformat' has been set appropriately for that file only, the option is not changed. When 'binary' is set, the value of 'fileformats' is not used.