Back to Spacevim

data#dict API

docs/api/data/dict.md

2.4.0957 B
Original Source

Available APIs >> data#dict

<!-- vim-markdown-toc GFM --> <!-- vim-markdown-toc -->

Intro

data#dict API provides some functions to manipulate a dict. Here is an example for using this api:

vim
let s:DICT = SpaceVim#api#import('data#dict')

functions

namedescription
make(keys, values, ...)make dict from keys and values
swap(dict)swap keys and values of a dict
make_index(list, ...)make a index dict from a list
omit(dict, keys)remove keys in a dict
clear(dict)clear a dict
pick(dict, keys)pick keys from a dict
max_by(dict, expr)get max entry based on expr
min_by(dict, expr)get min entry based on expr