Skip to content

Commit

Permalink
new option
Browse files Browse the repository at this point in the history
  • Loading branch information
Futarimiti committed Oct 3, 2023
1 parent 1b7c407 commit 1a9cb46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ require('spooky').setup { directory = vim.fn.stdpath('config') .. '/skeletons'
, auto_use_only = true
, show_no_template = true
, ui = { select = 'builtin'
, select_full_path = false
, prompt = 'Select template'
, previewer_prompt = 'Preview'
, preview_normalised = true
Expand All @@ -60,6 +61,7 @@ Full description of the options:
| `auto_use_only` | boolean | Whether to only use auto-inserted skeletons when only 1 available |
| `show_no_template` | boolean | Whether to show "no template" as a possible choice |
| `ui.select` | string | UI to use for selecting templates, one of `'builtin'` and `'telescope'` |
| `ui.select_full_path` | boolean | Whether to show full templates paths or basenames in selection UI |
| `ui.prompt` | string | Prompt for selecting templates |
| `ui.previewer_prompt` | string | Prompt for previewing templates (Telescope only) |
| `ui.preview_normalised` | boolean | Whether to show normalised template in preview (Telescope only) |
Expand Down
2 changes: 2 additions & 0 deletions lua/spooky/config/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ M.defaults = { directory = vim.fn.stdpath('config') .. '/skeletons'
, auto_use_only = true
, show_no_template = true
, ui = { select = 'builtin'
, select_full_path = false
, prompt = 'Select template'
, previewer_prompt = 'Preview'
, preview_normalised = true
Expand All @@ -23,6 +24,7 @@ M.typecheck = function (config)
, show_no_template = { config.show_no_template, 'boolean' }
, ui = { config.ui, 'table' }
, ['ui.select'] = { config.ui.select, function (ui) return vim.tbl_contains(const.ui_list, ui) end }
, ['ui.select_full_path'] = { config.ui.select_full_path, 'boolean' }
, ['ui.prompt'] = { config.ui.prompt, 'string' }
, ['ui.previewer_prompt'] = { config.ui.previewer_prompt, 'string' }
, ['ui.preview_normalised'] = { config.ui.preview_normalised, 'boolean' }
Expand Down

0 comments on commit 1a9cb46

Please sign in to comment.