Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ddc_vim/deps.ts>fn.pathshorten

Dark deno-powered completion framework for neovim/Vim8
Very Popular
Go to Latest
function fn.pathshorten
import { fn } from "https://deno.land/x/ddc_vim@v2.4.0/deps.ts";
const { pathshorten } = fn;

Shorten directory names in the path {path} and return the result. The tail, the file name, is kept as-is. The other components in the path are reduced to {len} letters in length. If {len} is omitted or smaller than 1 then 1 is used (single letters). Leading '' and '.' characters are kept. Examples: :echo pathshorten('/.vim/autoload/myfile.vim') /.v/a/myfile.vim ~ :echo pathshorten('/.vim/autoload/myfile.vim', 2) ~/.vi/au/myfile.vim ~ It doesn't matter if the path exists or not. Can also be used as a |method|: GetDirectories()->pathshorten()

Parameters

denops: Denops
path: unknown
optional
len: unknown

Returns

Promise<unknown>