2024-02-21 10:33:44 +00:00
|
|
|
local path_utils = require("codesnap.utils.path")
|
2024-07-30 06:11:20 +00:00
|
|
|
-- Get user os
|
|
|
|
-- If linux, use XDG_PICTURE_DIR, if mac use ~/Pictures, if windows use FOLDERID_Pictures (If support is added back)
|
|
|
|
local default_save_path = nil
|
|
|
|
local os_name = vim.loop.os_uname().sysname
|
|
|
|
if os_name == "Linux" then
|
|
|
|
default_save_path = os.getenv("XDG_PICTURES_DIR") or (os.getenv("HOME") .. "/Pictures")
|
|
|
|
elseif os_name == "Darwin" then
|
|
|
|
default_save_path = os.getenv("HOME") .. "/Pictures"
|
|
|
|
else
|
|
|
|
error("codesnap.nvim only supports Linux and MacOS")
|
|
|
|
end
|
2024-02-21 10:33:44 +00:00
|
|
|
|
2024-02-13 06:05:36 +00:00
|
|
|
return {
|
2024-02-14 17:15:26 +00:00
|
|
|
config = {
|
|
|
|
mac_window_bar = true,
|
2024-03-16 17:07:12 +00:00
|
|
|
title = "CodeSnap.nvim",
|
|
|
|
code_font_family = "CaskaydiaCove Nerd Font",
|
2024-02-24 11:01:39 +00:00
|
|
|
watermark_font_family = "Pacifico",
|
2024-03-16 17:07:12 +00:00
|
|
|
watermark = "CodeSnap.nvim",
|
2024-03-17 09:12:47 +00:00
|
|
|
bg_theme = "default",
|
2024-03-17 14:34:01 +00:00
|
|
|
breadcrumbs_separator = "/",
|
|
|
|
has_breadcrumbs = false,
|
2024-04-25 17:01:17 +00:00
|
|
|
has_line_number = false,
|
2024-05-07 13:34:14 +00:00
|
|
|
show_workspace = false,
|
2024-05-07 08:35:21 +00:00
|
|
|
min_width = 0,
|
2024-07-04 05:50:06 +00:00
|
|
|
bg_x_padding = 122,
|
|
|
|
bg_y_padding = 82,
|
2024-07-30 06:11:20 +00:00
|
|
|
save_path = default_save_path,
|
2024-02-14 17:15:26 +00:00
|
|
|
},
|
2024-02-21 10:33:44 +00:00
|
|
|
cwd = path_utils.back(path_utils.back(debug.getinfo(1, "S").source:sub(2):match("(.*[/\\])"))),
|
2024-02-19 14:27:17 +00:00
|
|
|
preview_switch = true,
|
2024-02-13 06:05:36 +00:00
|
|
|
}
|