summaryrefslogtreecommitdiff
path: root/scratch
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2021-08-11 08:59:56 -0400
committerGitHub <noreply@github.com>2021-08-11 08:59:56 -0400
commitb5d7f48e705adbe6453e4e5c1f4e01ee2d5f0f7f (patch)
tree2497745750951acdb00f59c299124886fecee4de /scratch
parenta056a9c7e001f620f759b672264c03d8a2386e31 (diff)
doc: Update information about popup.nvim (#1103)
* doc: Update information about popup.nvim * fixup: Got rest of popup.nvim mentions
Diffstat (limited to 'scratch')
-rw-r--r--scratch/clason_finders.lua54
-rw-r--r--scratch/completion_init.vim1
-rw-r--r--scratch/digia_init.vim1
3 files changed, 26 insertions, 30 deletions
diff --git a/scratch/clason_finders.lua b/scratch/clason_finders.lua
index ee25d8f..f6d730b 100644
--- a/scratch/clason_finders.lua
+++ b/scratch/clason_finders.lua
@@ -1,14 +1,13 @@
vim.cmd [[packadd! plenary.nvim]]
-vim.cmd [[packadd! popup.nvim]]
vim.cmd [[packadd! telescope.nvim]]
-local finders = require('telescope.finders')
-local previewers = require('telescope.previewers')
-local pickers = require('telescope.pickers')
-local sorters = require('telescope.sorters')
-local utils = require('telescope.utils')
+local finders = require "telescope.finders"
+local previewers = require "telescope.previewers"
+local pickers = require "telescope.pickers"
+local sorters = require "telescope.sorters"
+local utils = require "telescope.utils"
-local rgargs = {'--color=never', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'}
+local rgargs = { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" }
-- grep typed string in current directory (live, not fuzzy!)
finders.rg_live = function(opts)
local live_grepper = finders.new {
@@ -18,15 +17,15 @@ finders.rg_live = function(opts)
end
return {
- command = 'rg',
- args = vim.tbl_flatten{rgargs, prompt},
+ command = "rg",
+ args = vim.tbl_flatten { rgargs, prompt },
}
- end
+ end,
}
pickers.new(opts, {
- prompt = 'Live Grep',
- finder = live_grepper,
+ prompt = "Live Grep",
+ finder = live_grepper,
previewer = previewers.vimgrep,
}):find()
end
@@ -35,11 +34,11 @@ end
finders.rg = function(opts)
opts = opts or {}
- local search = opts.search or ''
+ local search = opts.search or ""
pickers.new(opts, {
- prompt = 'Find Word',
- finder = finders.new_oneshot_job(vim.tbl_flatten{'rg', rgargs, search}),
+ prompt = "Find Word",
+ finder = finders.new_oneshot_job(vim.tbl_flatten { "rg", rgargs, search }),
previewer = previewers.vimgrep,
sorter = sorters.get_norcalli_sorter(),
}):find()
@@ -48,8 +47,8 @@ end
-- fuzzy find files in current directory (may be slow in root dir)
finders.fd = function(opts)
pickers.new(opts, {
- prompt = 'Find Files',
- finder = finders.new_oneshot_job {"fd"},
+ prompt = "Find Files",
+ finder = finders.new_oneshot_job { "fd" },
previewer = previewers.bat,
sorter = sorters.get_fuzzy_file(),
}):find()
@@ -77,10 +76,10 @@ finders.lsp_references = function(opts)
end
pickers.new(opts, {
- prompt = 'LSP References',
- finder = finders.new_table(results),
+ prompt = "LSP References",
+ finder = finders.new_table(results),
previewer = previewers.qflist,
- sorter = sorters.get_norcalli_sorter(),
+ sorter = sorters.get_norcalli_sorter(),
}):find()
end
@@ -104,16 +103,16 @@ finders.lsp_document_symbols = function(opts)
end
pickers.new(opts, {
- prompt = 'LSP Document Symbols',
- finder = finders.new_table(results),
+ prompt = "LSP Document Symbols",
+ finder = finders.new_table(results),
previewer = previewers.qflist,
- sorter = sorters.get_norcalli_sorter(),
+ sorter = sorters.get_norcalli_sorter(),
}):find()
end
-- fuzzy find in all workspace symbols (may need longer timeout!)
finders.lsp_workspace_symbols = function(opts)
- local params = {query = ''}
+ local params = { query = "" }
local results_lsp, err = vim.lsp.buf_request_sync(0, "workspace/symbol", params, 1000)
if err then
vim.api.nvim_err_writeln("Error when finding symbols: " .. err)
@@ -131,12 +130,11 @@ finders.lsp_workspace_symbols = function(opts)
end
pickers.new(opts, {
- prompt = 'LSP Workspace Symbols',
- finder = finders.new_table(results),
+ prompt = "LSP Workspace Symbols",
+ finder = finders.new_table(results),
previewer = previewers.qflist,
- sorter = sorters.get_norcalli_sorter(),
+ sorter = sorters.get_norcalli_sorter(),
}):find()
end
-
return finders
diff --git a/scratch/completion_init.vim b/scratch/completion_init.vim
index 5b5deb9..9c51428 100644
--- a/scratch/completion_init.vim
+++ b/scratch/completion_init.vim
@@ -1,7 +1,6 @@
set rtp+=.
set rtp+=../plenary.nvim/
-set rtp+=../popup.nvim/
source plugin/telescope.vim
diff --git a/scratch/digia_init.vim b/scratch/digia_init.vim
index 06c9c7a..a619fef 100644
--- a/scratch/digia_init.vim
+++ b/scratch/digia_init.vim
@@ -1,6 +1,5 @@
set rtp+=.
set rtp+=../plenary.nvim/
-set rtp+=../popup.nvim/
set statusline=""