Skip to main content
Module

x/ddc_vim/deps.ts>op.directory

Dark deno-powered completion framework for neovim/Vim
Latest
variable op.directory
import { op } from "https://deno.land/x/ddc_vim@v4.3.1/deps.ts";
const { directory } = op;

List of directory names for the swap file, separated with commas. Recommended value: ".,~/vimswap//" - this will put the swap file next to the edited file if possible, and in your personal swap directory otherwise. Make sure "~/vimswap//" is only readable for you.

Possible items:

  • The swap file will be created in the first directory where this is possible.

  • Empty means that no swap file will be used (recovery is impossible!) and no E303 error will be given.

  • A directory "." means to put the swap file in the same directory as the edited file. On Unix, a dot is prepended to the file name, so it doesn't show in a directory listing. On MS-Windows the "hidden" attribute is set and a dot prepended if possible.

  • A directory starting with "./" (or "." for MS-Windows) means to put the swap file relative to where the edited file is. The leading "." is replaced with the path name of the edited file.

  • For Unix and Win32, if a directory ends in two path separators "//", the swap file name will be built from the complete path to the file with all path separators replaced by percent '%' signs (including the colon following the drive letter on Win32). This will ensure file name uniqueness in the preserve directory. On Win32, it is also possible to end with "\". However, When a separating comma is following, you must use "//", since "\" will include the comma in the file name. Therefore it is recommended to use '//', instead of '\'.

  • Spaces after the comma are ignored, other spaces are considered part of the directory name. To have a space at the start of a directory name, precede it with a backslash.

  • To include a comma in a directory name precede it with a backslash.

  • A directory name may end in an ':' or '/'.

  • Environment variables are expanded :set_env.

  • Careful with '' characters, type one before a space, type two to get one in the option (see option-backslash), for example:

    :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
    
  • For backwards compatibility with Vim version 3.0 a '>' at the start of the option is removed. Using "." first in the list is recommended. This means that editing the same file twice will result in a warning. Using "/tmp" on Unix is discouraged: When the system crashes you lose the swap file. "/var/tmp" is often not cleared when rebooting, thus is a better choice than "/tmp". But others on the computer may be able to see the files, and it can contain a lot of files, your swap files get lost in the crowd. That is why a "tmp" directory in your home directory is tried first. The use of :set+= and :set-= is preferred when adding or removing directories from the list. This avoids problems when a future version uses another default. This option cannot be set from a modeline or in the sandbox, for security reasons.

(default for Amiga: ".,t:", for Win32: ".,$TEMP,c:\tmp,c:\temp" for Unix: ".,~/tmp,/var/tmp,/tmp")

type

GlobalOption<string>