-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.lua
More file actions
65 lines (60 loc) · 2.03 KB
/
Copy pathconfig.lua
File metadata and controls
65 lines (60 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---@class Config
---@field sidebar SidebarConfig
---@field cwd_only boolean Keep only entries that are in the current working directory
---@field ignore_gitignored boolean Ignore files that are ignored by .gitignore
---@field direct_jump_as_new_entry boolean When jumping to a file with open_file, add it to the stack as a new entry, otherwise keep the stack as is
---@field insert_mode_on_top boolean When entering insert mode and the file is not on top of the stack, add it to the top
---@field quit_when_last_window boolean Whether to quit when navstack detects the sidebar is the only window left
---@field max_files number Maximum number of files to keep in the stack
---@field ignored_filetypes table<string, boolean> Filetypes to ignore
---@field persist_to_disk boolean Whether to persist the stack to disk, it's saved in the cache directory per cwd
---@field window_float vim.api.keyset.win_config Config for the floating window
---@field win_type "sidebar" | "float" | "tabline" Type of window to use
---@field tabline_config TabLineConfig
---@class SidebarConfig
---@field align "left" | "right"
---@field width number
---@field open_on_start boolean Whether to open the sidebar on startup
---@class TabLineConfig
---@field separator string
---@field left_padding string
Config = {
win_type = "sidebar",
sidebar = {
align = "right",
width = 50,
open_on_start = false,
},
cwd_only = true,
ignore_gitignored = true,
direct_jump_as_new_entry = true,
insert_mode_on_top = true,
quit_when_last_window = false,
max_files = 9,
persist_to_disk = true,
ignored_filetypes = {
["neo-tree"] = true,
["neotree"] = true,
["gitcommit"] = true,
["NeogitStatus"] = true,
["oil"] = true,
["help"] = true,
["nofile"] = true,
},
window_float = {
relative = "editor",
width = 40,
height = 20,
style = "minimal",
border = "rounded",
},
tabline_config = {
separator = "│",
left_padding = "",
},
}
---@param custom Config | nil
function Config:create(custom)
return vim.tbl_deep_extend("force", Config, custom or {})
end
return Config