Skip to content

simplyfile.util

Rizwanelansyah edited this page May 21, 2024 · 1 revision

simlyfile.util

List of avaible function or variable on simplyfile.util module:

get_highlight_name(data)

get devicon highlight name by data

@class SimplyFile.Directory

  • @field name name of the directory
  • @field absolute absolute path of the directory
  • @field is_folder true if the directory is folder or symlink otherwise false
  • @field icon nerd fonts icon that represent the directory
  • @field hl hl name of the directory icon
  • @field filetype filetype if its a file

dirs(path)

get all directory on path and represent each directory as SimplyFile.Directory class

trim_dot(path)

trim from /some/folder/../ to /some/ and from /some/folder/./ to /some/folder/

open_win(width, height, row, col, buf, enter)

open window with below config and enter to the window if enter is true and with buffer number buf and return the window handle

config:

{
    width = width,
    height = height,
    row = row,
    col = col,
    relative = 'editor',
    style = 'minimal',
    border = 'single',
}

win_edit_config(win, additional_config)

add/override all field on additional_config table to the window handle win

buf_unlocks(...)

make a buffer modifiable with buffer number in {...}

buf_locks(...)

make a buffer not modifiable with buffer number in {...}

callget(value, ...)

if value is not a function return value if value is a function call the value with parameter {...} then return the value

Clone this wiki locally