diff options
| author | Nanderty <psopka@sopka.ch> | 2023-03-20 16:29:49 +0100 |
|---|---|---|
| committer | Nanderty <psopka@sopka.ch> | 2023-03-20 16:29:49 +0100 |
| commit | 7111388965e01e9c712dfc2288028952fe78b664 (patch) | |
| tree | 5f499fc0fbfc2122066b86d02987604146bd5e09 /lua/utilities | |
| parent | 423133102d96556d121a97689be1f4f6542e320c (diff) | |
| download | neovim-config-7111388965e01e9c712dfc2288028952fe78b664.tar.gz neovim-config-7111388965e01e9c712dfc2288028952fe78b664.tar.bz2 neovim-config-7111388965e01e9c712dfc2288028952fe78b664.zip | |
lazyvim
Diffstat (limited to 'lua/utilities')
| -rw-r--r-- | lua/utilities/util.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lua/utilities/util.lua b/lua/utilities/util.lua new file mode 100644 index 0000000..ec6c400 --- /dev/null +++ b/lua/utilities/util.lua @@ -0,0 +1,19 @@ +local M = {} + +function M.telescope(builtin, opts) + local params = { builtin = builtin, opts = opts } + return function() + builtin = params.builtin + opts = params.opts + opts = vim.tbl_deep_extend("force", { cwd = M.get_root() }, opts or {}) + if builtin == "files" then + if vim.loop.fs_stat((opts.cwd or vim.loop.cwd()) .. "/.git") then + opts.show_untracked = true + builtin = "git_files" + else + builtin = "find_files" + end + end + require("telescope.builtin")[builtin](opts) + end +end |
