summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/builtin/init.lua')
-rw-r--r--lua/telescope/builtin/init.lua34
1 files changed, 33 insertions, 1 deletions
diff --git a/lua/telescope/builtin/init.lua b/lua/telescope/builtin/init.lua
index faef9d6..86055a2 100644
--- a/lua/telescope/builtin/init.lua
+++ b/lua/telescope/builtin/init.lua
@@ -788,7 +788,7 @@ builtin.man_pages = function(opts)
end
pickers.new(opts, {
- prompt_tile = 'Man',
+ prompt_title = 'Man',
finder = finders.new_table {
results = lines,
entry_maker = make_entry.gen_from_apropos(opts),
@@ -859,6 +859,38 @@ builtin.marks = function(opts)
}):find()
end
+builtin.registers = function(opts)
+ opts = opts or {}
+
+ local registers_table = {"\"", "_", "#", "=", "_", "/", "*", "+", ":", ".", "%"}
+
+ -- named
+ for i = 0, 9 do
+ table.insert(registers_table, tostring(i))
+ end
+
+ -- alphabetical
+ for i = 65, 90 do
+ table.insert(registers_table, string.char(i))
+ end
+
+ pickers.new(opts,{
+ prompt_title = 'Registers',
+ finder = finders.new_table {
+ results = registers_table,
+ entry_maker = make_entry.gen_from_registers(opts),
+ },
+ -- use levenshtein as n-gram doesn't support <2 char matches
+ sorter = sorters.get_levenshtein_sorter(),
+ attach_mappings = function(_, map)
+ map('i', '<CR>', actions.paste_register)
+ map('i', '<C-e>', actions.edit_register)
+
+ return true
+ end,
+ }):find()
+end
+
-- find normal mode mappings
builtin.keymaps = function(opts)
opts = opts or {}