Skip to content

Commit

Permalink
docs: add comments to default options
Browse files Browse the repository at this point in the history
  • Loading branch information
HakonHarnes committed Dec 9, 2023
1 parent c2e4fce commit 9476e4b
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions lua/img-clip/config.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
local M = {}

local defaults = {
dir_path = "assets",
file_name = "%Y-%m-%d-%H-%M-%S",
use_absolute_path = false,
prompt_for_file_name = true,
show_dir_path_in_prompt = false,
insert_mode_after_paste = true,
respect_cursor_placment_in_template = true,

dir_path = "assets", -- directory path to save images to, can be relative or absolute
file_name = "%Y-%m-%d-%H-%M-%S", -- file name format (see lua.org/pil/22.1.html)
use_absolute_path = false, -- expands dir_path to absolute path
prompt_for_file_name = true, -- ask user for file name before saving, leave empty to use default
show_dir_path_in_prompt = false, -- show dir_path in prompt when prompting for file name
insert_mode_after_paste = true, -- enter insert mode after pasting the markup code
respect_cursor_placment_in_template = true, -- jump to cursor position in template after pasting

-- default template when filetype-specific template is not defined
template = "$FILE_PATH",

-- markdown specific options
markdown = {
-- any opt can be passed here to override the global config
-- e.g. insert_mode_after_paste = false,
template = "![$CURSOR]($FILE_PATH)",
},

-- html specific options
html = {
template = '<img src="$FILE_PATH" alt="$CURSOR">',
},

-- latex specific options
tex = {
template = [[
\begin{figure}[h]
Expand All @@ -30,6 +36,7 @@ local defaults = {
]],
},

-- typst specific options
typst = {
template = [[
#figure(
Expand Down

0 comments on commit 9476e4b

Please sign in to comment.