diff options
| author | Corentin Brunel <devildead13@gmail.com> | 2021-07-16 14:17:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-16 19:17:21 +0100 |
| commit | b13306e5cc6da855f77e02b37e807a4b7e32b761 (patch) | |
| tree | 03215a5aecc6e09d39aa376a84075af2b9b5ec17 /lua/telescope/themes.lua | |
| parent | 747396227d1e2283d4d59693ffec571a52195627 (diff) | |
feat: add cursor layout (#878)
* Add basic implementation of "cursor" layout strategy
* Update cursor layout strategy to properly follow cursor
* feat(cursor_layout): handle previewer
* Refactor cursor layout code
* Add cursor theme
* Update readme
* Improve cursor theme and layout documentation
* [docgen] Update doc/telescope.txt
skip-checks: true
* Remove trailing whitespace
* Fix issues related with neovim and plugin api changes
* [docgen] Update doc/telescope.txt
skip-checks: true
* Allow preview width to be configured
* [docgen] Update doc/telescope.txt
skip-checks: true
Co-authored-by: Github Actions <actions@github>
Co-authored-by: cbrunel <cbrunel@sogescom.local>
Diffstat (limited to 'lua/telescope/themes.lua')
| -rw-r--r-- | lua/telescope/themes.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lua/telescope/themes.lua b/lua/telescope/themes.lua index 939f79a..3b2036b 100644 --- a/lua/telescope/themes.lua +++ b/lua/telescope/themes.lua @@ -58,6 +58,44 @@ function themes.get_dropdown(opts) return vim.tbl_deep_extend("force", theme_opts, opts) end +--- Cursor style theme. +--- <pre> +--- +--- Usage: +--- +--- `local builtin = require('telescope.builtin')` +--- `local themes = require('telescope.themes')` +--- `builtin.lsp_code_actions(themes.get_cursor())` +--- </pre> +function themes.get_cursor(opts) + opts = opts or {} + + local theme_opts = { + theme = 'cursor', + + sorting_strategy = 'ascending', + results_title = false, + layout_strategy = 'cursor', + layout_config = { + width = function(_, _, _) + return 80 + end, + + height = function(_, _, _) + return 6 + end, + }, + borderchars = { + { '─', '│', '─', '│', '╭', '╮', '╯', '╰'}, + prompt = {'─', '│', ' ', '│', '╭', '╮', '│', '│'}, + results = {'─', '│', '─', '│', '├', '┤', '╯', '╰'}, + preview = { '─', '│', '─', '│', '╭', '╮', '╯', '╰'}, + }, + } + + return vim.tbl_deep_extend('force', theme_opts, opts) +end + --- Ivy style theme. --- <pre> --- |
