summaryrefslogtreecommitdiffstats
path: root/after/plugin/telescope.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2024-08-09 02:45:31 -0400
committerSquibid <me@zacharyscheiman.com>2024-08-09 02:45:31 -0400
commitc489d393695e90d424f9ae51e35c4d42358e6a71 (patch)
tree12ea97ec4684fd82cd6b73dd127d0137b115837b /after/plugin/telescope.lua
parentad76983d969c318e6e234bc82384b4b025d70447 (diff)
downloadnvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.gz
nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.bz2
nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.zip
yes there's a bit of java in my nvim config why do you ask?
Diffstat (limited to '')
-rw-r--r--after/plugin/telescope.lua97
1 files changed, 0 insertions, 97 deletions
diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua
deleted file mode 100644
index 31c4a0b..0000000
--- a/after/plugin/telescope.lua
+++ /dev/null
@@ -1,97 +0,0 @@
-local status_ok, telescope = pcall(require, "telescope")
-if not status_ok then
- return
-end
-local actions = require('telescope.actions')
-local action_layout = require("telescope.actions.layout")
-
-local function telescopew()
- if vim.o.columns <= 80 then
- return vim.o.columns
- else
- return 0.8
- end
-end
-
-telescope.setup {
- defaults = {
- borderchars = {
- prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
- results = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
- preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' },
- },
- winblend = 0,
- layout_strategy = 'horizontal',
- sorting_strategy = 'descending',
- scroll_strategy = 'limit',
- layout_config = {
- horizontal = {
- width = telescopew(),
- height = 20,
- prompt_position = 'bottom',
- anchor = 'N',
- }
- },
- preview = {
- -- add image previews via chafa
- mime_hook = function(filepath, bufnr, opts)
- local function is_image(filepath)
- local image_extensions = { -- supported image formats
- 'png',
- 'jpg',
- 'jpe',
- 'jpeg',
- 'webp',
- 'gif'
- }
- local split_path = vim.split(filepath:lower(), '.', { plain=true })
- local extension = split_path[#split_path]
- return vim.tbl_contains(image_extensions, extension)
- end
- if is_image(filepath) and vim.fn.executable('chafa') == 1 then
- local term = vim.api.nvim_open_term(bufnr, {})
- local function send_output(_, data, _)
- for _, d in ipairs(data) do
- vim.api.nvim_chan_send(term, d..'\r\n')
- end
- end
- vim.fn.jobstart({
- 'chafa', '-C', 'on', '--animate', 'off', '-s',
- '23x18', '--clear', filepath
- }, { on_stdout = send_output, stdout_buffered = true, pty = true })
- a.nvim_set_option_value("number", false, { buf = bufnr })
- else
- require("telescope.previewers.utils").set_preview_message(bufnr,
- opts.winid, "File cannot be previewed")
- end
- end
- },
- mappings = {
- i = {
- ["<esc>"] = actions.close,
- ['<C-h>'] = 'which_key',
- ['<C-j>'] = actions.move_selection_next,
- ['<C-k>'] = actions.move_selection_previous,
- ['<C-l>'] = actions.select_default,
- ['<C-u>'] = actions.preview_scrolling_up,
- ['<C-d>'] = actions.preview_scrolling_down,
- ["<C-p>"] = action_layout.toggle_preview
- },
- n = {
- ["gg"] = actions.move_to_top,
- ["G"] = actions.move_to_bottom,
- },
- },
- }
-}
-telescope.load_extension('file_browser')
-telescope.load_extension('projects')
-telescope.load_extension('fzf')
-telescope.load_extension('harpoon')
-
-a.nvim_create_autocmd('User', {
- pattern = 'TelescopePreviewerLoaded',
- callback = function()
- vim.opt.winblend = 0
- end,
-})